Fix partial update issue when clipping mode changed 27/319127/3
authorEunki, Hong <eunkiki.hong@samsung.com>
Tue, 15 Oct 2024 12:26:39 +0000 (21:26 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Wed, 16 Oct 2024 05:24:59 +0000 (14:24 +0900)
When some node's ancient node change cliping mode from
ClipChildren | ClipBoundingBox to Disable,

we should partial update descent nodes.

Change-Id: I39d28d7026b45df9dd2ca5d8913f9b542cb0086c
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali/internal/update/manager/render-task-processor.cpp
dali/internal/update/nodes/node-declarations.h
dali/internal/update/nodes/node.h

index 517868b87eb548c5381ef6004ba9a9f958731240..dd4b842f31be10f61907e52e068e00a437e44f32 100644 (file)
@@ -83,7 +83,7 @@ Layer* FindLayer(Node& node)
  *
  * @param[in]  updateBufferIndex The current update buffer index.
  * @param[in]  node The current node of the scene-graph.
- * @param[in]  parentVisibilityChanged The parent node's visibility was changed at current frame.
+ * @param[in]  parentVisibilityChanged The parent node's visibility might be changed at current frame. (Due to visibility property, or ancient's clipping mode change)
  * @param[in]  currentLayer The current layer containing lists of opaque/transparent renderables.
  * @param[in]  renderTask The current render-task.
  * @param[in]  inheritedDrawMode The draw mode of the parent
@@ -121,6 +121,12 @@ void AddRenderablesForTask(BufferIndex updateBufferIndex,
     parentVisibilityChanged                 = true;
   }
 
+  // If the node's clipping mode is changed, we need to mark all descendent nodes as updated
+  if(node.IsClippingModeChanged())
+  {
+    parentVisibilityChanged = true;
+  }
+
   if(parentVisibilityChanged)
   {
     node.SetUpdated(true);
index 6a66d30a34403a1f6c6bedfd5c10daee11c8d392..b5925a5ac2414efbb66d0bad870d76e4c8f0f427 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SCENE_GRAPH_NODE_DECLARATIONS_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
@@ -41,7 +41,7 @@ using NodeConstIter = NodeContainer::ConstIterator;
  * Flag whether property has changed, during the Update phase.
  */
 enum class NodePropertyFlags : uint8_t
-// 8 bits is enough for 6 flags (compiler will check it)
+// 8 bits is enough for 7 flags (compiler will check it)
 {
   NOTHING                      = 0x000,
   TRANSFORM                    = 0x001,
@@ -50,7 +50,8 @@ enum class NodePropertyFlags : uint8_t
   CHILD_DELETED                = 0x008,
   CHILDREN_REORDER             = 0x010,
   DESCENDENT_HIERARCHY_CHANGED = 0x020,
-  ALL                          = (DESCENDENT_HIERARCHY_CHANGED << 1) - 1 // all the flags
+  CLIPPING_MODE                = 0x040,
+  ALL                          = (CLIPPING_MODE << 1) - 1 // all the flags
 };
 
 struct NodeDepthPair
index f694e4b0a3825ef87152e71fbf167b25877be79a..8ad2dc98be1d6e80b245c0b6cdd0f39f47ae3fb1 100644 (file)
@@ -62,7 +62,7 @@ class ResetterManager;
 class Node;
 
 // Flags which require the scene renderable lists to be updated
-static NodePropertyFlags RenderableUpdateFlags = NodePropertyFlags::TRANSFORM | NodePropertyFlags::CHILD_DELETED;
+static NodePropertyFlags RenderableUpdateFlags = NodePropertyFlags::TRANSFORM | NodePropertyFlags::CHILD_DELETED | NodePropertyFlags::CLIPPING_MODE;
 
 /**
  * Node is the base class for all nodes in the Scene Graph.
@@ -222,8 +222,11 @@ public:
    */
   void SetClippingMode(const ClippingMode::Type clippingMode)
   {
-    mClippingMode = clippingMode;
-    SetDirtyFlag(NodePropertyFlags::TRANSFORM);
+    if(mClippingMode != clippingMode)
+    {
+      mClippingMode = clippingMode;
+      SetDirtyFlag(NodePropertyFlags::CLIPPING_MODE);
+    }
   }
 
   /**
@@ -913,6 +916,16 @@ public:
     return mDirtyFlags & NodePropertyFlags::DESCENDENT_HIERARCHY_CHANGED;
   }
 
+  /**
+   * @brief Get whether clipping mode was changed.
+   * @note It will be reset when mDirtyFlag reseted.
+   * @return True if current node's clipping mode was changed.
+   */
+  bool IsClippingModeChanged() const
+  {
+    return mDirtyFlags & NodePropertyFlags::CLIPPING_MODE;
+  }
+
   /**
    * @brief Propagate the heirarchy changeness flag to it's parent node.
    */