Remove de-funct Bullet dynamics plugin
[platform/core/uifw/dali-adaptor.git] / adaptors / base / update-render-controller.h
1 #ifndef __DALI_INTERNAL_UPDATE_RENDER_CONTROLLER_H__
2 #define __DALI_INTERNAL_UPDATE_RENDER_CONTROLLER_H__
3
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 namespace Dali
22 {
23
24 class RenderSurface;
25
26 namespace Internal
27 {
28
29 namespace Adaptor
30 {
31
32 class UpdateThread;
33 class RenderThread;
34 class VSyncNotifier;
35 class UpdateRenderSynchronization;
36 class AdaptorInternalServices;
37 class EnvironmentOptions;
38
39 /**
40  * Class to control the update and render threads.
41  */
42 class UpdateRenderController
43 {
44 public:
45
46   /**
47    * Constructor
48    */
49   UpdateRenderController( AdaptorInternalServices& adaptorInterfaces, const EnvironmentOptions& environmentOptions );
50
51   /**
52    * Non virtual destructor. Not intended as base class.
53    */
54   ~UpdateRenderController();
55
56   /**
57    * @copydoc Dali::Adaptor::Start()
58    */
59   void Start();
60
61   /**
62    * @copydoc Dali::Adaptor::Pause()
63    */
64   void Pause();
65
66   /**
67    * @copydoc Dali::Adaptor::Resume()
68    */
69   void Resume();
70
71   /**
72    * @copydoc Dali::Adaptor::Stop()
73    */
74   void Stop();
75
76   /**
77    * Ensure the frame time values are reset before the next call to Core::Update()
78    * following a Resume application state change.
79    */
80   void ResumeFrameTime();
81
82   /**
83    * Called by the adaptor when core requires another update
84    */
85   void RequestUpdate();
86
87   /**
88    * Called by the adaptor when core requires one update
89    * If Adaptor is paused, we do one update and return to pause
90    */
91   void RequestUpdateOnce();
92
93   /**
94    * Replaces the surface.
95    * @param surface new surface
96    */
97   void ReplaceSurface( RenderSurface* surface );
98
99   /**
100    * Provides a new surface. Should be used if the old surface has been lost
101    * for any reason.
102    * @param surface new surface
103    */
104   void NewSurface( RenderSurface* surface );
105
106   /**
107    * @copydoc Dali::Adaptor::SetRenderRefreshRate()
108    */
109   void SetRenderRefreshRate( unsigned int numberOfVSyncsPerRender );
110
111 private:
112
113   // Undefined copy constructor.
114   UpdateRenderController( const UpdateRenderController& );
115
116   // Undefined assignment operator.
117   UpdateRenderController& operator=( const UpdateRenderController& );
118
119   AdaptorInternalServices&     mAdaptorInterfaces;
120
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
126 };
127
128 } // namespace Adaptor
129
130 } // namespace Internal
131
132 } // namespace Dali
133
134 #endif // __DALI_INTERNAL_UPDATE_RENDER_CONTROLLER_H__