X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fcontrol%2Fcontrol-data-impl.cpp;h=1630b923efcbe0a9b047827b8b80484992c39efc;hp=6ff1efbd234d86b6c46bf1db4be83ec4f89a0ce4;hb=ed40c470e7713deb2a976212b49c771514b99302;hpb=ccd5e67cfebebde79b1c06d8f35ed736ec1de921 diff --git a/dali-toolkit/internal/controls/control/control-data-impl.cpp b/dali-toolkit/internal/controls/control/control-data-impl.cpp index 6ff1efb..1630b92 100644 --- a/dali-toolkit/internal/controls/control/control-data-impl.cpp +++ b/dali-toolkit/internal/controls/control/control-data-impl.cpp @@ -525,12 +525,17 @@ void Control::Impl::RegisterVisual( Property::Index index, Toolkit::Visual::Base ( visualReplaced && enabled ) ) ; mVisuals.PushBack( newRegisteredVisual ); + Internal::Visual::Base& visualImpl = Toolkit::GetImplementation( visual ); // Put on stage if enabled and the control is already on the stage - // Visual must be set on stage for the renderer to be created and the ResourceReady triggered. if( ( enabled == VisualState::ENABLED ) && self.OnStage() ) { - Toolkit::GetImplementation(visual).SetOnStage( self ); + visualImpl.SetOnStage( self ); } + else if( visualImpl.IsResourceReady() ) // When not being staged, check if visual already 'ResourceReady' before it was Registered. ( Resource may have been loaded already ) + { + ResourceReady( visualImpl ); + } + } DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::RegisterVisual() Registered %s(%d), enabled:%s\n", visual.GetName().c_str(), index, enabled?"true":"false" ); @@ -657,8 +662,11 @@ void Control::Impl::ResourceReady( Visual::Base& object) } } - // A visual is ready so control may need relayouting - mControlImpl.RelayoutRequest(); + // A visual is ready so control may need relayouting if staged + if ( self.OnStage() ) + { + mControlImpl.RelayoutRequest(); + } // Emit signal if all enabled visuals registered by the control are ready. if( IsResourceReady() )