X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fupdate%2Fnodes%2Fscene-graph-layer.cpp;h=46bb14cb00ddf998d64eea6eda5a155e0f18ddca;hb=649ec06daecb510fb84fe4642a6af957f127e7ab;hp=3d0e5e59b2103c68e35dd918542bccb5982044f4;hpb=52d998719683ba91c5f7fbd2c9da544f51317891;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 index 3d0e5e5..46bb14c 100644 --- 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) 2016 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,13 +17,11 @@ // CLASS HEADER #include +#include // INTERNAL INCLUDES #include - -using namespace std; - namespace Dali { @@ -35,17 +33,23 @@ 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 ), +: mSortFunction( Internal::Layer::ZValue ), mClippingBox( 0,0,0,0 ), - mLastCamera(0), + mLastCamera( NULL ), + mBehavior( Dali::Layer::LAYER_2D ), 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; @@ -60,7 +64,7 @@ void Layer::SetSortFunction( Dali::Layer::SortFunctionType function ) if( mSortFunction != function ) { // is a custom sort function used - if( function != Dali::Layer::ZValue ) + if( function != Internal::Layer::ZValue ) { mIsDefaultSortFunction = false; } @@ -86,6 +90,11 @@ void Layer::SetClippingBox(const Dali::ClippingBox& box) mClippingBox.Set(box.x, box.y, box.width, box.height); } +void Layer::SetBehavior( Dali::Layer::Behavior behavior ) +{ + mBehavior = behavior; +} + void Layer::SetDepthTestDisabled( bool disable ) { mDepthTestDisabled = disable; @@ -96,8 +105,23 @@ bool Layer::IsDepthTestDisabled() const return mDepthTestDisabled; } +void Layer::ClearRenderables() +{ + colorRenderables.Clear(); + overlayRenderables.Clear(); +} + } // namespace SceneGraph +template <> +void OwnerPointer::Reset() +{ + if( mObject != NULL ) + { + Dali::Internal::SceneGraph::Node::Delete( mObject ); + mObject = NULL; + } +} } // namespace Internal } // namespace Dali