Ensure to update nodes even though they are invisible 55/248555/2
authorHeeyong Song <heeyong.song@samsung.com>
Mon, 30 Nov 2020 02:34:06 +0000 (11:34 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Wed, 2 Dec 2020 02:36:43 +0000 (11:36 +0900)
Change-Id: I5a7b77fc12ca28b18d207946b89357e9600f7d91

automated-tests/src/dali/utc-Dali-Actor.cpp
dali/internal/update/manager/update-algorithms.cpp

index d23681c..be96815 100755 (executable)
@@ -8987,3 +8987,64 @@ int UtcDaliActorPropertyBlendEquation(void)
 
   END_TEST;
 }
+
+int UtcDaliActorRegisterProperty(void)
+{
+  tet_infoline("Test property registration and uniform map update\n");
+
+  TestApplication application;
+
+  Geometry geometry  = CreateQuadGeometry();
+  Shader   shader    = CreateShader();
+  Renderer renderer1 = Renderer::New(geometry, shader);
+  Renderer renderer2 = Renderer::New(geometry, shader);
+
+  Actor actor1 = Actor::New();
+  actor1.AddRenderer(renderer1);
+  actor1.SetProperty(Actor::Property::SIZE, Vector2(100, 100));
+  actor1.RegisterProperty("uCustom", 1);
+  application.GetScene().Add(actor1);
+
+  Actor actor2 = Actor::New();
+  actor2.AddRenderer(renderer2);
+  actor2.SetProperty(Actor::Property::SIZE, Vector2(100, 100));
+  application.GetScene().Add(actor2);
+
+  TestGlAbstraction& glAbstraction = application.GetGlAbstraction();
+  TraceCallStack&    callStack     = glAbstraction.GetSetUniformTrace();
+  glAbstraction.EnableSetUniformCallTrace(true);
+
+  application.SendNotification();
+  application.Render();
+
+  std::stringstream out;
+  out.str("1");
+  std::string params;
+
+  // Test uniform value of the custom property
+  DALI_TEST_CHECK(callStack.FindMethodAndGetParameters("uCustom", params));
+  DALI_TEST_EQUALS(out.str(), params, TEST_LOCATION);
+
+  // Make invisible
+  actor1[Actor::Property::VISIBLE] = false;
+
+  application.SendNotification();
+  application.Render();
+
+  // Make visible again
+  actor1[Actor::Property::VISIBLE] = true;
+  actor1["uCustom"]                = 2;
+
+  glAbstraction.ResetSetUniformCallStack();
+
+  application.SendNotification();
+  application.Render();
+
+  out.str("2");
+
+  // The uniform value should not be changed
+  DALI_TEST_CHECK(callStack.FindMethodAndGetParameters("uCustom", params));
+  DALI_TEST_EQUALS(out.str(), params, TEST_LOCATION);
+
+  END_TEST;
+}
index b767b58..a06cffc 100644 (file)
@@ -111,20 +111,6 @@ inline NodePropertyFlags UpdateNodes( Node& node,
   // Apply constraints to the node
   ConstrainPropertyOwner( node, updateBufferIndex );
 
-  // Short-circuit for invisible nodes
-  if ( !node.IsVisible( updateBufferIndex ) )
-  {
-    return NodePropertyFlags::NOTHING;
-  }
-
-  // If the node was not previously visible
-  BufferIndex previousBuffer = updateBufferIndex ? 0u : 1u;
-  if ( !node.IsVisible( previousBuffer ) )
-  {
-    // The node was skipped in the previous update; it must recalculate everything
-    node.SetAllDirtyFlags();
-  }
-
   // Some dirty flags are inherited from parent
   NodePropertyFlags nodeDirtyFlags = node.GetInheritedDirtyFlags( parentFlags );