void AnimatedVectorImageVisual::DoSetOffScene(Actor& actor)
{
StopAnimation();
- SendAnimationData();
+ TriggerVectorRasterization();
if(mImpl->mRenderer)
{
mAnimationData.resendFlag |= VectorAnimationTask::RESEND_PLAY_STATE;
}
- SendAnimationData();
+ TriggerVectorRasterization();
}
}
TriggerVectorRasterization();
}
-void AnimatedVectorImageVisual::OnResourceReady(bool success)
+void AnimatedVectorImageVisual::OnResourceReady(VectorAnimationTask::ResourceStatus status)
{
- mLoadFailed = !success;
-
- // If weak handle is holding a placement actor, it is the time to add the renderer to actor.
- Actor actor = mPlacementActor.GetHandle();
- if(actor && !mRendererAdded)
+ if(status == VectorAnimationTask::ResourceStatus::LOADED)
{
- if(success)
- {
- actor.AddRenderer(mImpl->mRenderer);
- ResourceReady(Toolkit::Visual::ResourceStatus::READY);
- }
- else
+ if(mImpl->mEventObserver)
{
- Vector2 imageSize = actor.GetProperty(Actor::Property::SIZE).Get<Vector2>();
- mFactoryCache.UpdateBrokenImageRenderer(mImpl->mRenderer, imageSize);
- actor.AddRenderer(mImpl->mRenderer);
- ResourceReady(Toolkit::Visual::ResourceStatus::FAILED);
+ mImpl->mEventObserver->RelayoutRequest(*this);
}
+ }
+ else
+ {
+ mLoadFailed = status == VectorAnimationTask::ResourceStatus::FAILED ? true : false;
- mRendererAdded = true;
+ // If weak handle is holding a placement actor, it is the time to add the renderer to actor.
+ Actor actor = mPlacementActor.GetHandle();
+ if(actor && !mRendererAdded)
+ {
+ if(!mLoadFailed)
+ {
+ actor.AddRenderer(mImpl->mRenderer);
+ ResourceReady(Toolkit::Visual::ResourceStatus::READY);
+ }
+ else
+ {
+ Vector2 imageSize = actor.GetProperty(Actor::Property::SIZE).Get<Vector2>();
+ mFactoryCache.UpdateBrokenImageRenderer(mImpl->mRenderer, imageSize);
+ actor.AddRenderer(mImpl->mRenderer);
+ ResourceReady(Toolkit::Visual::ResourceStatus::FAILED);
+ }
- DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "Renderer is added (success = %d) [%p]\n", success, this);
+ mRendererAdded = true;
+ }
}
+
+ DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "Renderer is added (status = %d) [%p]\n", status, this);
}
void AnimatedVectorImageVisual::OnAnimationFinished()