2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali/internal/update/nodes/scene-graph-layer.h>
22 #include <dali/public-api/common/dali-common.h>
33 SceneGraph::Layer* Layer::New()
39 : mSortFunction( Dali::Layer::ZValue ),
40 mClippingBox( 0,0,0,0 ),
43 mDepthTestDisabled( false ),
44 mIsDefaultSortFunction( true )
46 // layer starts off dirty
47 mAllChildTransformsClean[ 0 ] = false;
48 mAllChildTransformsClean[ 1 ] = false;
55 void Layer::SetSortFunction( Dali::Layer::SortFunctionType function )
57 if( mSortFunction != function )
59 // is a custom sort function used
60 if( function != Dali::Layer::ZValue )
62 mIsDefaultSortFunction = false;
66 mIsDefaultSortFunction = true;
69 // changing the sort function makes the layer dirty
70 mAllChildTransformsClean[ 0 ] = false;
71 mAllChildTransformsClean[ 1 ] = false;
72 mSortFunction = function;
76 void Layer::SetClipping(bool enabled)
78 mIsClipping = enabled;
81 void Layer::SetClippingBox(const Dali::ClippingBox& box)
83 mClippingBox.Set(box.x, box.y, box.width, box.height);
86 void Layer::SetDepthTestDisabled( bool disable )
88 mDepthTestDisabled = disable;
91 bool Layer::IsDepthTestDisabled() const
93 return mDepthTestDisabled;
96 } // namespace SceneGraph
98 } // namespace Internal