1 #ifndef __DALI_INTERNAL_UPDATE_RENDER_CONTROLLER_H__
2 #define __DALI_INTERNAL_UPDATE_RENDER_CONTROLLER_H__
5 * Copyright (c) 2014 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 UpdateRenderSynchronization;
36 class AdaptorInternalServices;
37 class EnvironmentOptions;
40 * Class to control the update and render threads.
42 class UpdateRenderController
49 UpdateRenderController( AdaptorInternalServices& adaptorInterfaces, const EnvironmentOptions& environmentOptions );
52 * Non virtual destructor. Not intended as base class.
54 ~UpdateRenderController();
57 * @copydoc Dali::Adaptor::Start()
62 * @copydoc Dali::Adaptor::Pause()
67 * @copydoc Dali::Adaptor::Resume()
72 * @copydoc Dali::Adaptor::Stop()
77 * Ensure the frame time values are reset before the next call to Core::Update()
78 * following a Resume application state change.
80 void ResumeFrameTime();
83 * Called by the adaptor when core requires another update
88 * Called by the adaptor when core requires one update
89 * If Adaptor is paused, we do one update and return to pause
91 void RequestUpdateOnce();
94 * Replaces the surface.
95 * @param surface new surface
97 void ReplaceSurface( RenderSurface* surface );
100 * Provides a new surface. Should be used if the old surface has been lost
102 * @param surface new surface
104 void NewSurface( RenderSurface* surface );
107 * @copydoc Dali::Adaptor::SetRenderRefreshRate()
109 void SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender );
113 // Undefined copy constructor.
114 UpdateRenderController( const UpdateRenderController& );
116 // Undefined assignment operator.
117 UpdateRenderController& operator=( const UpdateRenderController& );
119 AdaptorInternalServices& mAdaptorInterfaces;
121 UpdateThread* mUpdateThread; ///< The update-thread owned by UpdateRenderController
122 RenderThread* mRenderThread; ///< The render-thread owned by UpdateRenderController
123 VSyncNotifier* mVSyncNotifier; ///< The vsync-thread owned by UpdateRenderController
124 UpdateRenderSynchronization* mUpdateRenderSync; ///< Used to synchronize the update & render threads; also owned by UpdateRenderController
125 unsigned int mNumberOfVSyncsPerRender; ///< Frame skipping count
128 } // namespace Adaptor
130 } // namespace Internal
134 #endif // __DALI_INTERNAL_UPDATE_RENDER_CONTROLLER_H__