X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fupdate%2Fnodes%2Fnode.h;h=56005234e53fa8a07fcb6eefc16c368ec5c37607;hb=b43741a90b40ca9dfbd33d6a9d390d3c09230e89;hp=fab6e7e1713b312a79b1624bc491d24aad2a8f54;hpb=a758da80cb775422c1467869dbb3adddc98d2d2e;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/update/nodes/node.h b/dali/internal/update/nodes/node.h old mode 100644 new mode 100755 index fab6e7e..5600523 --- a/dali/internal/update/nodes/node.h +++ b/dali/internal/update/nodes/node.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_SCENE_GRAPH_NODE_H /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ // INTERNAL INCLUDES #include #include -#include #include #include #include @@ -31,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -47,7 +45,6 @@ namespace Internal // Value types used by messages. template <> struct ParameterType< ColorMode > : public BasicType< ColorMode > {}; -template <> struct ParameterType< PositionInheritanceMode > : public BasicType< PositionInheritanceMode > {}; template <> struct ParameterType< ClippingMode::Type > : public BasicType< ClippingMode::Type > {}; namespace SceneGraph @@ -57,32 +54,10 @@ class DiscardQueue; class Layer; class RenderTask; class UpdateManager; -class GeometryBatcher; -/** - * Flag whether property has changed, during the Update phase. - */ -enum NodePropertyFlags -{ - NothingFlag = 0x000, - TransformFlag = 0x001, - VisibleFlag = 0x002, - ColorFlag = 0x004, - SizeFlag = 0x008, - OverlayFlag = 0x010, - SortModifierFlag = 0x020, - ChildDeletedFlag = 0x040, -}; - -static const int AllFlags = ( ChildDeletedFlag << 1 ) - 1; // all the flags - -/** - * Size is not inherited. VisibleFlag is inherited - */ -static const int InheritedDirtyFlags = TransformFlag | VisibleFlag | ColorFlag | OverlayFlag; // Flags which require the scene renderable lists to be updated -static const int RenderableUpdateFlags = TransformFlag | SortModifierFlag | ChildDeletedFlag; +static NodePropertyFlags RenderableUpdateFlags = NodePropertyFlags::TRANSFORM | NodePropertyFlags::CHILD_DELETED; /** * Node is the base class for all nodes in the Scene Graph. @@ -97,7 +72,6 @@ class Node : public PropertyOwner, public NodeDataProvider public: // Defaults - static const PositionInheritanceMode DEFAULT_POSITION_INHERITANCE_MODE; static const ColorMode DEFAULT_COLOR_MODE; // Creation methods @@ -108,20 +82,19 @@ public: static Node* New(); /** - * Virtual destructor + * Deletes a Node. */ - virtual ~Node(); + static void Delete( Node* node ); /** - * Overriden delete operator - * Deletes the node from its global memory pool + * Called during UpdateManager::DestroyNode shortly before Node is destroyed. */ - void operator delete( void* ptr ); + void OnDestroy(); /** - * Called during UpdateManager::DestroyNode shortly before Node is destroyed. + * @return the unique ID of the node */ - void OnDestroy(); + uint32_t GetId() const; // Layer interface @@ -131,7 +104,7 @@ public: */ bool IsLayer() { - return (GetLayer() != NULL); + return mIsLayer; } /** @@ -148,13 +121,14 @@ public: * A value is calculated that can be used during sorting to increase sort speed. * @param[in] clippingId The Clipping ID of the node to set * @param[in] clippingDepth The Clipping Depth of the node to set + * @param[in] scissorDepth The Scissor Clipping Depth of the node to set */ - void SetClippingInformation( const uint32_t clippingId, const uint32_t clippingDepth ) + void SetClippingInformation( const uint32_t clippingId, const uint32_t clippingDepth, const uint32_t scissorDepth ) { - // We only set up the sort value if we have a clipping depth, IE. At least 1 clipping node has been hit. + // We only set up the sort value if we have a stencil clipping depth, IE. At least 1 clipping node has been hit. // If not, if we traverse down a clipping tree and back up, and there is another // node on the parent, this will have a non-zero clipping ID that must be ignored - if( DALI_LIKELY( clippingDepth > 0u ) ) + if( clippingDepth > 0u ) { mClippingDepth = clippingDepth; @@ -169,6 +143,10 @@ public: // If we do not have a clipping depth, then set this to 0 so we do not have a Clipping ID either. mClippingSortModifier = 0u; } + + // The scissor depth does not modify the clipping sort modifier (as scissor clips are 2D only). + // For this reason we can always update the member variable. + mScissorDepth = scissorDepth; } /** @@ -190,11 +168,21 @@ public: } /** + * Gets the Scissor Clipping Depth for this node. + * @return The Scissor Clipping Depth for this node. + */ + uint32_t GetScissorDepth() const + { + return mScissorDepth; + } + + /** * Sets the clipping mode for this node. * @param[in] clippingMode The ClippingMode to set */ void SetClippingMode( const ClippingMode::Type clippingMode ) { + SetPropertyDirty( true ); mClippingMode = clippingMode; } @@ -217,13 +205,13 @@ public: * Remove a renderer from the node * @param[in] renderer The renderer to be removed */ - void RemoveRenderer( Renderer* renderer ); + void RemoveRenderer( const Renderer* renderer ); /* * Get the renderer at the given index * @param[in] index */ - Renderer* GetRendererAt( unsigned int index ) const + Renderer* GetRendererAt( uint32_t index ) const { return mRenderer[index]; } @@ -231,9 +219,9 @@ public: /** * Retrieve the number of renderers for the node */ - unsigned int GetRendererCount() + uint32_t GetRendererCount() const { - return mRenderer.Size(); + return static_cast( mRenderer.Size() ); } // Containment methods @@ -275,6 +263,14 @@ public: } /** + * @return true if the node is connected to SceneGraph + */ + bool ConnectedToScene() + { + return IsRoot() || GetParent(); + } + + /** * Connect a node to the scene-graph. * @pre A node cannot be added to itself. * @pre The parent node is connected to the scene-graph. @@ -316,8 +312,9 @@ public: * Flag that one of the node values has changed in the current frame. * @param[in] flag The flag to set. */ - void SetDirtyFlag(NodePropertyFlags flag) + void SetDirtyFlag( NodePropertyFlags flag ) { + SetPropertyDirty( true ); mDirtyFlags |= flag; } @@ -326,23 +323,23 @@ public: */ void SetAllDirtyFlags() { - mDirtyFlags = AllFlags; + SetPropertyDirty( true ); + mDirtyFlags = NodePropertyFlags::ALL; } /** * Query whether a node is dirty. * @return The dirty flags */ - int GetDirtyFlags() const; + NodePropertyFlags GetDirtyFlags() const; /** - * Query whether a node is clean. - * @return True if the node is clean. + * Query inherited dirty flags. + * + * @param The parentFlags to or with + * @return The inherited dirty flags */ - bool IsClean() const - { - return ( NothingFlag == GetDirtyFlags() ); - } + NodePropertyFlags GetInheritedDirtyFlags( NodePropertyFlags parentFlags ) const; /** * Retrieve the parent-origin of the node. @@ -588,11 +585,11 @@ public: * or inherits its parent color. * @param[in] colorMode The new color mode. */ - void SetColorMode(ColorMode colorMode) + void SetColorMode( ColorMode colorMode ) { mColorMode = colorMode; - SetDirtyFlag(ColorFlag); + SetDirtyFlag( NodePropertyFlags::COLOR ); } /** @@ -690,6 +687,7 @@ public: */ void SetDrawMode( const DrawMode::Type& drawMode ) { + SetPropertyDirty( true ); mDrawMode = drawMode; } @@ -721,52 +719,98 @@ public: } /** - * @brief Turns on or off being a batch parent for the node - * @param[in] enabled If true the node becomes a parent for batch of its children - */ - void SetIsBatchParent( bool enabled ); - - /** * @brief Sets the sibling order of the node * @param[in] order The new order */ - void SetDepthIndex( unsigned int depthIndex ){ mDepthIndex = depthIndex; } + void SetDepthIndex( uint32_t depthIndex ) + { + SetPropertyDirty( true ); + mDepthIndex = depthIndex; + } /** * @brief Get the depth index of the node * @return Current depth index */ - unsigned int GetDepthIndex(){ return mDepthIndex; } + uint32_t GetDepthIndex() const + { + return mDepthIndex; + } /** - * @brief Tells if the node is a batch parent - * @return True if node is a batch parent, false otherwise. + * @brief Sets the boolean which states whether the position should use the anchor-point. + * @param[in] positionUsesAnchorPoint True if the position should use the anchor-point */ - inline bool GetIsBatchParent() + void SetPositionUsesAnchorPoint( bool positionUsesAnchorPoint ) { - return mIsBatchParent; + if( mTransformId != INVALID_TRANSFORM_ID && mPositionUsesAnchorPoint != positionUsesAnchorPoint ) + { + mPositionUsesAnchorPoint = positionUsesAnchorPoint; + mTransformManager->SetPositionUsesAnchorPoint( mTransformId, mPositionUsesAnchorPoint ); + } } /** - * Set the batch parent of a Node. - * @param[in] batchParentNode The new batch parent. + * @brief Sets whether the node is culled or not. + * @param[in] bufferIndex The buffer to read from. + * @param[in] culled True if the node is culled. */ - void SetBatchParent( Node* batchParentNode ); + void SetCulled( BufferIndex bufferIndex, bool culled ) + { + mCulled[bufferIndex] = culled; + } /** - * Retrieve the batch parent of a Node. - * @return The batch parent node, or NULL if the Node has not been added to the scene-graph. + * @brief Retrieves whether the node is culled or not. + * @param[in] bufferIndex The buffer to read from. + * @return True if the node is culled. */ - Node* GetBatchParent() const + bool IsCulled( BufferIndex bufferIndex ) const { - return mBatchParent; + return mCulled[bufferIndex]; } + /** + * @Is component changed + * @Return true if component is changed else false + */ + bool IsComponentChanged() + { + return (mTransformId != INVALID_TRANSFORM_ID) && + (mTransformManager->IsComponentChanged( mTransformId )); + } + + /** + * Retrieve the update size hint of the node + * @return A vector3 describing the update size hint + */ + const Vector3& GetUpdateSizeHint( BufferIndex bufferIndex ) const + { + if( mTransformId != INVALID_TRANSFORM_ID ) + { + return mTransformManager->GetUpdateSizeHint( mTransformId ); + } + + return Vector3::ZERO; + } + + /** + * Set whether partial update needs to run following a render. + * @param[in] value Set to true if an partial update is required to be run + */ + virtual void SetPropertyDirty( bool value ); + + /** + * Query the property status following rendering of a frame. + * @return True if the property has changed + */ + virtual bool IsPropertyDirty() const; + public: /** * @copydoc UniformMap::Add */ - void AddUniformMapping( UniformPropertyMapping* map ); + void AddUniformMapping( OwnerPointer< UniformPropertyMapping >& map ); /** * @copydoc UniformMap::Remove @@ -788,6 +832,11 @@ public: */ void CreateTransform( SceneGraph::TransformManager* transformManager ); + /** + * Reset dirty flags + */ + void ResetDirtyFlags( BufferIndex updateBufferIndex ); + protected: /** @@ -803,22 +852,28 @@ protected: */ Node(); + /** + * Protected virtual destructor; See also Node::Delete( Node* ) + * Kept protected to allow destructor chaining from layer + */ + virtual ~Node(); + private: // from NodeDataProvider /** * @copydoc NodeDataProvider::GetModelMatrix */ - virtual const Matrix& GetModelMatrix( unsigned int bufferId ) const + virtual const Matrix& GetModelMatrix( BufferIndex bufferIndex ) const { - return GetWorldMatrix( bufferId ); + return GetWorldMatrix( bufferIndex ); } /** * @copydoc NodeDataProvider::GetRenderColor */ - virtual const Vector4& GetRenderColor( unsigned int bufferId ) const + virtual const Vector4& GetRenderColor( BufferIndex bufferIndex ) const { - return GetWorldColor( bufferId ); + return GetWorldColor( bufferIndex ); } public: // From UniformMapDataProvider @@ -847,11 +902,6 @@ private: Node& operator=(const Node& rhs); /** - * @copydoc Dali::Internal::SceneGraph::PropertyOwner::ResetDefaultProperties() - */ - virtual void ResetDefaultProperties( BufferIndex updateBufferIndex ); - - /** * Recursive helper to disconnect a Node and its children. * Disconnected Nodes have no parent or children. * @param[in] updateBufferIndex The current update buffer index. @@ -862,14 +912,16 @@ public: // Default properties TransformManager* mTransformManager; TransformId mTransformId; - TransformManagerPropertyVector3 mParentOrigin; ///< Local transform; the position is relative to this. Sets the TransformFlag dirty when changed - TransformManagerPropertyVector3 mAnchorPoint; ///< Local transform; local center of rotation. Sets the TransformFlag dirty when changed + TransformManagerPropertyVector3 mParentOrigin; ///< Local transform; the position is relative to this. Sets the Transform flag dirty when changed + TransformManagerPropertyVector3 mAnchorPoint; ///< Local transform; local center of rotation. Sets the Transform flag dirty when changed TransformManagerPropertyVector3 mSize; ///< Size is provided for layouting TransformManagerPropertyVector3 mPosition; ///< Local transform; distance between parent-origin & anchor-point TransformManagerPropertyQuaternion mOrientation; ///< Local transform; rotation relative to parent node TransformManagerPropertyVector3 mScale; ///< Local transform; scale relative to parent node + TransformManagerPropertyVector3 mUpdateSizeHint; ///< Local transform; update size hint is provided for partial update AnimatableProperty mVisible; ///< Visibility can be inherited from the Node hierachy + AnimatableProperty mCulled; ///< True if the node is culled. This is not animatable. It is just double-buffered. AnimatableProperty mColor; ///< Color can be inherited from the Node hierarchy // Inherited properties; read-only from public API @@ -880,16 +932,14 @@ public: // Default properties TransformManagerMatrixInput mWorldMatrix; ///< Full inherited world matrix InheritedColor mWorldColor; ///< Full inherited color - GeometryBatcher* mGeometryBatcher; ///< A pointer to an instance of geometry batcher - uint32_t mBatchIndex; ///< Batch 32bit handle, BATCH_NULL_HANDLE by default uint32_t mClippingSortModifier; ///< Contains bit-packed clipping information for quick access when sorting - - bool mIsBatchParent:1; ///< Marks node as a batch parent + const uint32_t mId; ///< The Unique ID of the node. protected: + static uint32_t mNodeCounter; ///< count of total nodes, used for unique ids + Node* mParent; ///< Pointer to parent node (a child is owned by its parent) - Node* mBatchParent; ///< Pointer to batch parent node RenderTask* mExclusiveRenderTask; ///< Nodes can be marked as exclusive to a single RenderTask RendererContainer mRenderer; ///< Container of renderers; not owned @@ -897,18 +947,21 @@ protected: NodeContainer mChildren; ///< Container of children; not owned CollectedUniformMap mCollectedUniformMap[2]; ///< Uniform maps of the node - unsigned int mUniformMapChanged[2]; ///< Records if the uniform map has been altered this frame - uint32_t mClippingDepth; ///< The number of clipping nodes deep this node is + uint32_t mUniformMapChanged[2]; ///< Records if the uniform map has been altered this frame + uint32_t mClippingDepth; ///< The number of stencil clipping nodes deep this node is + uint32_t mScissorDepth; ///< The number of scissor clipping nodes deep this node is uint32_t mDepthIndex; ///< Depth index of the node // flags, compressed to bitfield - unsigned int mRegenerateUniformMap:2; ///< Indicate if the uniform map has to be regenerated this frame - int mDirtyFlags:8; ///< A composite set of flags for each of the Node properties - DrawMode::Type mDrawMode:2; ///< How the Node and its children should be drawn - ColorMode mColorMode:2; ///< Determines whether mWorldColor is inherited, 2 bits is enough - ClippingMode::Type mClippingMode:2; ///< The clipping mode of this node + NodePropertyFlags mDirtyFlags; ///< Dirty flags for each of the Node properties + uint32_t mRegenerateUniformMap:2; ///< Indicate if the uniform map has to be regenerated this frame + DrawMode::Type mDrawMode:3; ///< How the Node and its children should be drawn + ColorMode mColorMode:3; ///< Determines whether mWorldColor is inherited, 2 bits is enough + ClippingMode::Type mClippingMode:3; ///< The clipping mode of this node bool mIsRoot:1; ///< True if the node cannot have a parent + bool mIsLayer:1; ///< True if the node is a layer + bool mPositionUsesAnchorPoint:1; ///< True if the node should use the anchor-point when calculating the position // Changes scope, should be at end of class DALI_LOG_OBJECT_STRING_DECLARATION; @@ -921,7 +974,7 @@ inline void SetInheritOrientationMessage( EventThreadServices& eventThreadServic typedef MessageValue1< Node, bool > LocalType; // Reserve some memory inside the message queue - unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) ); + uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) ); // Construct message in the message queue memory; note that delete should not be called on the return value new (slot) LocalType( &node, &Node::SetInheritOrientation, inherit ); @@ -932,7 +985,7 @@ inline void SetParentOriginMessage( EventThreadServices& eventThreadServices, co typedef MessageValue1< Node, Vector3 > LocalType; // Reserve some memory inside the message queue - unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) ); + uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) ); // Construct message in the message queue memory; note that delete should not be called on the return value new (slot) LocalType( &node, &Node::SetParentOrigin, origin ); @@ -943,7 +996,7 @@ inline void SetAnchorPointMessage( EventThreadServices& eventThreadServices, con typedef MessageValue1< Node, Vector3 > LocalType; // Reserve some memory inside the message queue - unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) ); + uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) ); // Construct message in the message queue memory; note that delete should not be called on the return value new (slot) LocalType( &node, &Node::SetAnchorPoint, anchor ); @@ -954,7 +1007,7 @@ inline void SetInheritPositionMessage( EventThreadServices& eventThreadServices, typedef MessageValue1< Node, bool > LocalType; // Reserve some memory inside the message queue - unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) ); + uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) ); // Construct message in the message queue memory; note that delete should not be called on the return value new (slot) LocalType( &node, &Node::SetInheritPosition, inherit ); @@ -965,7 +1018,7 @@ inline void SetInheritScaleMessage( EventThreadServices& eventThreadServices, co typedef MessageValue1< Node, bool > LocalType; // Reserve some memory inside the message queue - unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) ); + uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) ); // Construct message in the message queue memory; note that delete should not be called on the return value new (slot) LocalType( &node, &Node::SetInheritScale, inherit ); @@ -976,7 +1029,7 @@ inline void SetColorModeMessage( EventThreadServices& eventThreadServices, const typedef MessageValue1< Node, ColorMode > LocalType; // Reserve some memory inside the message queue - unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) ); + uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) ); // Construct message in the message queue memory; note that delete should not be called on the return value new (slot) LocalType( &node, &Node::SetColorMode, colorMode ); @@ -987,72 +1040,87 @@ inline void SetDrawModeMessage( EventThreadServices& eventThreadServices, const typedef MessageValue1< Node, DrawMode::Type > LocalType; // Reserve some memory inside the message queue - unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) ); + uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) ); // Construct message in the message queue memory; note that delete should not be called on the return value new (slot) LocalType( &node, &Node::SetDrawMode, drawMode ); } -inline void AddRendererMessage( EventThreadServices& eventThreadServices, const Node& node, Renderer* renderer ) +inline void AttachRendererMessage( EventThreadServices& eventThreadServices, const Node& node, const Renderer& renderer ) { typedef MessageValue1< Node, Renderer* > LocalType; // Reserve some memory inside the message queue - unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) ); + uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) ); // Construct message in the message queue memory; note that delete should not be called on the return value - new (slot) LocalType( &node, &Node::AddRenderer, renderer ); + new (slot) LocalType( &node, &Node::AddRenderer, const_cast( &renderer ) ); } -inline void RemoveRendererMessage( EventThreadServices& eventThreadServices, const Node& node, Renderer* renderer ) +inline void DetachRendererMessage( EventThreadServices& eventThreadServices, const Node& node, const Renderer& renderer ) { - typedef MessageValue1< Node, Renderer* > LocalType; + typedef MessageValue1< Node, const Renderer* > LocalType; // Reserve some memory inside the message queue - unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) ); + uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) ); // Construct message in the message queue memory; note that delete should not be called on the return value - new (slot) LocalType( &node, &Node::RemoveRenderer, renderer ); + new (slot) LocalType( &node, &Node::RemoveRenderer, &renderer ); } -inline void SetIsBatchParentMessage( EventThreadServices& eventThreadServices, const Node& node, bool isBatchParent ) +inline void SetDepthIndexMessage( EventThreadServices& eventThreadServices, const Node& node, uint32_t depthIndex ) { - typedef MessageValue1< Node, bool > LocalType; + typedef MessageValue1< Node, uint32_t > LocalType; // Reserve some memory inside the message queue - unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) ); + uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) ); // Construct message in the message queue memory; note that delete should not be called on the return value - new (slot) LocalType( &node, &Node::SetIsBatchParent, isBatchParent ); + new (slot) LocalType( &node, &Node::SetDepthIndex, depthIndex ); } -inline void SetDepthIndexMessage( EventThreadServices& eventThreadServices, const Node& node, unsigned int depthIndex ) +inline void SetClippingModeMessage( EventThreadServices& eventThreadServices, const Node& node, ClippingMode::Type clippingMode ) { - typedef MessageValue1< Node, unsigned int > LocalType; + typedef MessageValue1< Node, ClippingMode::Type > LocalType; // Reserve some memory inside the message queue - unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) ); + uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) ); // Construct message in the message queue memory; note that delete should not be called on the return value - new (slot) LocalType( &node, &Node::SetDepthIndex, depthIndex ); + new (slot) LocalType( &node, &Node::SetClippingMode, clippingMode ); } -inline void SetClippingModeMessage( EventThreadServices& eventThreadServices, const Node& node, ClippingMode::Type clippingMode ) +inline void SetPositionUsesAnchorPointMessage( EventThreadServices& eventThreadServices, const Node& node, bool positionUsesAnchorPoint ) { - typedef MessageValue1< Node, ClippingMode::Type > LocalType; + typedef MessageValue1< Node, bool > LocalType; // Reserve some memory inside the message queue - unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) ); + uint32_t* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) ); // Construct message in the message queue memory; note that delete should not be called on the return value - new (slot) LocalType( &node, &Node::SetClippingMode, clippingMode ); + new (slot) LocalType( &node, &Node::SetPositionUsesAnchorPoint, positionUsesAnchorPoint ); } - } // namespace SceneGraph +// Template specialisation for OwnerPointer, because delete is protected +template <> +inline void OwnerPointer::Reset() +{ + if (mObject != NULL) + { + Dali::Internal::SceneGraph::Node::Delete(mObject); + mObject = NULL; + } +} } // namespace Internal +// Template specialisations for OwnerContainer, because delete is protected +template <> +inline void OwnerContainer::Delete( Dali::Internal::SceneGraph::Node* pointer ) +{ + Dali::Internal::SceneGraph::Node::Delete(pointer); +} } // namespace Dali #endif // DALI_INTERNAL_SCENE_GRAPH_NODE_H