Dali 3D User Interface Engine
vsync-monitor.h
Go to the documentation of this file.
1 #ifndef __DALI_INTERNAL_VSYNC_MONITOR_IMPL_H__
2 #define __DALI_INTERNAL_VSYNC_MONITOR_IMPL_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 // EXTERNAL INCLUDES
22 #include <xf86drm.h>
23 
24 // INTERNAL INCLUDES
26 
27 namespace Dali
28 {
29 
30 namespace Internal
31 {
32 
33 namespace Adaptor
34 {
35 
40 {
41 public:
45  VSyncMonitor();
46 
50  virtual ~VSyncMonitor();
51 
52 public:
53 
58  void SetUseHardwareVSync( bool useHardware );
59 
64  void SetHardwareVSyncAvailable(bool available);
65 
66 private: // From Dali::Internal::Adaptor::VSyncMonitorInterface
67 
71  virtual void Initialize();
72 
76  virtual void Terminate();
77 
81  virtual bool UseHardware();
82 
86  virtual bool DoSync( unsigned int& frameNumber, unsigned int& seconds, unsigned int& microseconds );
87 
88 private:
89 
91  drmVBlank mVBlankInfo;
92  // NOTE cannot use booleans as these are used from multiple threads, must use variable with machine word size for atomic read/write
93  unsigned int mUseHardwareVSync;
94  unsigned int mHardwareVSyncAvailable;
95 };
96 
97 } // namespace Adaptor
98 
99 } // namespace Internal
100 
101 } // namespace Dali
102 
103 #endif // __DALI_INTERNAL_VSYNC_MONITOR_IMPL_H__
Dali Docs Home
Read more about Dali