bool VectorAnimationTask::Rasterize()
{
bool stopped = false;
- uint32_t currentFrame, droppedFrames = 0;
+ uint32_t currentFrame;
{
ConditionalWait::ScopedLock lock(mConditionalWait);
// The task will be destroyed. We don't need rasterization.
return false;
}
- droppedFrames = mDroppedFrames;
}
ApplyAnimationData();
if(mPlayState == PlayState::PLAYING && mUpdateFrameNumber)
{
- mCurrentFrame = mForward ? mCurrentFrame + droppedFrames + 1 : mCurrentFrame - droppedFrames - 1;
+ mCurrentFrame = mForward ? mCurrentFrame + mDroppedFrames + 1 : mCurrentFrame - mDroppedFrames - 1;
Dali::ClampInPlace(mCurrentFrame, mStartFrame, mEndFrame);
}
VectorAnimationTask::TimePoint VectorAnimationTask::CalculateNextFrameTime(bool renderNow)
{
- uint32_t droppedFrames = 0;
-
// std::chrono::time_point template has second parameter duration which defaults to the std::chrono::system_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.
if(renderNow)
{
mNextFrameStartTime = current;
+ mDroppedFrames = 0;
}
else if(mNextFrameStartTime < current)
{
+ uint32_t droppedFrames = 0;
+
while(current > std::chrono::time_point_cast<TimePoint::duration>(mNextFrameStartTime + std::chrono::microseconds(mFrameDurationMicroSeconds)))
{
droppedFrames++;
mNextFrameStartTime = std::chrono::time_point_cast<TimePoint::duration>(mNextFrameStartTime + std::chrono::microseconds(mFrameDurationMicroSeconds));
}
- {
- ConditionalWait::ScopedLock lock(mConditionalWait);
- mDroppedFrames = droppedFrames;
- }
-
mNextFrameStartTime = current;
+ mDroppedFrames = droppedFrames;
}
return mNextFrameStartTime;