X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fvisual-base-impl.cpp;h=e8ed4a32f950f85a3637813717db1193fd70d75c;hp=9cd41e074869c0c48a41277f5506dc23b68b3a5e;hb=5f03eb8d802b39ab519b15d5bca02f0ed01f2766;hpb=f871dce5373ce3d4f414963a68505eefc0d49cd2 diff --git a/dali-toolkit/internal/visuals/visual-base-impl.cpp b/dali-toolkit/internal/visuals/visual-base-impl.cpp index 9cd41e0..e8ed4a3 100644 --- a/dali-toolkit/internal/visuals/visual-base-impl.cpp +++ b/dali-toolkit/internal/visuals/visual-base-impl.cpp @@ -130,15 +130,18 @@ float Visual::Base::GetDepthIndex() const void Visual::Base::SetOnStage( Actor& actor ) { - // To display the actor correctly, renderer should not be added to actor until all required resources are ready. - // Thus the calling of actor.AddRenderer() should happen inside derived class as base class does not know the exact timing. - DoSetOnStage( actor ); - - if( mImpl->mRenderer ) + if( !IsOnStage() ) { - mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA, IsPreMultipliedAlphaEnabled()); - mImpl->mRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, mImpl->mDepthIndex ); - mImpl->mFlags |= Impl::IS_ON_STAGE; // Only sets the flag if renderer exists + // To display the actor correctly, renderer should not be added to actor until all required resources are ready. + // Thus the calling of actor.AddRenderer() should happen inside derived class as base class does not know the exact timing. + DoSetOnStage( actor ); + + if( mImpl->mRenderer ) + { + mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA, IsPreMultipliedAlphaEnabled()); + mImpl->mRenderer.SetProperty( Renderer::Property::DEPTH_INDEX, mImpl->mDepthIndex ); + mImpl->mFlags |= Impl::IS_ON_STAGE; // Only sets the flag if renderer exists + } } }