VectorAnimationTask::TimePoint VectorAnimationTask::CalculateNextFrameTime(bool renderNow)
{
- // std::chrono::time_point template has second parameter duration which defaults to the std::chrono::system_clock supported
+ // std::chrono::time_point template has second parameter duration which defaults to the std::chrono::steady_clock supported
// duration. In some C++11 implementations it is a milliseconds duration, so it fails to compile unless mNextFrameStartTime
// is casted to use the default duration.
mNextFrameStartTime = std::chrono::time_point_cast<TimePoint::duration>(mNextFrameStartTime + std::chrono::microseconds(mFrameDurationMicroSeconds));
- auto current = std::chrono::system_clock::now();
+ auto current = std::chrono::steady_clock::now();
if(renderNow)
{
mNextFrameStartTime = current;
public:
using UploadCompletedSignalType = Dali::VectorAnimationRenderer::UploadCompletedSignalType;
- using TimePoint = std::chrono::time_point<std::chrono::system_clock>;
+ using TimePoint = std::chrono::time_point<std::chrono::steady_clock>;
/**
* Flags for re-sending data to the vector animation thread
{
VectorAnimationTaskPtr nextTask = *it;
- auto currentTime = std::chrono::system_clock::now();
+ auto currentTime = std::chrono::steady_clock::now();
auto nextFrameTime = nextTask->GetNextFrameTime();
#if defined(DEBUG_ENABLED)
Join();
}
-void VectorAnimationThread::SleepThread::SleepUntil(std::chrono::time_point<std::chrono::system_clock> timeToSleepUntil)
+void VectorAnimationThread::SleepThread::SleepUntil(std::chrono::time_point<std::chrono::steady_clock> timeToSleepUntil)
{
ConditionalWait::ScopedLock lock(mConditionalWait);
mSleepTimePoint = timeToSleepUntil;
while(!mDestroyThread)
{
bool needToSleep;
- std::chrono::time_point<std::chrono::system_clock> sleepTimePoint;
+ std::chrono::time_point<std::chrono::steady_clock> sleepTimePoint;
{
ConditionalWait::ScopedLock lock(mConditionalWait);
if(needToSleep)
{
#if defined(DEBUG_ENABLED)
- auto sleepDuration = std::chrono::duration_cast<std::chrono::milliseconds>(mSleepTimePoint - std::chrono::system_clock::now());
+ auto sleepDuration = std::chrono::duration_cast<std::chrono::milliseconds>(mSleepTimePoint - std::chrono::steady_clock::now());
DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "VectorAnimationThread::SleepThread::Run: [sleep duration = %lld]\n", sleepDuration.count());
#endif
/**
* @brief Sleeps untile the specified time point.
*/
- void SleepUntil(std::chrono::time_point<std::chrono::system_clock> timeToSleepUntil);
+ void SleepUntil(std::chrono::time_point<std::chrono::steady_clock> timeToSleepUntil);
protected:
/**
private:
ConditionalWait mConditionalWait;
std::unique_ptr<CallbackBase> mAwakeCallback;
- std::chrono::time_point<std::chrono::system_clock> mSleepTimePoint;
+ std::chrono::time_point<std::chrono::steady_clock> mSleepTimePoint;
const Dali::LogFactoryInterface& mLogFactory;
bool mNeedToSleep;
bool mDestroyThread;