1 #ifndef __DALI_INTERNAL_UPDATE_RENDER_CONTROLLER_H__
2 #define __DALI_INTERNAL_UPDATE_RENDER_CONTROLLER_H__
5 * Copyright (c) 2015 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.
35 class ThreadSynchronization;
36 class AdaptorInternalServices;
37 class EnvironmentOptions;
40 * Class to control all the threads.
42 class ThreadController
49 ThreadController( AdaptorInternalServices& adaptorInterfaces, const EnvironmentOptions& environmentOptions );
52 * Non virtual destructor. Not intended as base class.
57 * Initializes the thread controller
62 * @copydoc Dali::Adaptor::Start()
67 * @copydoc Dali::Adaptor::Pause()
72 * @copydoc Dali::Adaptor::Resume()
77 * @copydoc Dali::Adaptor::Stop()
82 * Called by the adaptor when core requires another update
87 * Called by the adaptor when core requires one update
88 * If Adaptor is paused, we do one update and return to pause
90 void RequestUpdateOnce();
93 * Replaces the surface.
94 * @param surface new surface
96 void ReplaceSurface( RenderSurface* surface );
99 * @copydoc Dali::Adaptor::SetRenderRefreshRate()
101 void SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender );
105 // Undefined copy constructor.
106 ThreadController( const ThreadController& );
108 // Undefined assignment operator.
109 ThreadController& operator=( const ThreadController& );
111 AdaptorInternalServices& mAdaptorInterfaces;
113 UpdateThread* mUpdateThread; ///< The update-thread owned by ThreadController
114 RenderThread* mRenderThread; ///< The render-thread owned by ThreadController
115 VSyncNotifier* mVSyncNotifier; ///< The vsync-thread owned by ThreadController
116 ThreadSynchronization* mThreadSync; ///< Used to synchronize all the threads; owned by ThreadController
117 unsigned int mNumberOfVSyncsPerRender; ///< Frame skipping count
120 } // namespace Adaptor
122 } // namespace Internal
126 #endif // __DALI_INTERNAL_UPDATE_RENDER_CONTROLLER_H__