1 #ifndef DALI_INTERNAL_THREAD_CONTROLLER_INTERFACE_H
2 #define DALI_INTERNAL_THREAD_CONTROLLER_INTERFACE_H
5 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
21 #include <dali/public-api/signals/callback.h>
26 class RenderSurfaceInterface;
36 NORMAL, ///< Update and render
37 SKIP_RENDER ///< Update and resource upload but no rendering
41 * Interface Class for all controlling threads.
43 class ThreadControllerInterface
48 * Virtual destructor. Not intended as base class.
50 virtual ~ThreadControllerInterface() { }
53 * Initializes the thread controller
55 virtual void Initialize() = 0;
58 * @copydoc Dali::Adaptor::Start()
60 virtual void Start() = 0;
63 * @copydoc Dali::Adaptor::Pause()
65 virtual void Pause() = 0;
68 * @copydoc Dali::Adaptor::Resume()
70 virtual void Resume() = 0;
73 * @copydoc Dali::Adaptor::Stop()
75 virtual void Stop() = 0;
78 * Called by the adaptor when core requires another update
80 virtual void RequestUpdate() = 0;
83 * Called by the adaptor when core requires one update
84 * If Adaptor is paused, we do one update/render and return to pause
85 * @param updateMode The update mode (i.e. i.e. either update & render or skip rendering)
87 virtual void RequestUpdateOnce( UpdateMode updateMode ) = 0;
90 * Replaces the surface.
91 * @param surface new surface
93 virtual void ReplaceSurface( Dali::RenderSurfaceInterface* surface ) = 0;
98 virtual void ResizeSurface() = 0;
101 * Wait until the graphics is initialised.
103 virtual void WaitForGraphicsInitialization() = 0;
106 * @copydoc Dali::Adaptor::SetRenderRefreshRate()
108 virtual void SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender ) = 0;
111 * @copydoc Dali::Adaptor::SetPreRenderCallback()
113 virtual void SetPreRenderCallback( CallbackBase* callback ) = 0;
116 * @brief Adds the new surface.
117 * @param surface new surface
119 virtual void AddSurface( Dali::RenderSurfaceInterface* surface ) = 0;
126 ThreadControllerInterface() { }
130 // Undefined copy constructor.
131 ThreadControllerInterface( const ThreadControllerInterface& );
133 // Undefined assignment operator.
134 ThreadControllerInterface& operator=( const ThreadControllerInterface& );
137 } // namespace Adaptor
139 } // namespace Internal
143 #endif // DALI_INTERNAL_THREAD_CONTROLLER_INTERFACE_H