bool Actor::RelayoutRequired( Dimension::Type dimension ) const
{
- EnsureRelayoutData();
-
- return mRelayoutData->relayoutEnabled && IsLayoutDirty( dimension );
+ return mRelayoutData && mRelayoutData->relayoutEnabled && IsLayoutDirty( dimension );
}
+ unsigned int Actor::AddRenderer( Renderer& renderer )
+ {
+ //TODO: MESH_REWORK : Add support for multiple renderers
+ if ( ! mAttachment )
+ {
+ mAttachment = RendererAttachment::New( GetEventThreadServices(), *mNode, renderer );
+ }
+
+ return 0;
+ }
+
+ unsigned int Actor::GetRendererCount() const
+ {
+ //TODO: MESH_REWORK : Add support for multiple renderers
+ RendererAttachment* attachment = dynamic_cast<RendererAttachment*>(mAttachment.Get());
+ return attachment ? 1u : 0u;
+ }
+
+ Renderer& Actor::GetRendererAt( unsigned int index )
+ {
+ //TODO: MESH_REWORK : Add support for multiple renderers
+ DALI_ASSERT_DEBUG( index == 0 && "Only one renderer is supported." );
+
+ //TODO: MESH_REWORK : Temporary code
+ RendererAttachment* attachment = dynamic_cast<RendererAttachment*>(mAttachment.Get());
+ DALI_ASSERT_ALWAYS( attachment && "Actor doesn't have a renderer" );
+
+ return attachment->GetRenderer();
+ }
+
+ void Actor::RemoveRenderer( Renderer& renderer )
+ {
+ //TODO: MESH_REWORK : Add support for multiple renderers
+ mAttachment = NULL;
+ }
+
+ void Actor::RemoveRenderer( unsigned int index )
+ {
+ //TODO: MESH_REWORK : Add support for multiple renderers
+ mAttachment = NULL;
+ }
+
+
#ifdef DALI_DYNAMICS_SUPPORT
//--------------- Dynamics ---------------