/*
- * Copyright (c) 2016 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.
//Memory pool used to allocate new nodes. Memory used by this pool will be released when process dies
// or DALI library is unloaded
Dali::Internal::MemoryPoolObjectAllocator<Dali::Internal::SceneGraph::Node> gNodeMemoryPool;
+#ifdef DEBUG_ENABLED
+// keep track of nodes created / deleted, to ensure we have 0 when the process exits or DALi library is unloaded
+int gNodeCount =0;
+
+// Called when the process is about to exit, Node count should be zero at this point.
+void __attribute__ ((destructor)) ShutDown(void)
+{
+DALI_ASSERT_DEBUG( (gNodeCount == 0) && "Node memory leak");
+}
+#endif
}
namespace Dali
mExclusiveRenderTask( NULL ),
mChildren(),
mClippingDepth( 0u ),
+ mScissorDepth( 0u ),
mDepthIndex( 0u ),
mRegenerateUniformMap( 0 ),
mDirtyFlags( AllFlags ),
mColorMode( DEFAULT_COLOR_MODE ),
mClippingMode( ClippingMode::DISABLED ),
mIsRoot( false ),
- mIsLayer( false )
+ mIsLayer( false ),
+ mPositionUsesAnchorPoint( true )
{
mUniformMapChanged[0] = 0u;
mUniformMapChanged[1] = 0u;
+
+#ifdef DEBUG_ENABLED
+ gNodeCount++;
+#endif
+
}
Node::~Node()
{
mTransformManager->RemoveTransform(mTransformId);
}
+
+#ifdef DEBUG_ENABLED
+ gNodeCount--;
+#endif
}
void Node::OnDestroy()
mWorldScale.Initialize( transformManager, mTransformId );
mWorldOrientation.Initialize( transformManager, mTransformId );
mWorldMatrix.Initialize( transformManager, mTransformId );
+
+ //Set whether the position should use the anchor point
+ transformManager->SetPositionUsesAnchorPoint( mTransformId, mPositionUsesAnchorPoint );
}
void Node::SetRoot(bool isRoot)
mIsRoot = isRoot;
}
-void Node::AddUniformMapping( UniformPropertyMapping* map )
+void Node::AddUniformMapping( OwnerPointer< UniformPropertyMapping >& map )
{
PropertyOwner::AddUniformMapping( map );
mRegenerateUniformMap = 2;
return flags;
}
-void Node::ResetDefaultProperties( BufferIndex updateBufferIndex )
+void Node::ResetDirtyFlags( BufferIndex updateBufferIndex )
{
- mVisible.ResetToBaseValue( updateBufferIndex );
- mColor.ResetToBaseValue( updateBufferIndex );
-
mDirtyFlags = NothingFlag;
}