Dali 3D User Interface Engine
single-thread-controller.h
Go to the documentation of this file.
1 #ifndef __DALI_INTERNAL_SINGLE_THREAD_CONTROLLER_H__
2 #define __DALI_INTERNAL_SINGLE_THREAD_CONTROLLER_H__
3 
4 /*
5  * Copyright (c) 2015 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 // EXTERNAL INCLUDES
22 #include <stdint.h>
25 
26 // INTERNAL INCLUDES
27 #include <timer.h>
29 #include <base/fps-tracker.h>
30 #include <base/render-helper.h>
33 
34 namespace Dali
35 {
36 
37 class RenderSurface;
38 
39 namespace Internal
40 {
41 
42 namespace Adaptor
43 {
44 
45 class AdaptorInternalServices;
46 class EnvironmentOptions;
47 
53 {
54 public:
55 
59  SingleThreadController( AdaptorInternalServices& adaptorInterfaces, const EnvironmentOptions& environmentOptions );
60 
65 
69  void Initialize();
70 
74  void Start();
75 
79  void Pause();
80 
84  void Resume();
85 
89  void Stop();
90 
94  void RequestUpdate();
95 
99  void RequestUpdateOnce();
100 
104  void ReplaceSurface( RenderSurface* surface );
105 
109  void SetRenderRefreshRate( unsigned int refreshRate );
110 
111 private:
112 
116  struct State
117  {
118  enum Type
119  {
124  };
125  };
126 
127  // Undefined copy constructor.
129 
130  // Undefined assignment operator.
132 
136  bool OnTimerTick();
137 
143  void UpdateRender( bool incrementTime );
144 
151 
157 
162  void ChangeState( State::Type state );
163 
167  void StopRendering();
168 
169 private:
170 
174 
176 
179 
181  uint64_t mSystemTime;
182  unsigned int mRefreshRate;
186 };
187 
188 } // namespace Adaptor
189 
190 } // namespace Internal
191 
192 } // namespace Dali
193 
194 #endif // __DALI_INTERNAL_SINGLE_THREAD_CONTROLLER_H__
Dali Docs Home
Read more about Dali