X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fupdate%2Fnodes%2Fscene-graph-layer.cpp;h=1d920be6d1a5d3ebe9668d876250470757b262a2;hb=0a68c62785eaa442cfa213157431d6f2c9b37033;hp=8cf81551d38427c7a83c6ada5de51c63c35761cc;hpb=111e4590a7f0b90fbf9683e29d6d39d9da15ef60;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/update/nodes/scene-graph-layer.cpp b/dali/internal/update/nodes/scene-graph-layer.cpp old mode 100644 new mode 100755 index 8cf8155..8f9ff00 --- a/dali/internal/update/nodes/scene-graph-layer.cpp +++ b/dali/internal/update/nodes/scene-graph-layer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 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. @@ -33,18 +33,24 @@ namespace SceneGraph SceneGraph::Layer* Layer::New() { + // 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(); } Layer::Layer() -: mSortFunction( Internal::Layer::ZValue ), +: Node(), + mSortFunction( Internal::Layer::ZValue ), mClippingBox( 0,0,0,0 ), mLastCamera( NULL ), - mBehavior( Dali::Layer::LAYER_2D ), + mBehavior( Dali::Layer::LAYER_UI ), mIsClipping( false ), - mDepthTestDisabled( false ), + 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; @@ -97,7 +103,13 @@ void Layer::SetDepthTestDisabled( bool disable ) bool Layer::IsDepthTestDisabled() const { - return ( mBehavior == Dali::Layer::LAYER_2D ) || mDepthTestDisabled; + return mDepthTestDisabled; +} + +void Layer::ClearRenderables() +{ + colorRenderables.Clear(); + overlayRenderables.Clear(); } } // namespace SceneGraph