+void VectorAnimationTask::ApplyAnimationData()
+{
+ uint32_t index;
+
+ {
+ ConditionalWait::ScopedLock lock( mConditionalWait );
+
+ if( !mAnimationDataUpdated || mAnimationData[mAnimationDataIndex].resendFlag != 0 )
+ {
+ // Data is not updated or the previous data is not applied yet.
+ return;
+ }
+
+ mAnimationDataIndex = mAnimationDataIndex == 0 ? 1 : 0; // Swap index
+ mAnimationDataUpdated = false;
+
+ index = mAnimationDataIndex;
+ }
+
+ if( mAnimationData[index].resendFlag & VectorAnimationTask::RESEND_LOOP_COUNT )
+ {
+ SetLoopCount( mAnimationData[index].loopCount );
+ }
+
+ if( mAnimationData[index].resendFlag & VectorAnimationTask::RESEND_PLAY_RANGE )
+ {
+ SetPlayRange( mAnimationData[index].playRange );
+ }
+
+ if( mAnimationData[index].resendFlag & VectorAnimationTask::RESEND_STOP_BEHAVIOR )
+ {
+ SetStopBehavior( mAnimationData[index].stopBehavior );
+ }
+
+ if( mAnimationData[index].resendFlag & VectorAnimationTask::RESEND_LOOPING_MODE )
+ {
+ SetLoopingMode( mAnimationData[index].loopingMode );
+ }
+
+ if( mAnimationData[index].resendFlag & VectorAnimationTask::RESEND_CURRENT_FRAME )
+ {
+ SetCurrentFrameNumber( mAnimationData[index].currentFrame );
+ }
+
+ if( mAnimationData[index].resendFlag & VectorAnimationTask::RESEND_PLAY_STATE )
+ {
+ if( mAnimationData[index].playState == DevelImageVisual::PlayState::PLAYING )
+ {
+ PlayAnimation();
+ }
+ else if( mAnimationData[index].playState == DevelImageVisual::PlayState::PAUSED )
+ {
+ PauseAnimation();
+ }
+ else if( mAnimationData[index].playState == DevelImageVisual::PlayState::STOPPED )
+ {
+ StopAnimation();
+ }
+ }
+
+ mAnimationData[index].resendFlag = 0;
+}
+