-
- DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorRasterizeThread::StopAnimation: Stop\n" );
- }
-}
-
-void VectorRasterizeThread::PauseAnimation()
-{
- ConditionalWait::ScopedLock lock( mConditionalWait );
- if( mPlayState == PlayState::PLAYING )
- {
- mPlayState = PlayState::PAUSED;
-
- DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorRasterizeThread::PauseAnimation: Pause\n" );
- }
-}
-
-void VectorRasterizeThread::RenderFrame()
-{
- ConditionalWait::ScopedLock lock( mConditionalWait );
-
- if( !mResourceReady )
- {
- mNeedRender = true;
- mConditionalWait.Notify( lock );
-
- DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorRasterizeThread::RenderFrame: Render\n" );
- }
-}
-
-void VectorRasterizeThread::SetResourceReadyCallback( EventThreadCallback* callback )
-{
- ConditionalWait::ScopedLock lock( mConditionalWait );
- mResourceReadyTrigger = std::unique_ptr< EventThreadCallback >( callback );
-}
-
-void VectorRasterizeThread::SetAnimationFinishedCallback( EventThreadCallback* callback )
-{
- ConditionalWait::ScopedLock lock( mConditionalWait );
- mAnimationFinishedTrigger = std::unique_ptr< EventThreadCallback >( callback );
-}
-
-void VectorRasterizeThread::SetLoopCount( int32_t count )
-{
- if( mLoopCount != count )
- {
- ConditionalWait::ScopedLock lock( mConditionalWait );
-
- mLoopCount = count;
-
- DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorRasterizeThread::SetLoopCount: [%d]\n", count );
- }
-}
-
-void VectorRasterizeThread::SetPlayRange( uint32_t startFrame, uint32_t endFrame )
-{
- // Make sure the range specified is between 0 and the total frame number
- if( ( startFrame < mTotalFrame ) && ( endFrame < mTotalFrame ) )
- {
- // If the range is not in order swap values
- if( startFrame > endFrame )
- {
- uint32_t temp = startFrame;
- startFrame = endFrame;
- endFrame = temp;
- }
-
- if( startFrame != mStartFrame || endFrame != mEndFrame )
- {
- ConditionalWait::ScopedLock lock( mConditionalWait );
-
- mStartFrame = startFrame;
- mEndFrame = endFrame;
-
- // If the current frame is out of the range, change the current frame also.
- if( mStartFrame > mCurrentFrame )
- {
- mCurrentFrame = mStartFrame;
-
- mCurrentFrameUpdated = true;
- mResourceReady = false;
- }
- else if( mEndFrame < mCurrentFrame )
- {
- mCurrentFrame = mEndFrame;
-
- mCurrentFrameUpdated = true;
- mResourceReady = false;
- }
-
- DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorRasterizeThread::SetPlayRangeInFrame: [%d, %d]\n", mStartFrame, mEndFrame );
- }
- }
-}
-
-DevelImageVisual::PlayState::Type VectorRasterizeThread::GetPlayState() const
-{
- DevelImageVisual::PlayState::Type state = DevelImageVisual::PlayState::STOPPED;
-
- switch( mPlayState )
- {
- case PlayState::PLAYING:
- {
- state = DevelImageVisual::PlayState::PLAYING;
- break;
- }
- case PlayState::PAUSED:
- {
- state = DevelImageVisual::PlayState::PAUSED;
- break;
- }
- case PlayState::STOPPING:
- case PlayState::STOPPED:
- {
- state = DevelImageVisual::PlayState::STOPPED;
- break;
- }