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
38 FORCE_RENDER ///< Force update and render
43 NORMAL, ///< The thread runs continuously
44 RUN_IF_REQUESTED ///< The threads runs when it is requested
48 * Interface Class for all controlling threads.
50 class ThreadControllerInterface
55 * Virtual destructor. Not intended as base class.
57 virtual ~ThreadControllerInterface() { }
60 * Initializes the thread controller
62 virtual void Initialize() = 0;
65 * @copydoc Dali::Adaptor::Start()
67 virtual void Start() = 0;
70 * @copydoc Dali::Adaptor::Pause()
72 virtual void Pause() = 0;
75 * @copydoc Dali::Adaptor::Resume()
77 virtual void Resume() = 0;
80 * @copydoc Dali::Adaptor::Stop()
82 virtual void Stop() = 0;
85 * Called by the adaptor when core requires another update
87 virtual void RequestUpdate() = 0;
90 * Called by the adaptor when core requires one update
91 * If Adaptor is paused, we do one update/render and return to pause
92 * @param updateMode The update mode (i.e. i.e. either update & render or skip rendering)
94 virtual void RequestUpdateOnce( UpdateMode updateMode ) = 0;
97 * Replaces the surface.
98 * @param surface new surface
100 virtual void ReplaceSurface( Dali::RenderSurfaceInterface* surface ) = 0;
103 * Deletes the surface.
104 * @param[in] surface The surface to be deleted
106 virtual void DeleteSurface( Dali::RenderSurfaceInterface* surface ) = 0;
109 * Resize the surface.
111 virtual void ResizeSurface() = 0;
114 * Wait until the graphics is initialised.
116 virtual void WaitForGraphicsInitialization() = 0;
119 * @copydoc Dali::Adaptor::SetRenderRefreshRate()
121 virtual void SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender ) = 0;
124 * @copydoc Dali::Adaptor::SetPreRenderCallback()
126 virtual void SetPreRenderCallback( CallbackBase* callback ) = 0;
129 * @brief Adds the new surface.
130 * @param surface new surface
132 virtual void AddSurface( Dali::RenderSurfaceInterface* surface ) = 0;
139 ThreadControllerInterface() { }
143 // Undefined copy constructor.
144 ThreadControllerInterface( const ThreadControllerInterface& );
146 // Undefined assignment operator.
147 ThreadControllerInterface& operator=( const ThreadControllerInterface& );
150 } // namespace Adaptor
152 } // namespace Internal
156 #endif // DALI_INTERNAL_THREAD_CONTROLLER_INTERFACE_H