X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fupdate%2Fnodes%2Fscene-graph-layer.cpp;h=db6e6f0986a1edeb15da32939e9c76638f99e059;hb=01c39de261f6eb4e759c7a249e5d67dfef83bca2;hp=a42715abad1de267c5fa7c53b1596f55501bba7a;hpb=ce20e9f082e811130930d13c9e9edc1da4ce1013;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 a42715a..db6e6f0 --- a/dali/internal/update/nodes/scene-graph-layer.cpp +++ b/dali/internal/update/nodes/scene-graph-layer.cpp @@ -1,28 +1,27 @@ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// +/* + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ // CLASS HEADER #include +#include // INTERNAL INCLUDES #include - -using namespace std; - namespace Dali { @@ -32,17 +31,26 @@ 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( Dali::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 ), 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,6 +64,16 @@ void Layer::SetSortFunction( Dali::Layer::SortFunctionType function ) { if( mSortFunction != function ) { + // is a custom sort function used + if( function != Internal::Layer::ZValue ) + { + mIsDefaultSortFunction = false; + } + else + { + mIsDefaultSortFunction = true; + } + // changing the sort function makes the layer dirty mAllChildTransformsClean[ 0 ] = false; mAllChildTransformsClean[ 1 ] = false; @@ -73,6 +91,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; @@ -83,6 +106,12 @@ bool Layer::IsDepthTestDisabled() const return mDepthTestDisabled; } +void Layer::ClearRenderables() +{ + colorRenderables.Clear(); + overlayRenderables.Clear(); +} + } // namespace SceneGraph } // namespace Internal