X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fupdate%2Fnodes%2Fscene-graph-layer.cpp;h=d23419cfd0a3fcfb574dda569e6778faf5818164;hb=55827866fcb8c7ee47581ac4335a3390472090e8;hp=8b4e428a9ca04dae82e175a948ab44f8e5eb4aa4;hpb=f612f1e4751a1be72fc69f9d9e954c009ed35283;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 8b4e428..d23419c --- 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. @@ -17,6 +17,7 @@ // CLASS HEADER #include +#include // INTERNAL INCLUDES #include @@ -32,17 +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( Dali::Layer::ZValue ), +: Node(), + mSortFunction( Internal::Layer::ZValue ), mClippingBox( 0,0,0,0 ), - mLastCamera(0), + mLastCamera( NULL ), + 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; @@ -56,8 +64,9 @@ void Layer::SetSortFunction( Dali::Layer::SortFunctionType function ) { if( mSortFunction != function ) { + SetPropertyDirty( true ); // is a custom sort function used - if( function != Dali::Layer::ZValue ) + if( function != Internal::Layer::ZValue ) { mIsDefaultSortFunction = false; } @@ -76,16 +85,25 @@ void Layer::SetSortFunction( Dali::Layer::SortFunctionType function ) void Layer::SetClipping(bool enabled) { mIsClipping = enabled; + SetPropertyDirty( true ); } void Layer::SetClippingBox(const Dali::ClippingBox& box) { mClippingBox.Set(box.x, box.y, box.width, box.height); + SetPropertyDirty( true ); +} + +void Layer::SetBehavior( Dali::Layer::Behavior behavior ) +{ + mBehavior = behavior; + SetPropertyDirty( true ); } void Layer::SetDepthTestDisabled( bool disable ) { mDepthTestDisabled = disable; + SetPropertyDirty( true ); } bool Layer::IsDepthTestDisabled() const @@ -93,6 +111,12 @@ bool Layer::IsDepthTestDisabled() const return mDepthTestDisabled; } +void Layer::ClearRenderables() +{ + colorRenderables.Clear(); + overlayRenderables.Clear(); +} + } // namespace SceneGraph } // namespace Internal