1 #ifndef __DALI_INTERNAL_THREAD_CONTROLLER_H__
2 #define __DALI_INTERNAL_THREAD_CONTROLLER_H__
5 * Copyright (c) 2018 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.
20 #include <dali/public-api/signals/callback.h>
33 class AdaptorInternalServices;
34 class EnvironmentOptions;
35 class ThreadControllerInterface;
38 * Class to control all the threads.
40 class ThreadController
47 ThreadController( AdaptorInternalServices& adaptorInterfaces, const EnvironmentOptions& environmentOptions );
50 * Non virtual destructor. Not intended as base class.
55 * @brief Initializes the thread controller
57 * Will do any required initialiszation, e.g. initialize EGL, create threads (if required), etc.
59 * @note When this function returns, the application Init signal should be emitted
64 * @brief Called AFTER the Init signal has been emitted.
66 * In other words, should be called AFTER the Init signal has been emitted and all messages for the first scene
67 * have been queued for update to process.
72 * @brief When called, update and rendering is paused.
77 * @brief Resumes update/rendering after a previous pause.
82 * @brief Stops update/rendering altogether.
84 * Will shutdown EGL, destroy threads (if required) etc.
89 * @brief Called by the adaptor when core requires another update
94 * @brief Called by the adaptor when core requires one update
96 * @note If Adaptor is paused, we do one update/render only
98 void RequestUpdateOnce();
101 * @brief Replaces the surface.
103 * @param surface new surface
105 void ReplaceSurface( RenderSurface* surface );
108 * Resize the surface.
110 void ResizeSurface();
113 * @copydoc Dali::Adaptor::SetRenderRefreshRate()
115 void SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender );
118 * @copydoc Dali::Adaptor::SetPreRenderCallback
120 void SetPreRenderCallback( CallbackBase* callback );
124 // Undefined copy constructor.
125 ThreadController( const ThreadController& );
127 // Undefined assignment operator.
128 ThreadController& operator=( const ThreadController& );
132 ThreadControllerInterface* mThreadControllerInterface;
135 } // namespace Adaptor
137 } // namespace Internal
141 #endif // __DALI_INTERNAL_THREAD_CONTROLLER_H__