/*
- * 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.
#include <dali/public-api/actors/draw-mode.h>
#include <dali/public-api/math/matrix.h>
#include <dali/public-api/math/vector3.h>
-#include <dali/internal/update/resources/resource-manager.h>
#include <dali/internal/update/nodes/node.h>
#include <dali/internal/update/animation/scene-graph-constraint-base.h>
#include <dali/internal/update/nodes/scene-graph-layer.h>
* Constrain the local properties of the PropertyOwner.
* @param propertyOwner to constrain
* @param updateBufferIndex buffer index to use
- * @return The number of constraints that are still being applied
*/
void ConstrainPropertyOwner( PropertyOwner& propertyOwner, BufferIndex updateBufferIndex )
{
************************** Update node hierarchy *****************************
******************************************************************************/
-inline void UpdateRootNodeOpacity( Layer& rootNode, int nodeDirtyFlags, BufferIndex updateBufferIndex )
+inline void UpdateRootNodeOpacity( Layer& rootNode, NodePropertyFlags nodeDirtyFlags, BufferIndex updateBufferIndex )
{
- if ( nodeDirtyFlags & ColorFlag )
+ if ( nodeDirtyFlags & NodePropertyFlags::COLOR )
{
rootNode.SetWorldColor( rootNode.GetColor( updateBufferIndex ), updateBufferIndex );
}
}
}
-inline void UpdateNodeOpacity( Node& node, int nodeDirtyFlags, BufferIndex updateBufferIndex )
+inline void UpdateNodeOpacity( Node& node, NodePropertyFlags nodeDirtyFlags, BufferIndex updateBufferIndex )
{
// If opacity needs to be recalculated
- if ( nodeDirtyFlags & ColorFlag )
+ if ( nodeDirtyFlags & NodePropertyFlags::COLOR )
{
node.InheritWorldColor( updateBufferIndex );
}
/**
* This is called recursively for all children of the root Node
*/
-inline int UpdateNodes( Node& node,
- int parentFlags,
- BufferIndex updateBufferIndex,
- ResourceManager& resourceManager,
- RenderQueue& renderQueue,
- Layer& currentLayer,
- int inheritedDrawMode )
+inline NodePropertyFlags UpdateNodes( Node& node,
+ NodePropertyFlags parentFlags,
+ BufferIndex updateBufferIndex,
+ RenderQueue& renderQueue,
+ Layer& currentLayer,
+ uint32_t inheritedDrawMode )
{
- //Apply constraints to the node
+ // Apply constraints to the node
ConstrainPropertyOwner( node, updateBufferIndex );
// Short-circuit for invisible nodes
if ( !node.IsVisible( updateBufferIndex ) )
{
- return 0;
+ return NodePropertyFlags::NOTHING;
}
// If the node was not previously visible
}
// Some dirty flags are inherited from parent
- int nodeDirtyFlags( node.GetDirtyFlags() | ( parentFlags & InheritedDirtyFlags ) );
+ NodePropertyFlags nodeDirtyFlags = node.GetInheritedDirtyFlags( parentFlags );
- int cumulativeDirtyFlags = nodeDirtyFlags;
+ NodePropertyFlags cumulativeDirtyFlags = nodeDirtyFlags;
Layer* layer = ¤tLayer;
Layer* nodeIsLayer( node.GetLayer() );
cumulativeDirtyFlags |=UpdateNodes( child,
nodeDirtyFlags,
updateBufferIndex,
- resourceManager,
renderQueue,
*layer,
inheritedDrawMode );
/**
* The root node is treated separately; it cannot inherit values since it has no parent
*/
-int UpdateNodeTree( Layer& rootNode,
- BufferIndex updateBufferIndex,
- ResourceManager& resourceManager,
- RenderQueue& renderQueue )
+NodePropertyFlags UpdateNodeTree( Layer& rootNode,
+ BufferIndex updateBufferIndex,
+ RenderQueue& renderQueue )
{
DALI_ASSERT_DEBUG( rootNode.IsRoot() );
// Short-circuit for invisible nodes
if ( DALI_UNLIKELY( !rootNode.IsVisible( updateBufferIndex ) ) ) // almost never ever true
{
- return 0;
+ return NodePropertyFlags::NOTHING;
}
// If the root node was not previously visible
rootNode.SetAllDirtyFlags();
}
- int nodeDirtyFlags( rootNode.GetDirtyFlags() );
+ NodePropertyFlags nodeDirtyFlags( rootNode.GetDirtyFlags() );
- int cumulativeDirtyFlags = nodeDirtyFlags;
+ NodePropertyFlags cumulativeDirtyFlags = nodeDirtyFlags;
UpdateRootNodeOpacity( rootNode, nodeDirtyFlags, updateBufferIndex );
cumulativeDirtyFlags |= UpdateNodes( child,
nodeDirtyFlags,
updateBufferIndex,
- resourceManager,
renderQueue,
rootNode,
drawMode );