[3.0] Version downgrade (1.2.0 to 1.1.45)
[platform/core/uifw/dali-core.git] / dali / internal / update / nodes / node.h
index 3f8bbac..4846122 100644 (file)
@@ -56,7 +56,6 @@ class DiscardQueue;
 class Layer;
 class RenderTask;
 class UpdateManager;
-class GeometryBatcher;
 
 /**
  * Flag whether property has changed, during the Update phase.
@@ -146,7 +145,28 @@ public:
    * Add a renderer to the node
    * @param[in] renderer The renderer added to the node
    */
-  void AddRenderer( Renderer* renderer );
+  void AddRenderer( Renderer* renderer )
+  {
+    //Check that it has not been already added
+    unsigned int rendererCount( mRenderer.Size() );
+    for( unsigned int i(0); i<rendererCount; ++i )
+    {
+      if( mRenderer[i] == renderer )
+      {
+        //Renderer already in the list
+        return;
+      }
+    }
+
+    //If it is the first renderer added, make sure the world transform will be calculated
+    //in the next update as world transform is not computed if node has no renderers
+    if( rendererCount == 0 )
+    {
+      mDirtyFlags |= TransformFlag;
+    }
+
+    mRenderer.PushBack( renderer );
+  }
 
   /**
    * Remove a renderer from the node
@@ -158,7 +178,7 @@ public:
    * Get the renderer at the given index
    * @param[in] index
    */
-  Renderer* GetRendererAt( unsigned int index ) const
+  Renderer* GetRendererAt( unsigned int index )
   {
     return mRenderer[index];
   }
@@ -591,6 +611,7 @@ public:
            (mTransformManager->IsLocalMatrixDirty( mTransformId ));
   }
 
+
   /**
    * Retrieve the cached world-matrix of a node.
    * @param[in] bufferIndex The buffer to read from.
@@ -664,36 +685,6 @@ public:
     return mDepth;
   }
 
-  /**
-   * @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 Tells if the node is a batch parent
-   * @return True if node is a batch parent, false otherwise.
-   */
-  inline bool GetIsBatchParent()
-  {
-    return mIsBatchParent;
-  }
-
-  /**
-   * Set the batch parent of a Node.
-   * @param[in] batchParentNode The new batch parent.
-   */
-  void SetBatchParent( Node* batchParentNode );
-
-  /**
-   * 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.
-   */
-  Node* GetBatchParent() const
-  {
-    return mBatchParent;
-  }
-
 public:
   /**
    * @copydoc UniformMap::Add
@@ -726,9 +717,7 @@ protected:
    * Set the parent of a Node.
    * @param[in] parentNode the new parent.
    */
-  void SetParent( Node& parentNode );
-
-protected:
+  void SetParent(Node& parentNode);
 
   /**
    * Protected constructor; See also Node::New()
@@ -810,16 +799,11 @@ public: // Default properties
   TransformManagerVector3Input    mWorldScale;
   TransformManagerQuaternionInput mWorldOrientation;  ///< Full inherited orientation
   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
-  bool                            mIsBatchParent:1;  ///< Marks node as a batch parent
+  InheritedColor      mWorldColor;        ///< Full inherited color
 
 protected:
 
   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
@@ -943,19 +927,6 @@ inline void RemoveRendererMessage( EventThreadServices& eventThreadServices, con
   // 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 );
 }
-
-inline void SetIsBatchParentMessage( EventThreadServices& eventThreadServices, const Node& node, bool isBatchParent )
-{
-  typedef MessageValue1< Node, bool > LocalType;
-
-  // Reserve some memory inside the message queue
-  unsigned int* 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 );
-}
-
-
 } // namespace SceneGraph
 
 } // namespace Internal