AnimatedVectorImageVisual::~AnimatedVectorImageVisual()
{
- // Finalize animation task in the main thread
- mVectorAnimationTask->Finalize();
}
void AnimatedVectorImageVisual::GetNaturalSize( Vector2& naturalSize )
{
actor.AddRenderer( mImpl->mRenderer );
mRendererAdded = true;
+ }
- ResourceReady( Toolkit::Visual::ResourceStatus::READY );
+ ResourceReady( Toolkit::Visual::ResourceStatus::READY );
- DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::OnUploadCompleted: Renderer is added [%p]\n", this );
- }
+ DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::OnUploadCompleted: Renderer is added [%p]\n", this );
}
void AnimatedVectorImageVisual::OnAnimationFinished()
DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorAnimationTask::~VectorAnimationTask: destructor [%p]\n", this );
}
-void VectorAnimationTask::Finalize()
-{
- // Release some objects in the main thread
- if( mAnimationFinishedTrigger )
- {
- mAnimationFinishedTrigger.reset();
- }
-
- mVectorRenderer.Reset();
-}
-
void VectorAnimationTask::SetRenderer( Renderer renderer )
{
ConditionalWait::ScopedLock lock( mConditionalWait );
void VectorAnimationTask::SetAnimationFinishedCallback( EventThreadCallback* callback )
{
ConditionalWait::ScopedLock lock( mConditionalWait );
- if( callback )
- {
- mAnimationFinishedTrigger = std::unique_ptr< EventThreadCallback >( callback );
- }
+ mAnimationFinishedTrigger = std::unique_ptr< EventThreadCallback >( callback );
}
void VectorAnimationTask::SetLoopCount( int32_t count )
mCurrentFrame = frameNumber;
mCurrentFrameUpdated = true;
- mUpdateFrameNumber = false;
mResourceReady = false;
DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorAnimationTask::SetCurrentFrameNumber: frame number = %d [%p]\n", mCurrentFrame, this );
DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorAnimationTask::SetLoopingMode: looping mode = %d [%p]\n", mLoopingMode, this );
}
-void VectorAnimationTask::GetLayerInfo( Property::Map& map )
+void VectorAnimationTask::GetLayerInfo( Property::Map& map ) const
{
mVectorRenderer.GetLayerInfo( map );
}
}
// Rasterize
- bool renderSuccess = false;
- if( mVectorRenderer )
+ bool renderSuccess = mVectorRenderer.Render( currentFrame );
+ if( !renderSuccess )
{
- renderSuccess = mVectorRenderer.Render( currentFrame );
- if( !renderSuccess )
- {
- DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorAnimationTask::Rasterize: Rendering failed. Try again later.[%d] [%p]\n", currentFrame, this );
- mUpdateFrameNumber = false;
- }
+ DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorAnimationTask::Rasterize: Rendering failed. Try again later.[%d] [%p]\n", currentFrame, this );
+ mUpdateFrameNumber = false;
}
if( stopped && renderSuccess )
virtual ~VectorAnimationTask();
/**
- * @brief Finalizes the task.
- */
- void Finalize();
-
- /**
* @brief Sets the renderer used to display the result image.
*
* @param[in] renderer The renderer used to display the result image
* @brief Gets the layer information of all the child layers.
* @param[out] map The layer information
*/
- void GetLayerInfo( Property::Map& map );
+ void GetLayerInfo( Property::Map& map ) const;
/**
* @brief Connect to this signal to be notified when the texture upload is completed.
{
ConditionalWait::ScopedLock lock( mConditionalWait );
- if( mCompletedTasks.end() == std::find( mCompletedTasks.begin(), mCompletedTasks.end(), task ) )
+ if( mAnimationTasks.end() == std::find( mAnimationTasks.begin(), mAnimationTasks.end(), task ) )
{
mCompletedTasks.push_back( task );
mCompletedTasks.clear();
// pop out the next task from the queue
- while( !mAnimationTasks.empty() && !mNeedToSleep )
+ if( !mAnimationTasks.empty() && !mNeedToSleep )
{
std::vector< VectorAnimationTaskPtr >::iterator next = mAnimationTasks.begin();
VectorAnimationTaskPtr nextTask = *next;