Revert "[Tizen] Implement partial update"
[platform/core/uifw/dali-core.git] / dali / internal / update / manager / update-algorithms.cpp
index d7f9759..b767b58 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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.
@@ -54,7 +54,6 @@ Debug::Filter* gUpdateFilter = Debug::Filter::New(Debug::Concise, false, "LOG_UP
  * 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 )
 {
@@ -72,9 +71,9 @@ void ConstrainPropertyOwner( PropertyOwner& propertyOwner, BufferIndex updateBuf
  ************************** 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 );
   }
@@ -85,10 +84,10 @@ inline void UpdateRootNodeOpacity( Layer& rootNode, int nodeDirtyFlags, BufferIn
   }
 }
 
-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 );
   }
@@ -102,20 +101,20 @@ inline void UpdateNodeOpacity( Node& node, int nodeDirtyFlags, BufferIndex updat
 /**
  * This is called recursively for all children of the root Node
  */
-inline int UpdateNodes( Node& node,
-                        int parentFlags,
-                        BufferIndex updateBufferIndex,
-                        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
@@ -127,9 +126,9 @@ inline int UpdateNodes( Node& node,
   }
 
   // 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 = &currentLayer;
   Layer* nodeIsLayer( node.GetLayer() );
@@ -180,16 +179,16 @@ inline int UpdateNodes( Node& node,
 /**
  * The root node is treated separately; it cannot inherit values since it has no parent
  */
-int UpdateNodeTree( Layer& rootNode,
-                    BufferIndex updateBufferIndex,
-                    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
@@ -200,9 +199,9 @@ int UpdateNodeTree( Layer& rootNode,
     rootNode.SetAllDirtyFlags();
   }
 
-  int nodeDirtyFlags( rootNode.GetDirtyFlags() );
+  NodePropertyFlags nodeDirtyFlags( rootNode.GetDirtyFlags() );
 
-  int cumulativeDirtyFlags = nodeDirtyFlags;
+  NodePropertyFlags cumulativeDirtyFlags = nodeDirtyFlags;
 
   UpdateRootNodeOpacity( rootNode, nodeDirtyFlags, updateBufferIndex );