1 #ifndef __DALI_INTERNAL_VSYNC_NOTIFIER_H__
2 #define __DALI_INTERNAL_VSYNC_NOTIFIER_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 PlatformAbstraction;
37 } // namespace Integration
45 class VSyncMonitorInterface;
46 class UpdateRenderSynchronization;
47 class EnvironmentOptions;
48 class AdaptorInternalServices;
51 * Implements a simple class that either monitors vertical blanks from libdrm, or manages
52 * a software timer to handle syncing.
59 * Create the vsync notification thread; this will not start to monitor vsync and
60 * send notifications until Start() is called.
61 * @param[in] sync An object used to synchronize update, render and vsync threads.
62 * @param[in] adaptorInterfaces base adaptor interface
63 * @param[in] environmentOptions environment options
65 VSyncNotifier( UpdateRenderSynchronization& sync,
66 AdaptorInternalServices& adaptorInterfaces,
67 const EnvironmentOptions& environmentOptions);
70 * Non-virtual destructor; VSyncNotifier is not suitable as a base class.
87 * The main thread loop. The system thread will be destroyed on
88 * exit from this function.
94 UpdateRenderSynchronization& mUpdateRenderSync; ///< Used to synchronize the update, render & vsync threads
95 Dali::Integration::Core& mCore; ///< Dali core reference
96 Integration::PlatformAbstraction& mPlatformAbstraction; ///< The platform abstraction for retrieving the current time etc.
97 VSyncMonitorInterface* mVSyncMonitor; ///< VSyncMonitor interface
98 boost::thread* mThread; ///< The actual thread.
99 const EnvironmentOptions& mEnvironmentOptions; ///< Environment options
100 unsigned int mNumberOfVSyncsPerRender;///< How many frames for each update/render cycle.
102 }; // class VSyncNotifier
104 } // namespace Adaptor
106 } // namespace Internal
110 #endif // __DALI_INTERNAL_VSYNC_NOTIFIER_H__