{
AddRasterizationTask( mImpl->mSize );
}
+
+ // Hold the weak handle of the placement actor and delay the adding of renderer until the svg rasterization is finished.
+ mPlacementActor = actor;
}
void SvgVisual::DoSetOffStage( Actor& actor )
actor.RemoveRenderer( mImpl->mRenderer );
mImpl->mRenderer.Reset();
+ mPlacementActor.Reset();
}
void SvgVisual::GetNaturalSize( Vector2& naturalSize ) const
TextureSetImage( textureSet, 0u, texture );
}
}
+
+ // Rasterized pixels are uploaded to texture. If weak handle is holding a placement actor, it is the time to add the renderer to actor.
+ Actor actor = mPlacementActor.GetHandle();
+ if( actor )
+ {
+ actor.AddRenderer( mImpl->mRenderer );
+ // reset the weak handle so that the renderer only get added to actor once
+ mPlacementActor.Reset();
+ }
}
}
-
} // namespace Internal
} // namespace Toolkit