[Tizen] Add codes for Dali Windows Backend
[platform/core/uifw/dali-core.git] / dali / internal / update / nodes / scene-graph-layer.h
old mode 100644 (file)
new mode 100755 (executable)
index 89823a8..29ed244
@@ -1,8 +1,8 @@
-#ifndef __DALI_INTERNAL_SCENE_GRAPH_LAYER_H__
-#define __DALI_INTERNAL_SCENE_GRAPH_LAYER_H__
+#ifndef DALI_INTERNAL_SCENE_GRAPH_LAYER_H
+#define DALI_INTERNAL_SCENE_GRAPH_LAYER_H
 
 /*
- * Copyright (c) 2016 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.
@@ -45,13 +45,13 @@ class Camera;
 struct Renderable
 {
   Renderable()
-  :mNode(0),
-   mRenderer(0)
+  : mNode( 0 ),
+    mRenderer( 0 )
   {}
 
   Renderable( Node* node, Renderer* renderer )
-  :mNode(node),
-   mRenderer(renderer)
+  : mNode( node ),
+    mRenderer( renderer )
   {}
 
   Node* mNode;
@@ -77,14 +77,10 @@ public:
 
   /**
    * Construct a new Layer.
+   * @param[in] id The Unique ID of the actor creating the node
    * @return A smart-pointer to a newly allocated Node
    */
-  static SceneGraph::Layer* New();
-
-  /**
-   * Virtual destructor
-   */
-  virtual ~Layer();
+  static SceneGraph::Layer* New( unsigned int id );
 
   /**
    * From Node, to convert a node to a layer.
@@ -210,25 +206,30 @@ private:
 
   /**
    * Private constructor.
+   * @param[in] id The Unique ID of the actor creating the node
    * See also Layer::New()
    */
-  Layer();
+  Layer( unsigned int id );
 
   // Undefined
   Layer(const Layer&);
 
+  /**
+   * Virtual destructor
+   */
+  virtual ~Layer();
+
   // Undefined
   Layer& operator=(const Layer& rhs);
 
 public: // For update-algorithms
 
-  RenderableContainer stencilRenderables;
   RenderableContainer colorRenderables;
   RenderableContainer overlayRenderables;
 
 private:
 
-  SortFunctionType mSortFunction; ///< Used to sort semi-transparent geometry
+  SortFunctionType mSortFunction;     ///< Used to sort semi-transparent geometry
 
   ClippingBox mClippingBox;           ///< The clipping box, in window coordinates
   Camera* mLastCamera;                ///< Pointer to the last camera that has rendered the layer
@@ -236,8 +237,8 @@ private:
   Dali::Layer::Behavior mBehavior;    ///< The behavior of the layer
 
   bool mAllChildTransformsClean[ 2 ]; ///< True if all child nodes transforms are clean,
-                                      /// double buffered as we need two clean frames before we can reuse N-1 for N+1
-                                      /// this allows us to cache render items when layer is "static"
+                                      ///  double buffered as we need two clean frames before we can reuse N-1 for N+1
+                                      ///  this allows us to cache render items when layer is "static"
   bool mIsClipping:1;                 ///< True when clipping is enabled
   bool mDepthTestDisabled:1;          ///< Whether depth test is disabled.
   bool mIsDefaultSortFunction:1;      ///< whether the default depth sort function is used
@@ -333,8 +334,18 @@ inline void SetDepthTestDisabledMessage( EventThreadServices& eventThreadService
 
 } // namespace SceneGraph
 
+// Template specialisation for OwnerPointer<Layer>, because delete is protected
+template <>
+inline void OwnerPointer<Dali::Internal::SceneGraph::Layer>::Reset()
+{
+  if (mObject != NULL)
+  {
+    Dali::Internal::SceneGraph::Node::Delete(mObject);
+    mObject = NULL;
+  }
+}
 } // namespace Internal
 
 } // namespace Dali
 
-#endif // __DALI_INTERNAL_SCENE_GRAPH_LAYER_H__
+#endif // DALI_INTERNAL_SCENE_GRAPH_LAYER_H