/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
#include <dali/public-api/object/property-array.h>
+#include <dali/public-api/math/math-utils.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/visuals/image-visual-shader-factory.h>
void VectorAnimationTask::Finalize()
{
+ ConditionalWait::ScopedLock lock( mConditionalWait );
+
// Release some objects in the main thread
if( mAnimationFinishedTrigger )
{
}
// Make sure the range specified is between 0 and the total frame number
- if( startFrame >= 0 && startFrame < mTotalFrame && endFrame >= 0 && endFrame < mTotalFrame )
+ if( startFrame < mTotalFrame && endFrame < mTotalFrame )
{
// If the range is not in order swap values
if( startFrame > endFrame )
bool VectorAnimationTask::Rasterize()
{
- bool stopped = false, needAnimationFinishedTrigger;
+ bool stopped = false, needAnimationFinishedTrigger, resourceReady;
uint32_t currentFrame, startFrame, endFrame;
int32_t loopCount, currentLoopCount;
PlayState playState;
if( mPlayState == PlayState::PLAYING && mUpdateFrameNumber )
{
mCurrentFrame = mForward ? mCurrentFrame + 1 : mCurrentFrame - 1;
+ Dali::ClampInPlace( mCurrentFrame, mStartFrame, mEndFrame );
}
currentFrame = mCurrentFrame;
currentLoopCount = mCurrentLoop;
needAnimationFinishedTrigger = mNeedAnimationFinishedTrigger;
playState = mPlayState;
+ resourceReady = mResourceReady;
mResourceReady = true;
mCurrentFrameUpdated = false;
{
DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorAnimationTask::Rasterize: Rendering failed. Try again later.[%d] [%p]\n", currentFrame, this );
mUpdateFrameNumber = false;
+
+ if( !resourceReady )
+ {
+ ConditionalWait::ScopedLock lock( mConditionalWait );
+ mResourceReady = false;
+ }
}
}
if( stopped && renderSuccess )
{
+ ConditionalWait::ScopedLock lock( mConditionalWait );
+
mPlayState = PlayState::STOPPED;
mForward = true;
mCurrentLoop = 0;