Mofidy codes for Dali Windows backend
[platform/core/uifw/dali-core.git] / dali / internal / update / nodes / scene-graph-layer.cpp
old mode 100644 (file)
new mode 100755 (executable)
index 1d920be..db6e6f0
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -31,13 +31,16 @@ namespace Internal
 namespace SceneGraph
 {
 
-SceneGraph::Layer* Layer::New()
+SceneGraph::Layer* Layer::New( unsigned int id )
 {
-  return new Layer();
+  // Layers are currently heap allocated, unlike Nodes which are in a memory pool
+  // However Node::Delete( layer ) will correctly delete a layer / node depending on type
+  return new Layer( id );
 }
 
-Layer::Layer()
-: mSortFunction( Internal::Layer::ZValue ),
+Layer::Layer( unsigned int id )
+: Node( id ),
+  mSortFunction( Internal::Layer::ZValue ),
   mClippingBox( 0,0,0,0 ),
   mLastCamera( NULL ),
   mBehavior( Dali::Layer::LAYER_2D ),
@@ -45,6 +48,9 @@ Layer::Layer()
   mDepthTestDisabled( true ),
   mIsDefaultSortFunction( true )
 {
+  // set a flag the node to say this is a layer
+  mIsLayer = true;
+
   // layer starts off dirty
   mAllChildTransformsClean[ 0 ] = false;
   mAllChildTransformsClean[ 1 ] = false;
@@ -102,7 +108,6 @@ bool Layer::IsDepthTestDisabled() const
 
 void Layer::ClearRenderables()
 {
-  stencilRenderables.Clear();
   colorRenderables.Clear();
   overlayRenderables.Clear();
 }