+ mActionStatus = DevelAnimatedVectorImageVisual::Action::STOP;
+
+ if( mImpl->mEventObserver )
+ {
+ mImpl->mEventObserver->NotifyVisualEvent( *this, DevelAnimatedVectorImageVisual::Signal::ANIMATION_FINISHED );
+ }
+ }
+
+ if( mImpl->mRenderer )
+ {
+ mImpl->mRenderer.SetProperty( DevelRenderer::Property::RENDERING_BEHAVIOR, DevelRenderer::Rendering::IF_REQUIRED );
+ }
+}
+
+void AnimatedVectorImageVisual::SendAnimationData()
+{
+ if( mResendFlag )
+ {
+ bool isPlaying = false;
+ if( mVectorAnimationTask->GetPlayState() == DevelImageVisual::PlayState::PLAYING )
+ {
+ mVectorAnimationTask->PauseAnimation();
+ isPlaying = true;
+ }
+
+ if( mResendFlag & RESEND_LOOP_COUNT )
+ {
+ mVectorAnimationTask->SetLoopCount( mLoopCount );
+ }
+
+ if( mResendFlag & RESEND_PLAY_RANGE )
+ {
+ mVectorAnimationTask->SetPlayRange( mStartFrame, mEndFrame );
+ }
+
+ if( mResendFlag & RESEND_STOP_BEHAVIOR )
+ {
+ mVectorAnimationTask->SetStopBehavior( mStopBehavior );
+ }
+
+ if( mResendFlag & RESEND_LOOPING_MODE )
+ {
+ mVectorAnimationTask->SetLoopingMode( mLoopingMode );
+ }
+
+ if( IsOnStage() )
+ {
+ if( isPlaying )
+ {
+ mVectorAnimationTask->PlayAnimation();
+ }
+ else
+ {
+ mVectorAnimationTask->RenderFrame();
+ Stage::GetCurrent().KeepRendering( 0.0f );
+ }
+ }
+
+ mResendFlag = 0;
+ }
+}
+
+void AnimatedVectorImageVisual::SetVectorImageSize()
+{
+ uint32_t width = static_cast< uint32_t >( mVisualSize.width * mVisualScale.width );
+ uint32_t height = static_cast< uint32_t >( mVisualSize.height * mVisualScale.height );
+
+ mVectorAnimationTask->SetSize( width, height );
+
+ if( IsOnStage() && mVectorAnimationTask->GetPlayState() != DevelImageVisual::PlayState::PLAYING )
+ {
+ mVectorAnimationTask->RenderFrame();
+ Stage::GetCurrent().KeepRendering( 0.0f ); // Trigger rendering
+ }
+}
+
+void AnimatedVectorImageVisual::PauseAnimation()
+{
+ if( mActionStatus == DevelAnimatedVectorImageVisual::Action::PLAY )
+ {
+ mVectorAnimationTask->PauseAnimation();
+
+ mActionStatus = DevelAnimatedVectorImageVisual::Action::PAUSE;
+
+ if( mImpl->mRenderer )
+ {
+ mImpl->mRenderer.SetProperty( DevelRenderer::Property::RENDERING_BEHAVIOR, DevelRenderer::Rendering::IF_REQUIRED );
+ }
+ }
+}
+
+void AnimatedVectorImageVisual::OnScaleNotification( PropertyNotification& source )
+{
+ Actor actor = mPlacementActor.GetHandle();
+ if( actor )
+ {
+ Vector3 scale = actor.GetProperty< Vector3 >( Actor::Property::WORLD_SCALE );
+ mVisualScale.width = scale.width;
+ mVisualScale.height = scale.height;
+
+ DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::OnScaleNotification: scale = %f, %f [%p]\n", mVisualScale.width, mVisualScale.height, this );
+
+ SetVectorImageSize();
+ }
+}
+
+void AnimatedVectorImageVisual::OnSizeNotification( PropertyNotification& source )
+{
+ Actor actor = mPlacementActor.GetHandle();
+ if( actor )
+ {
+ Vector3 size = actor.GetCurrentSize();
+ mVisualSize.width = size.width;
+ mVisualSize.height = size.height;
+
+ DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::OnSizeNotification: size = %f, %f [%p]\n", mVisualSize.width, mVisualSize.height, this );
+
+ SetVectorImageSize();
+ }
+}
+
+void AnimatedVectorImageVisual::OnControlVisibilityChanged( Actor actor, bool visible, DevelActor::VisibilityChange::Type type )
+{
+ if( !visible )
+ {
+ PauseAnimation();
+
+ DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::OnControlVisibilityChanged: invisibile. Pause animation [%p]\n", this );
+ }
+}
+
+void AnimatedVectorImageVisual::OnWindowVisibilityChanged( Window window, bool visible )
+{
+ if( !visible )
+ {
+ PauseAnimation();
+
+ DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::OnWindowVisibilityChanged: invisibile. Pause animation [%p]\n", this );