/*
- * Copyright (c) 2014 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/node-attachments/node-attachment.h>
#include <dali/internal/update/animation/scene-graph-constraint-base.h>
#include <dali/internal/update/nodes/scene-graph-layer.h>
#include <dali/internal/render/renderers/render-renderer.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 UpdateNodesAndAttachments( Node& node,
- int parentFlags,
+inline NodePropertyFlags UpdateNodes( Node& node,
+ NodePropertyFlags parentFlags,
BufferIndex updateBufferIndex,
- ResourceManager& resourceManager,
RenderQueue& renderQueue,
Layer& currentLayer,
- int inheritedDrawMode )
+ 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() );
UpdateNodeOpacity( node, nodeDirtyFlags, updateBufferIndex );
- // Setting STENCIL will override OVERLAY_2D, if that would otherwise have been inherited.
+ // Draw mode inheritance is treated as or-ing the modes together (as they are a bit-mask).
inheritedDrawMode |= node.GetDrawMode();
node.PrepareRender( updateBufferIndex );
for ( NodeIter iter = children.Begin(); iter != endIter; ++iter )
{
Node& child = **iter;
- cumulativeDirtyFlags |=UpdateNodesAndAttachments( child,
- nodeDirtyFlags,
- updateBufferIndex,
- resourceManager,
- renderQueue,
- *layer,
- inheritedDrawMode );
+ cumulativeDirtyFlags |=UpdateNodes( child,
+ nodeDirtyFlags,
+ updateBufferIndex,
+ renderQueue,
+ *layer,
+ inheritedDrawMode );
}
return cumulativeDirtyFlags;
/**
* The root node is treated separately; it cannot inherit values since it has no parent
*/
-int UpdateNodesAndAttachments( 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 );
for ( NodeIter iter = children.Begin(); iter != endIter; ++iter )
{
Node& child = **iter;
- cumulativeDirtyFlags |= UpdateNodesAndAttachments( child,
- nodeDirtyFlags,
- updateBufferIndex,
- resourceManager,
- renderQueue,
- rootNode,
- drawMode );
+ cumulativeDirtyFlags |= UpdateNodes( child,
+ nodeDirtyFlags,
+ updateBufferIndex,
+ renderQueue,
+ rootNode,
+ drawMode );
}
return cumulativeDirtyFlags;