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.
33 class UpdateRenderSynchronization;
35 class AdaptorInternalServices;
36 class EnvironmentOptions;
39 * Class to control the update and render threads.
41 class UpdateRenderController
48 UpdateRenderController( AdaptorInternalServices& adaptorInterfaces, const EnvironmentOptions& environmentOptions );
51 * Non virtual destructor. Not intended as base class.
53 ~UpdateRenderController();
56 * @copydoc Dali::Adaptor::Start()
61 * @copydoc Dali::Adaptor::Pause()
66 * @copydoc Dali::Adaptor::Resume()
71 * @copydoc Dali::Adaptor::Stop()
76 * Ensure the frame time values are reset before the next call to Core::Update()
77 * following a Resume application state change.
79 void ResumeFrameTime();
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 UpdateRenderController( const UpdateRenderController& );
108 // Undefined assignment operator.
109 UpdateRenderController& operator=( const UpdateRenderController& );
111 AdaptorInternalServices& mAdaptorInterfaces;
113 UpdateThread* mUpdateThread; ///< The update-thread owned by UpdateRenderController
114 RenderThread* mRenderThread; ///< The render-thread owned by UpdateRenderController
115 VSyncNotifier* mVSyncNotifier; ///< The vsync-thread owned by UpdateRenderController
116 UpdateRenderSynchronization* mUpdateRenderSync; ///< Used to synchronize the update & render threads; also owned by UpdateRenderController
117 unsigned int mNumberOfVSyncsPerRender; ///< Frame skipping count
120 } // namespace Adaptor
122 } // namespace Internal
126 #endif // __DALI_INTERNAL_UPDATE_RENDER_CONTROLLER_H__