/*
- * 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.
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 ),
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;
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;
return mDepthTestDisabled;
}
+void Layer::ClearRenderables()
+{
+ colorRenderables.Clear();
+ overlayRenderables.Clear();
+}
+
} // namespace SceneGraph
+template <>
+void OwnerPointer<Dali::Internal::SceneGraph::Layer>::Reset()
+{
+ if( mObject != NULL )
+ {
+ Dali::Internal::SceneGraph::Node::Delete( mObject );
+ mObject = NULL;
+ }
+}
} // namespace Internal
} // namespace Dali