Merge "Reduce Render::Renderer size" into devel/master
authorHeeyong Song <heeyong.song@samsung.com>
Fri, 6 Jan 2023 02:22:48 +0000 (02:22 +0000)
committerGerrit Code Review <gerrit@review>
Fri, 6 Jan 2023 02:22:48 +0000 (02:22 +0000)
22 files changed:
automated-tests/src/dali/utc-Dali-Actor.cpp
automated-tests/src/dali/utc-Dali-Scene.cpp
dali/internal/common/core-impl.cpp
dali/internal/event/actors/actor-relayouter.cpp
dali/internal/event/actors/actor-relayouter.h
dali/internal/event/actors/actor-sizer.cpp
dali/internal/event/actors/actor-sizer.h
dali/internal/event/common/notification-manager.cpp
dali/internal/event/common/property-notification-impl.cpp
dali/internal/event/events/key-event-processor.cpp
dali/internal/event/rendering/decorated-visual-renderer-impl.cpp
dali/internal/event/rendering/decorated-visual-renderer-impl.h
dali/internal/event/rendering/visual-renderer-impl.cpp
dali/internal/event/rendering/visual-renderer-impl.h
dali/internal/event/size-negotiation/relayout-controller-impl.cpp
dali/internal/render/common/render-algorithms.cpp
dali/internal/render/common/render-manager.cpp
dali/internal/update/common/scene-graph-property-notification.cpp
dali/internal/update/common/scene-graph-property-notification.h
dali/internal/update/manager/frame-callback-processor.cpp
dali/internal/update/rendering/scene-graph-renderer.cpp
dali/internal/update/rendering/scene-graph-renderer.h

index a528eb3..1745226 100644 (file)
@@ -1155,6 +1155,33 @@ int UtcDaliActorSetSize04(void)
   END_TEST;
 }
 
+int UtcDaliActorSetSize05(void)
+{
+  TestApplication application;
+
+  Actor   parent = Actor::New();
+  Vector2 vector(200.0f, 200.0f);
+  DALI_TEST_CHECK(vector != parent.GetCurrentProperty<Vector2>(Actor::Property::SIZE));
+
+  parent.SetProperty(Actor::Property::SIZE, vector);
+  Vector2 size = parent.GetProperty(Actor::Property::SIZE).Get<Vector2>();
+  DALI_TEST_EQUALS(size, vector, Math::MACHINE_EPSILON_0, TEST_LOCATION);
+
+  Actor   child = Actor::New();
+  DALI_TEST_CHECK(vector != child.GetCurrentProperty<Vector2>(Actor::Property::SIZE));
+  child.SetProperty(Actor::Property::SIZE, vector);
+  size = parent.GetProperty(Actor::Property::SIZE).Get<Vector2>();
+  DALI_TEST_EQUALS(size, vector, Math::MACHINE_EPSILON_0, TEST_LOCATION);
+
+  // flush the queue and render once
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_CHECK(vector == parent.GetCurrentProperty<Vector2>(Actor::Property::SIZE));
+
+  END_TEST;
+}
+
 int UtcDaliActorSetSizeIndividual(void)
 {
   TestApplication application;
index e4e0369..0dd5e19 100644 (file)
@@ -1248,7 +1248,85 @@ int UtcDaliSceneSurfaceRotatedWithAngle90(void)
   damagedRects.clear();
   application.GetScene().SurfaceRotated(TestApplication::DEFAULT_SURFACE_WIDTH,
                                         TestApplication::DEFAULT_SURFACE_HEIGHT,
-                                        90, 90);
+                                        90, 0);
+
+  // Check current surface orientation
+  int32_t orientation = application.GetScene().GetCurrentSurfaceOrientation();
+  int32_t screenOrientation = application.GetScene().GetCurrentScreenOrientation();
+
+  // It should not be changed yet.
+  DALI_TEST_EQUALS(orientation, 0, TEST_LOCATION);
+  DALI_TEST_EQUALS(screenOrientation, 0, TEST_LOCATION);
+
+  application.SendNotification();
+  application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+  DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
+
+  clippingRect = Rect<int>(CLIPPING_RECT_X, CLIPPING_RECT_Y, CLIPPING_RECT_WIDTH, CLIPPING_RECT_HEIGHT); // in screen coordinates, includes 3 last frames updates
+  DALI_TEST_EQUALS<Rect<int>>(clippingRect, damagedRects[0], TEST_LOCATION);
+  application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+  // It is recalculation for glScissor.
+  // Because surface is rotated and glScissor is called with recalcurated value.
+  // Total angle is 90, (90 + 0 = 90)
+  clippingRect.x      = TestApplication::DEFAULT_SURFACE_HEIGHT - (CLIPPING_RECT_Y + CLIPPING_RECT_HEIGHT);
+  clippingRect.y      = CLIPPING_RECT_X;
+  clippingRect.width  = CLIPPING_RECT_HEIGHT;
+  clippingRect.height = CLIPPING_RECT_WIDTH;
+
+  DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
+
+  // Check current orientations
+  orientation = application.GetScene().GetCurrentSurfaceOrientation();
+  screenOrientation = application.GetScene().GetCurrentScreenOrientation();
+
+  // It should be changed.
+  DALI_TEST_EQUALS(orientation, 90, TEST_LOCATION);
+  DALI_TEST_EQUALS(screenOrientation, 0, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliSceneScreenRotatedWithAngle90(void)
+{
+  tet_infoline("Ensure rotation of the screen is handled properly with Angle 90");
+
+  TestApplication application(
+    TestApplication::DEFAULT_SURFACE_WIDTH,
+    TestApplication::DEFAULT_SURFACE_HEIGHT,
+    TestApplication::DEFAULT_HORIZONTAL_DPI,
+    TestApplication::DEFAULT_VERTICAL_DPI,
+    true,
+    true);
+
+  const TestGlAbstraction::ScissorParams& glScissorParams(application.GetGlAbstraction().GetScissorParams());
+
+  std::vector<Rect<int>> damagedRects;
+  Rect<int>              clippingRect;
+  application.SendNotification();
+  application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+
+  DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION);
+
+  clippingRect = TestApplication::DEFAULT_SURFACE_RECT;
+  application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+  Actor actor = CreateRenderableActor();
+  actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+  actor.SetProperty(Actor::Property::POSITION, Vector3(16.0f, 16.0f, 0.0f));
+  actor.SetProperty(Actor::Property::SIZE, Vector3(16.0f, 16.0f, 0.0f));
+  actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
+  application.GetScene().Add(actor);
+
+  application.SendNotification();
+
+  damagedRects.clear();
+  application.GetScene().SurfaceRotated(TestApplication::DEFAULT_SURFACE_WIDTH,
+                                        TestApplication::DEFAULT_SURFACE_HEIGHT,
+                                        0, 90);
 
   // Check current surface orientation
   int32_t orientation = application.GetScene().GetCurrentSurfaceOrientation();
@@ -1268,6 +1346,7 @@ int UtcDaliSceneSurfaceRotatedWithAngle90(void)
 
   // It is recalculation for glScissor.
   // Because surface is rotated and glScissor is called with recalcurated value.
+  // Total angle is 90, (0 + 90 = 90)
   clippingRect.x      = TestApplication::DEFAULT_SURFACE_HEIGHT - (CLIPPING_RECT_Y + CLIPPING_RECT_HEIGHT);
   clippingRect.y      = CLIPPING_RECT_X;
   clippingRect.width  = CLIPPING_RECT_HEIGHT;
@@ -1283,6 +1362,84 @@ int UtcDaliSceneSurfaceRotatedWithAngle90(void)
   screenOrientation = application.GetScene().GetCurrentScreenOrientation();
 
   // It should be changed.
+  DALI_TEST_EQUALS(orientation, 0, TEST_LOCATION);
+  DALI_TEST_EQUALS(screenOrientation, 90, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliSceneSurfaceAndScreenRotatedWithAngle90(void)
+{
+  tet_infoline("Ensure rotation of the surface and the screen is handled properly with Angle 90");
+
+  TestApplication application(
+    TestApplication::DEFAULT_SURFACE_WIDTH,
+    TestApplication::DEFAULT_SURFACE_HEIGHT,
+    TestApplication::DEFAULT_HORIZONTAL_DPI,
+    TestApplication::DEFAULT_VERTICAL_DPI,
+    true,
+    true);
+
+  const TestGlAbstraction::ScissorParams& glScissorParams(application.GetGlAbstraction().GetScissorParams());
+
+  std::vector<Rect<int>> damagedRects;
+  Rect<int>              clippingRect;
+  application.SendNotification();
+  application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+
+  DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION);
+
+  clippingRect = TestApplication::DEFAULT_SURFACE_RECT;
+  application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+  Actor actor = CreateRenderableActor();
+  actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+  actor.SetProperty(Actor::Property::POSITION, Vector3(16.0f, 16.0f, 0.0f));
+  actor.SetProperty(Actor::Property::SIZE, Vector3(16.0f, 16.0f, 0.0f));
+  actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
+  application.GetScene().Add(actor);
+
+  application.SendNotification();
+
+  damagedRects.clear();
+  application.GetScene().SurfaceRotated(TestApplication::DEFAULT_SURFACE_WIDTH,
+                                        TestApplication::DEFAULT_SURFACE_HEIGHT,
+                                        90, 90);
+
+  // Check current surface orientation
+  int32_t orientation = application.GetScene().GetCurrentSurfaceOrientation();
+  int32_t screenOrientation = application.GetScene().GetCurrentScreenOrientation();
+
+  // It should not be changed yet.
+  DALI_TEST_EQUALS(orientation, 0, TEST_LOCATION);
+  DALI_TEST_EQUALS(screenOrientation, 0, TEST_LOCATION);
+
+  application.SendNotification();
+  application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+  DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
+
+  clippingRect = Rect<int>(CLIPPING_RECT_X, CLIPPING_RECT_Y, CLIPPING_RECT_WIDTH, CLIPPING_RECT_HEIGHT); // in screen coordinates, includes 3 last frames updates
+  DALI_TEST_EQUALS<Rect<int>>(clippingRect, damagedRects[0], TEST_LOCATION);
+  application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+  // It is recalculation for glScissor.
+  // Because surface is rotated and glScissor is called with recalcurated value.
+  // Total angle is 180.(90 + 90 = 180)
+  clippingRect.x      = TestApplication::DEFAULT_SURFACE_WIDTH - (CLIPPING_RECT_X + CLIPPING_RECT_WIDTH);
+  clippingRect.y      = TestApplication::DEFAULT_SURFACE_HEIGHT - (CLIPPING_RECT_Y + CLIPPING_RECT_HEIGHT);
+  clippingRect.width  = CLIPPING_RECT_WIDTH;
+  clippingRect.height = CLIPPING_RECT_HEIGHT;
+
+  DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
+
+  // Check current orientations
+  orientation = application.GetScene().GetCurrentSurfaceOrientation();
+  screenOrientation = application.GetScene().GetCurrentScreenOrientation();
+
+  // It should be changed.
   DALI_TEST_EQUALS(orientation, 90, TEST_LOCATION);
   DALI_TEST_EQUALS(screenOrientation, 90, TEST_LOCATION);
 
@@ -1325,7 +1482,7 @@ int UtcDaliSceneSurfaceRotatedWithAngle180(void)
   damagedRects.clear();
   application.GetScene().SurfaceRotated(TestApplication::DEFAULT_SURFACE_WIDTH,
                                         TestApplication::DEFAULT_SURFACE_HEIGHT,
-                                        180, 180);
+                                        180, 0);
 
   // Check current surface orientation
   int32_t orientation = application.GetScene().GetCurrentSurfaceOrientation();
@@ -1361,14 +1518,14 @@ int UtcDaliSceneSurfaceRotatedWithAngle180(void)
 
   // It should be changed.
   DALI_TEST_EQUALS(orientation, 180, TEST_LOCATION);
-DALI_TEST_EQUALS(screenOrientation, 180, TEST_LOCATION);
+  DALI_TEST_EQUALS(screenOrientation, 0, TEST_LOCATION);
 
   END_TEST;
 }
 
-int UtcDaliSceneSurfaceRotatedWithAngle270(void)
+int UtcDaliSceneScreenRotatedWithAngle180(void)
 {
-  tet_infoline("Ensure rotation of the surface is handled properly with Angle 270");
+  tet_infoline("Ensure rotation of the screen is handled properly with Angle 180");
 
   TestApplication application(
     TestApplication::DEFAULT_SURFACE_WIDTH,
@@ -1402,7 +1559,7 @@ int UtcDaliSceneSurfaceRotatedWithAngle270(void)
   damagedRects.clear();
   application.GetScene().SurfaceRotated(TestApplication::DEFAULT_SURFACE_WIDTH,
                                         TestApplication::DEFAULT_SURFACE_HEIGHT,
-                                        270, 270);
+                                        0, 180);
 
   // Check current surface orientation
   int32_t orientation = application.GetScene().GetCurrentSurfaceOrientation();
@@ -1422,10 +1579,10 @@ int UtcDaliSceneSurfaceRotatedWithAngle270(void)
 
   // It is recalculation for glScissor.
   // Because surface is rotated and glScissor is called with recalcurated value.
-  clippingRect.x      = CLIPPING_RECT_Y;
-  clippingRect.y      = TestApplication::DEFAULT_SURFACE_WIDTH - (CLIPPING_RECT_X + CLIPPING_RECT_WIDTH);
-  clippingRect.width  = CLIPPING_RECT_HEIGHT;
-  clippingRect.height = CLIPPING_RECT_WIDTH;
+  clippingRect.x      = TestApplication::DEFAULT_SURFACE_WIDTH - (CLIPPING_RECT_X + CLIPPING_RECT_WIDTH);
+  clippingRect.y      = TestApplication::DEFAULT_SURFACE_HEIGHT - (CLIPPING_RECT_Y + CLIPPING_RECT_HEIGHT);
+  clippingRect.width  = CLIPPING_RECT_WIDTH;
+  clippingRect.height = CLIPPING_RECT_HEIGHT;
 
   DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION);
   DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION);
@@ -1437,15 +1594,15 @@ int UtcDaliSceneSurfaceRotatedWithAngle270(void)
   screenOrientation = application.GetScene().GetCurrentScreenOrientation();
 
   // It should be changed.
-  DALI_TEST_EQUALS(orientation, 270, TEST_LOCATION);
-  DALI_TEST_EQUALS(screenOrientation, 270, TEST_LOCATION);
+  DALI_TEST_EQUALS(orientation, 0, TEST_LOCATION);
+  DALI_TEST_EQUALS(screenOrientation, 180, TEST_LOCATION);
 
   END_TEST;
 }
 
-int UtcDaliSceneSetRotationCompletedAcknowledgementWithAngle90(void)
+int UtcDaliSceneSurfaceAndScreenRotatedWithAngle180(void)
 {
-  tet_infoline("Ensure to acknowledge for completing surface 90 angle rotaiton");
+  tet_infoline("Ensure rotation of the surface and the screen is handled properly with Angle 180");
 
   TestApplication application(
     TestApplication::DEFAULT_SURFACE_WIDTH,
@@ -1463,6 +1620,8 @@ int UtcDaliSceneSetRotationCompletedAcknowledgementWithAngle90(void)
   application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
 
   DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION);
+
+  clippingRect = TestApplication::DEFAULT_SURFACE_RECT;
   application.RenderWithPartialUpdate(damagedRects, clippingRect);
 
   Actor actor = CreateRenderableActor();
@@ -1472,14 +1631,15 @@ int UtcDaliSceneSetRotationCompletedAcknowledgementWithAngle90(void)
   actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
   application.GetScene().Add(actor);
 
+  // consume the orientating changing flag by first rendering
   application.SendNotification();
 
   damagedRects.clear();
   application.GetScene().SurfaceRotated(TestApplication::DEFAULT_SURFACE_WIDTH,
                                         TestApplication::DEFAULT_SURFACE_HEIGHT,
-                                        90, 90);
+                                        180, 180);
 
-  // Check current surface orientation
+  // Check current orientations
   int32_t orientation = application.GetScene().GetCurrentSurfaceOrientation();
   int32_t screenOrientation = application.GetScene().GetCurrentScreenOrientation();
 
@@ -1487,7 +1647,75 @@ int UtcDaliSceneSetRotationCompletedAcknowledgementWithAngle90(void)
   DALI_TEST_EQUALS(orientation, 0, TEST_LOCATION);
   DALI_TEST_EQUALS(screenOrientation, 0, TEST_LOCATION);
 
-  application.GetScene().SetRotationCompletedAcknowledgement();
+  application.SendNotification();
+  application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+  DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
+
+  clippingRect = Rect<int>(CLIPPING_RECT_X, CLIPPING_RECT_Y, CLIPPING_RECT_WIDTH, CLIPPING_RECT_HEIGHT); // in screen coordinates, includes 3 last frames updates
+  DALI_TEST_EQUALS<Rect<int>>(clippingRect, damagedRects[0], TEST_LOCATION);
+  application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+  DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
+
+  // Check current orientations
+  orientation = application.GetScene().GetCurrentSurfaceOrientation();
+  screenOrientation = application.GetScene().GetCurrentScreenOrientation();
+
+  // It should be changed.
+  DALI_TEST_EQUALS(orientation, 180, TEST_LOCATION);
+  DALI_TEST_EQUALS(screenOrientation, 180, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliSceneSurfaceRotatedWithAngle270(void)
+{
+  tet_infoline("Ensure rotation of the surface is handled properly with Angle 270");
+
+  TestApplication application(
+    TestApplication::DEFAULT_SURFACE_WIDTH,
+    TestApplication::DEFAULT_SURFACE_HEIGHT,
+    TestApplication::DEFAULT_HORIZONTAL_DPI,
+    TestApplication::DEFAULT_VERTICAL_DPI,
+    true,
+    true);
+
+  const TestGlAbstraction::ScissorParams& glScissorParams(application.GetGlAbstraction().GetScissorParams());
+
+  std::vector<Rect<int>> damagedRects;
+  Rect<int>              clippingRect;
+  application.SendNotification();
+  application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+
+  DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION);
+
+  clippingRect = TestApplication::DEFAULT_SURFACE_RECT;
+  application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+  Actor actor = CreateRenderableActor();
+  actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+  actor.SetProperty(Actor::Property::POSITION, Vector3(16.0f, 16.0f, 0.0f));
+  actor.SetProperty(Actor::Property::SIZE, Vector3(16.0f, 16.0f, 0.0f));
+  actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
+  application.GetScene().Add(actor);
+
+  application.SendNotification();
+
+  damagedRects.clear();
+  application.GetScene().SurfaceRotated(TestApplication::DEFAULT_SURFACE_WIDTH,
+                                        TestApplication::DEFAULT_SURFACE_HEIGHT,
+                                        270, 0);
+
+  // Check current surface orientation
+  int32_t orientation = application.GetScene().GetCurrentSurfaceOrientation();
+  int32_t screenOrientation = application.GetScene().GetCurrentScreenOrientation();
+
+  // It should not be changed yet.
+  DALI_TEST_EQUALS(orientation, 0, TEST_LOCATION);
+  DALI_TEST_EQUALS(screenOrientation, 0, TEST_LOCATION);
 
   application.SendNotification();
   application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
@@ -1499,8 +1727,9 @@ int UtcDaliSceneSetRotationCompletedAcknowledgementWithAngle90(void)
 
   // It is recalculation for glScissor.
   // Because surface is rotated and glScissor is called with recalcurated value.
-  clippingRect.x      = TestApplication::DEFAULT_SURFACE_HEIGHT - (CLIPPING_RECT_Y + CLIPPING_RECT_HEIGHT);
-  clippingRect.y      = CLIPPING_RECT_X;
+  // Total angle is 270. (270 + 0 = 270)
+  clippingRect.x      = CLIPPING_RECT_Y;
+  clippingRect.y      = TestApplication::DEFAULT_SURFACE_WIDTH - (CLIPPING_RECT_X + CLIPPING_RECT_WIDTH);
   clippingRect.width  = CLIPPING_RECT_HEIGHT;
   clippingRect.height = CLIPPING_RECT_WIDTH;
 
@@ -1514,6 +1743,399 @@ int UtcDaliSceneSetRotationCompletedAcknowledgementWithAngle90(void)
   screenOrientation = application.GetScene().GetCurrentScreenOrientation();
 
   // It should be changed.
+  DALI_TEST_EQUALS(orientation, 270, TEST_LOCATION);
+  DALI_TEST_EQUALS(screenOrientation, 0, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliSceneScreenRotatedWithAngle270(void)
+{
+  tet_infoline("Ensure rotation of the screen is handled properly with Angle 270");
+
+  TestApplication application(
+    TestApplication::DEFAULT_SURFACE_WIDTH,
+    TestApplication::DEFAULT_SURFACE_HEIGHT,
+    TestApplication::DEFAULT_HORIZONTAL_DPI,
+    TestApplication::DEFAULT_VERTICAL_DPI,
+    true,
+    true);
+
+  const TestGlAbstraction::ScissorParams& glScissorParams(application.GetGlAbstraction().GetScissorParams());
+
+  std::vector<Rect<int>> damagedRects;
+  Rect<int>              clippingRect;
+  application.SendNotification();
+  application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+
+  DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION);
+
+  clippingRect = TestApplication::DEFAULT_SURFACE_RECT;
+  application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+  Actor actor = CreateRenderableActor();
+  actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+  actor.SetProperty(Actor::Property::POSITION, Vector3(16.0f, 16.0f, 0.0f));
+  actor.SetProperty(Actor::Property::SIZE, Vector3(16.0f, 16.0f, 0.0f));
+  actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
+  application.GetScene().Add(actor);
+
+  application.SendNotification();
+
+  damagedRects.clear();
+  application.GetScene().SurfaceRotated(TestApplication::DEFAULT_SURFACE_WIDTH,
+                                        TestApplication::DEFAULT_SURFACE_HEIGHT,
+                                        0, 270);
+
+  // Check current surface orientation
+  int32_t orientation = application.GetScene().GetCurrentSurfaceOrientation();
+  int32_t screenOrientation = application.GetScene().GetCurrentScreenOrientation();
+
+  // It should not be changed yet.
+  DALI_TEST_EQUALS(orientation, 0, TEST_LOCATION);
+  DALI_TEST_EQUALS(screenOrientation, 0, TEST_LOCATION);
+
+  application.SendNotification();
+  application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+  DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
+
+  clippingRect = Rect<int>(CLIPPING_RECT_X, CLIPPING_RECT_Y, CLIPPING_RECT_WIDTH, CLIPPING_RECT_HEIGHT); // in screen coordinates, includes 3 last frames updates
+  DALI_TEST_EQUALS<Rect<int>>(clippingRect, damagedRects[0], TEST_LOCATION);
+  application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+  // It is recalculation for glScissor.
+  // Because surface is rotated and glScissor is called with recalcurated value.
+  // Total angle is 270. (0 + 270 = 270)
+  clippingRect.x      = CLIPPING_RECT_Y;
+  clippingRect.y      = TestApplication::DEFAULT_SURFACE_WIDTH - (CLIPPING_RECT_X + CLIPPING_RECT_WIDTH);
+  clippingRect.width  = CLIPPING_RECT_HEIGHT;
+  clippingRect.height = CLIPPING_RECT_WIDTH;
+
+  DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
+
+  // Check current orientations
+  orientation = application.GetScene().GetCurrentSurfaceOrientation();
+  screenOrientation = application.GetScene().GetCurrentScreenOrientation();
+
+  // It should be changed.
+  DALI_TEST_EQUALS(orientation, 0, TEST_LOCATION);
+  DALI_TEST_EQUALS(screenOrientation, 270, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliSceneSurfaceAndScreenRotatedWithAngle270(void)
+{
+  tet_infoline("Ensure rotation of the surface and the screen is handled properly with Angle 270");
+
+  TestApplication application(
+    TestApplication::DEFAULT_SURFACE_WIDTH,
+    TestApplication::DEFAULT_SURFACE_HEIGHT,
+    TestApplication::DEFAULT_HORIZONTAL_DPI,
+    TestApplication::DEFAULT_VERTICAL_DPI,
+    true,
+    true);
+
+  const TestGlAbstraction::ScissorParams& glScissorParams(application.GetGlAbstraction().GetScissorParams());
+
+  std::vector<Rect<int>> damagedRects;
+  Rect<int>              clippingRect;
+  application.SendNotification();
+  application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+
+  DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION);
+
+  clippingRect = TestApplication::DEFAULT_SURFACE_RECT;
+  application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+  Actor actor = CreateRenderableActor();
+  actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+  actor.SetProperty(Actor::Property::POSITION, Vector3(16.0f, 16.0f, 0.0f));
+  actor.SetProperty(Actor::Property::SIZE, Vector3(16.0f, 16.0f, 0.0f));
+  actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
+  application.GetScene().Add(actor);
+
+  application.SendNotification();
+
+  damagedRects.clear();
+  application.GetScene().SurfaceRotated(TestApplication::DEFAULT_SURFACE_WIDTH,
+                                        TestApplication::DEFAULT_SURFACE_HEIGHT,
+                                        270, 270);
+
+  // Check current surface orientation
+  int32_t orientation = application.GetScene().GetCurrentSurfaceOrientation();
+  int32_t screenOrientation = application.GetScene().GetCurrentScreenOrientation();
+
+  // It should not be changed yet.
+  DALI_TEST_EQUALS(orientation, 0, TEST_LOCATION);
+  DALI_TEST_EQUALS(screenOrientation, 0, TEST_LOCATION);
+
+  application.SendNotification();
+  application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+  DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
+
+  clippingRect = Rect<int>(CLIPPING_RECT_X, CLIPPING_RECT_Y, CLIPPING_RECT_WIDTH, CLIPPING_RECT_HEIGHT); // in screen coordinates, includes 3 last frames updates
+  DALI_TEST_EQUALS<Rect<int>>(clippingRect, damagedRects[0], TEST_LOCATION);
+  application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+  // It is recalculation for glScissor.
+  // Because surface is rotated and glScissor is called with recalcurated value.
+  // Total angle is 180.(270 + 270 - 360 = 180)
+  clippingRect.x      = TestApplication::DEFAULT_SURFACE_WIDTH - (CLIPPING_RECT_X + CLIPPING_RECT_WIDTH);
+  clippingRect.y      = TestApplication::DEFAULT_SURFACE_HEIGHT - (CLIPPING_RECT_Y + CLIPPING_RECT_HEIGHT);
+  clippingRect.width  = CLIPPING_RECT_WIDTH;
+  clippingRect.height = CLIPPING_RECT_HEIGHT;
+
+  DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
+
+  // Check current orientations
+  orientation = application.GetScene().GetCurrentSurfaceOrientation();
+  screenOrientation = application.GetScene().GetCurrentScreenOrientation();
+
+  // It should be changed.
+  DALI_TEST_EQUALS(orientation, 270, TEST_LOCATION);
+  DALI_TEST_EQUALS(screenOrientation, 270, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliSceneSetSurfaceRotationCompletedAcknowledgementWithAngle90(void)
+{
+  tet_infoline("Ensure to acknowledge for completing surface 90 angle rotaiton");
+
+  TestApplication application(
+    TestApplication::DEFAULT_SURFACE_WIDTH,
+    TestApplication::DEFAULT_SURFACE_HEIGHT,
+    TestApplication::DEFAULT_HORIZONTAL_DPI,
+    TestApplication::DEFAULT_VERTICAL_DPI,
+    true,
+    true);
+
+  const TestGlAbstraction::ScissorParams& glScissorParams(application.GetGlAbstraction().GetScissorParams());
+
+  std::vector<Rect<int>> damagedRects;
+  Rect<int>              clippingRect;
+  application.SendNotification();
+  application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+
+  DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION);
+  application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+  Actor actor = CreateRenderableActor();
+  actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+  actor.SetProperty(Actor::Property::POSITION, Vector3(16.0f, 16.0f, 0.0f));
+  actor.SetProperty(Actor::Property::SIZE, Vector3(16.0f, 16.0f, 0.0f));
+  actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
+  application.GetScene().Add(actor);
+
+  application.SendNotification();
+
+  damagedRects.clear();
+  application.GetScene().SurfaceRotated(TestApplication::DEFAULT_SURFACE_WIDTH,
+                                        TestApplication::DEFAULT_SURFACE_HEIGHT,
+                                        90, 0);
+
+  // Check current surface orientation
+  int32_t orientation = application.GetScene().GetCurrentSurfaceOrientation();
+  int32_t screenOrientation = application.GetScene().GetCurrentScreenOrientation();
+
+  // It should not be changed yet.
+  DALI_TEST_EQUALS(orientation, 0, TEST_LOCATION);
+  DALI_TEST_EQUALS(screenOrientation, 0, TEST_LOCATION);
+
+  application.GetScene().SetRotationCompletedAcknowledgement();
+
+  application.SendNotification();
+  application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+  DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
+
+  clippingRect = Rect<int>(CLIPPING_RECT_X, CLIPPING_RECT_Y, CLIPPING_RECT_WIDTH, CLIPPING_RECT_HEIGHT); // in screen coordinates, includes 3 last frames updates
+  DALI_TEST_EQUALS<Rect<int>>(clippingRect, damagedRects[0], TEST_LOCATION);
+  application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+  // It is recalculation for glScissor.
+  // Because surface is rotated and glScissor is called with recalcurated value.
+  clippingRect.x      = TestApplication::DEFAULT_SURFACE_HEIGHT - (CLIPPING_RECT_Y + CLIPPING_RECT_HEIGHT);
+  clippingRect.y      = CLIPPING_RECT_X;
+  clippingRect.width  = CLIPPING_RECT_HEIGHT;
+  clippingRect.height = CLIPPING_RECT_WIDTH;
+
+  DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
+
+  // Check current orientations
+  orientation = application.GetScene().GetCurrentSurfaceOrientation();
+  screenOrientation = application.GetScene().GetCurrentScreenOrientation();
+
+  // It should be changed.
+  DALI_TEST_EQUALS(orientation, 90, TEST_LOCATION);
+  DALI_TEST_EQUALS(screenOrientation, 0, TEST_LOCATION);
+
+  bool isSetRotationCompletedAcknowledgementSet = application.GetScene().IsRotationCompletedAcknowledgementSet();
+  DALI_TEST_EQUALS(isSetRotationCompletedAcknowledgementSet, true, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliSceneSetScreenRotationCompletedAcknowledgementWithAngle90(void)
+{
+  tet_infoline("Ensure to acknowledge for completing screen 90 angle rotaiton");
+
+  TestApplication application(
+    TestApplication::DEFAULT_SURFACE_WIDTH,
+    TestApplication::DEFAULT_SURFACE_HEIGHT,
+    TestApplication::DEFAULT_HORIZONTAL_DPI,
+    TestApplication::DEFAULT_VERTICAL_DPI,
+    true,
+    true);
+
+  const TestGlAbstraction::ScissorParams& glScissorParams(application.GetGlAbstraction().GetScissorParams());
+
+  std::vector<Rect<int>> damagedRects;
+  Rect<int>              clippingRect;
+  application.SendNotification();
+  application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+
+  DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION);
+  application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+  Actor actor = CreateRenderableActor();
+  actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+  actor.SetProperty(Actor::Property::POSITION, Vector3(16.0f, 16.0f, 0.0f));
+  actor.SetProperty(Actor::Property::SIZE, Vector3(16.0f, 16.0f, 0.0f));
+  actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
+  application.GetScene().Add(actor);
+
+  application.SendNotification();
+
+  damagedRects.clear();
+  application.GetScene().SurfaceRotated(TestApplication::DEFAULT_SURFACE_WIDTH,
+                                        TestApplication::DEFAULT_SURFACE_HEIGHT,
+                                        0, 90);
+
+  // Check current surface orientation
+  int32_t orientation = application.GetScene().GetCurrentSurfaceOrientation();
+  int32_t screenOrientation = application.GetScene().GetCurrentScreenOrientation();
+
+  // It should not be changed yet.
+  DALI_TEST_EQUALS(orientation, 0, TEST_LOCATION);
+  DALI_TEST_EQUALS(screenOrientation, 0, TEST_LOCATION);
+
+  application.GetScene().SetRotationCompletedAcknowledgement();
+
+  application.SendNotification();
+  application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+  DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
+
+  clippingRect = Rect<int>(CLIPPING_RECT_X, CLIPPING_RECT_Y, CLIPPING_RECT_WIDTH, CLIPPING_RECT_HEIGHT); // in screen coordinates, includes 3 last frames updates
+  DALI_TEST_EQUALS<Rect<int>>(clippingRect, damagedRects[0], TEST_LOCATION);
+  application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+  // It is recalculation for glScissor.
+  // Because surface is rotated and glScissor is called with recalcurated value.
+  clippingRect.x      = TestApplication::DEFAULT_SURFACE_HEIGHT - (CLIPPING_RECT_Y + CLIPPING_RECT_HEIGHT);
+  clippingRect.y      = CLIPPING_RECT_X;
+  clippingRect.width  = CLIPPING_RECT_HEIGHT;
+  clippingRect.height = CLIPPING_RECT_WIDTH;
+
+  DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
+
+  // Check current orientations
+  orientation = application.GetScene().GetCurrentSurfaceOrientation();
+  screenOrientation = application.GetScene().GetCurrentScreenOrientation();
+
+  // It should be changed.
+  DALI_TEST_EQUALS(orientation, 0, TEST_LOCATION);
+  DALI_TEST_EQUALS(screenOrientation, 90, TEST_LOCATION);
+
+  bool isSetRotationCompletedAcknowledgementSet = application.GetScene().IsRotationCompletedAcknowledgementSet();
+  DALI_TEST_EQUALS(isSetRotationCompletedAcknowledgementSet, true, TEST_LOCATION);
+
+  END_TEST;
+}
+
+int UtcDaliSceneSetSurfaceAndScreenRotationCompletedAcknowledgementWithAngle90(void)
+{
+  tet_infoline("Ensure to acknowledge for completing surface and screen 90 angle rotaiton");
+
+  TestApplication application(
+    TestApplication::DEFAULT_SURFACE_WIDTH,
+    TestApplication::DEFAULT_SURFACE_HEIGHT,
+    TestApplication::DEFAULT_HORIZONTAL_DPI,
+    TestApplication::DEFAULT_VERTICAL_DPI,
+    true,
+    true);
+
+  const TestGlAbstraction::ScissorParams& glScissorParams(application.GetGlAbstraction().GetScissorParams());
+
+  std::vector<Rect<int>> damagedRects;
+  Rect<int>              clippingRect;
+  application.SendNotification();
+  application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+
+  DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION);
+  application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+  Actor actor = CreateRenderableActor();
+  actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+  actor.SetProperty(Actor::Property::POSITION, Vector3(16.0f, 16.0f, 0.0f));
+  actor.SetProperty(Actor::Property::SIZE, Vector3(16.0f, 16.0f, 0.0f));
+  actor.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS);
+  application.GetScene().Add(actor);
+
+  application.SendNotification();
+
+  damagedRects.clear();
+  application.GetScene().SurfaceRotated(TestApplication::DEFAULT_SURFACE_WIDTH,
+                                        TestApplication::DEFAULT_SURFACE_HEIGHT,
+                                        90, 90);
+
+  // Check current surface orientation
+  int32_t orientation = application.GetScene().GetCurrentSurfaceOrientation();
+  int32_t screenOrientation = application.GetScene().GetCurrentScreenOrientation();
+
+  // It should not be changed yet.
+  DALI_TEST_EQUALS(orientation, 0, TEST_LOCATION);
+  DALI_TEST_EQUALS(screenOrientation, 0, TEST_LOCATION);
+
+  application.GetScene().SetRotationCompletedAcknowledgement();
+
+  application.SendNotification();
+  application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+  DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
+
+  clippingRect = Rect<int>(CLIPPING_RECT_X, CLIPPING_RECT_Y, CLIPPING_RECT_WIDTH, CLIPPING_RECT_HEIGHT); // in screen coordinates, includes 3 last frames updates
+  DALI_TEST_EQUALS<Rect<int>>(clippingRect, damagedRects[0], TEST_LOCATION);
+  application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+  // It is recalculation for glScissor.
+  // Because surface is rotated and glScissor is called with recalcurated value.
+  clippingRect.x      = TestApplication::DEFAULT_SURFACE_WIDTH - (CLIPPING_RECT_X + CLIPPING_RECT_WIDTH);
+  clippingRect.y      = TestApplication::DEFAULT_SURFACE_HEIGHT - (CLIPPING_RECT_Y + CLIPPING_RECT_HEIGHT);
+  clippingRect.width  = CLIPPING_RECT_WIDTH;
+  clippingRect.height = CLIPPING_RECT_HEIGHT;
+
+  DALI_TEST_EQUALS(clippingRect.x, glScissorParams.x, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.y, glScissorParams.y, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.width, glScissorParams.width, TEST_LOCATION);
+  DALI_TEST_EQUALS(clippingRect.height, glScissorParams.height, TEST_LOCATION);
+
+  // Check current orientations
+  orientation = application.GetScene().GetCurrentSurfaceOrientation();
+  screenOrientation = application.GetScene().GetCurrentScreenOrientation();
+
+  // It should be changed.
   DALI_TEST_EQUALS(orientation, 90, TEST_LOCATION);
   DALI_TEST_EQUALS(screenOrientation, 90, TEST_LOCATION);
 
index 28b8a6c..a5cea80 100644 (file)
@@ -375,7 +375,7 @@ void Core::RunProcessors()
 {
   if(mProcessors.Count() != 0)
   {
-    DALI_TRACE_BEGIN(gTraceFilter, "DALI_CORE_RUN_PROCESSORS");
+    DALI_TRACE_SCOPE(gTraceFilter, "DALI_CORE_RUN_PROCESSORS");
 
     // Copy processor pointers to prevent changes to vector affecting loop iterator.
     Dali::Vector<Integration::Processor*> processors(mProcessors);
@@ -403,7 +403,6 @@ void Core::RunProcessors()
         }
       }
     }
-    DALI_TRACE_END(gTraceFilter, "DALI_CORE_RUN_PROCESSORS");
   }
 }
 
@@ -411,7 +410,7 @@ void Core::RunPostProcessors()
 {
   if(mPostProcessors.Count() != 0)
   {
-    DALI_TRACE_BEGIN(gTraceFilter, "DALI_CORE_RUN_POST_PROCESSORS");
+    DALI_TRACE_SCOPE(gTraceFilter, "DALI_CORE_RUN_POST_PROCESSORS");
 
     // Copy processor pointers to prevent changes to vector affecting loop iterator.
     Dali::Vector<Integration::Processor*> processors(mPostProcessors);
@@ -439,7 +438,6 @@ void Core::RunPostProcessors()
         }
       }
     }
-    DALI_TRACE_END(gTraceFilter, "DALI_CORE_RUN_POST_PROCESSORS");
   }
 }
 
index 696232d..5f55abe 100644 (file)
@@ -221,7 +221,7 @@ float ActorSizer::Relayouter::GetMaximumSize(Dimension::Type dimension) const
   return FLT_MAX; // Default
 }
 
-void ActorSizer::Relayouter::SetResizePolicy(ResizePolicy::Type policy, Dimension::Type dimension, Vector3& targetSize)
+void ActorSizer::Relayouter::SetResizePolicy(ResizePolicy::Type policy, Dimension::Type dimension, Vector3& targetSize, bool& targetSizeDirtyFlag)
 {
   ResizePolicy::Type originalWidthPolicy  = GetResizePolicy(Dimension::WIDTH);
   ResizePolicy::Type originalHeightPolicy = GetResizePolicy(Dimension::HEIGHT);
@@ -271,6 +271,7 @@ void ActorSizer::Relayouter::SetResizePolicy(ResizePolicy::Type policy, Dimensio
     else if(originalWidthPolicy == ResizePolicy::FIXED && policy != ResizePolicy::FIXED)
     {
       targetSize.width = preferredSize.width;
+      targetSizeDirtyFlag = true;
     }
   }
 
@@ -283,6 +284,7 @@ void ActorSizer::Relayouter::SetResizePolicy(ResizePolicy::Type policy, Dimensio
     else if(originalHeightPolicy == ResizePolicy::FIXED && policy != ResizePolicy::FIXED)
     {
       targetSize.height = preferredSize.height;
+      targetSizeDirtyFlag = true;
     }
   }
 }
index 73b1f55..716120b 100644 (file)
@@ -70,7 +70,7 @@ struct ActorSizer::Relayouter
   float GetMaximumSize(Dimension::Type dimension) const;
 
   /// @copydoc Actor::SetResizePolicy
-  void SetResizePolicy(ResizePolicy::Type policy, Dimension::Type dimension, Vector3& targetSize);
+  void SetResizePolicy(ResizePolicy::Type policy, Dimension::Type dimension, Vector3& targetSize, bool& targetSizeDirtyFlag);
 
   /// @copydoc Actor::GetRelayoutDependentOnDimension
   bool GetRelayoutDependentOnDimension(Dimension::Type dimension, Dimension::Type dependency);
index 81e3f4d..93c5216 100644 (file)
@@ -78,6 +78,7 @@ ActorSizer::ActorSizer(Internal::Actor& owner)
   mTargetSize(Vector3::ZERO),
   mAnimatedSize(Vector3::ZERO),
   mUseAnimatedSize(AnimatedSizeFlag::CLEAR),
+  mTargetSizeDirtyFlag(false),
   mInsideOnSizeSet(false)
 {
 }
@@ -117,8 +118,9 @@ void ActorSizer::SetSizeInternal(const Vector3& size)
   // dont allow recursive loop
   DALI_ASSERT_ALWAYS(!mInsideOnSizeSet && "Cannot call SetSize from OnSizeSet");
   // check that we have a node AND the new size width, height or depth is at least a little bit different from the old one
-  if(mTargetSize != size || mTargetSize != mOwner.GetCurrentSize())
+  if(mTargetSize != size || mTargetSizeDirtyFlag)
   {
+    mTargetSizeDirtyFlag = false;
     mTargetSize = size;
 
     // Update the preferred size after relayoutting
@@ -241,7 +243,7 @@ Vector3 ActorSizer::GetTargetSize() const
 
 void ActorSizer::SetResizePolicy(ResizePolicy::Type policy, Dimension::Type dimension)
 {
-  EnsureRelayouter().SetResizePolicy(policy, dimension, mTargetSize);
+  EnsureRelayouter().SetResizePolicy(policy, dimension, mTargetSize, mTargetSizeDirtyFlag);
   mOwner.OnSetResizePolicy(policy, dimension);
   RelayoutRequest();
 }
index 2149694..27ea3f7 100644 (file)
@@ -355,11 +355,12 @@ private:
   Vector2 GetPreferredSize() const;
 
 private:
-  Internal::Actor& mOwner;           // Owner of this actor sizer
-  Relayouter*      mRelayoutData;    ///< Struct to hold optional collection of relayout variables
-  Dali::Vector3    mTargetSize;      ///< Event-side storage for size (not a pointer as most actors will have a size)
-  Dali::Vector3    mAnimatedSize;    ///< Event-side storage for size animation
-  uint16_t         mUseAnimatedSize; ///< Whether the size is animated.
+  Internal::Actor& mOwner;               // Owner of this actor sizer
+  Relayouter*      mRelayoutData;        ///< Struct to hold optional collection of relayout variables
+  Dali::Vector3    mTargetSize;          ///< Event-side storage for size (not a pointer as most actors will have a size)
+  Dali::Vector3    mAnimatedSize;        ///< Event-side storage for size animation
+  uint16_t         mUseAnimatedSize;     ///< Whether the size is animated.
+  bool             mTargetSizeDirtyFlag; ///< Whether the target size is dirty or not.
   bool             mInsideOnSizeSet : 1;
 };
 
index 828586a..d20ec05 100644 (file)
@@ -170,12 +170,11 @@ void NotificationManager::ProcessMessages()
   const MessageContainer::Iterator end  = mImpl->eventMessageQueue.End();
   if(iter != end)
   {
-    DALI_TRACE_BEGIN(gTraceFilter, "DALI_NOTIFICATION_PROCESS_MESSAGE");
+    DALI_TRACE_SCOPE(gTraceFilter, "DALI_NOTIFICATION_PROCESS_MESSAGE");
     for(; iter != end; ++iter)
     {
       (*iter)->Process(0u /*ignored*/);
     }
-    DALI_TRACE_END(gTraceFilter, "DALI_NOTIFICATION_PROCESS_MESSAGE");
   }
   // release the processed messages from event side queue
   mImpl->eventMessageQueue.Clear();
@@ -184,7 +183,7 @@ void NotificationManager::ProcessMessages()
   const InterfaceContainer::Iterator end2  = mImpl->eventInterfaceQueue.End();
   if(iter2 != end2)
   {
-    DALI_TRACE_BEGIN(gTraceFilter, "DALI_NOTIFICATION_NOTIFY_COMPLETED");
+    DALI_TRACE_SCOPE(gTraceFilter, "DALI_NOTIFICATION_NOTIFY_COMPLETED");
     for(; iter2 != end2; ++iter2)
     {
       CompleteNotificationInterface* interface = *iter2;
@@ -193,7 +192,6 @@ void NotificationManager::ProcessMessages()
         interface->NotifyCompleted();
       }
     }
-    DALI_TRACE_END(gTraceFilter, "DALI_NOTIFICATION_NOTIFY_COMPLETED");
   }
   // just clear the container, we dont own the objects
   mImpl->eventInterfaceQueue.Clear();
index 648bf97..2d87787 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -207,8 +207,10 @@ void PropertyNotification::CreateSceneObject()
   // this method can be called from constructor and on stage connection
   if(!mPropertyNotification)
   {
+    const PropertyInputImpl* property = mObject->GetSceneObjectInputProperty(mObjectPropertyIndex);
+
     // Create a new PropertyNotification, keep a const pointer to it
-    mPropertyNotification = SceneGraph::PropertyNotification::New(*mObject,
+    mPropertyNotification = SceneGraph::PropertyNotification::New(property,
                                                                   mObjectPropertyIndex,
                                                                   mPropertyType,
                                                                   mComponentIndex,
index 4b6ef61..60fee2e 100644 (file)
@@ -46,14 +46,7 @@ void KeyEventProcessor::ProcessKeyEvent(const Integration::KeyEvent& event)
   KeyEventPtr    keyEvent(new KeyEvent(event.keyName, event.logicalKey, event.keyString, event.keyCode, event.keyModifier, event.time, static_cast<Dali::KeyEvent::State>(event.state), event.compose, event.deviceName, event.deviceClass, event.deviceSubclass));
   Dali::KeyEvent keyEventHandle(keyEvent.Get());
 
-#ifdef TRACE_ENABLED
-  std::ostringstream stream;
-  if(gTraceFilter->IsTraceEnabled())
-  {
-    stream << "DALI_PROCESS_KEY_EVENT [" << event.keyName << ", " << event.state << "]";
-    DALI_TRACE_BEGIN(gTraceFilter, stream.str().c_str());
-  }
-#endif
+  DALI_TRACE_SCOPE(gTraceFilter, "DALI_PROCESS_KEY_EVENT");
 
   // Emit the key event signal from the scene.
   bool consumed = mScene.EmitInterceptKeyEventSignal(keyEventHandle);
@@ -65,13 +58,6 @@ void KeyEventProcessor::ProcessKeyEvent(const Integration::KeyEvent& event)
   {
     mScene.EmitKeyEventSignal(keyEventHandle);
   }
-
-#ifdef TRACE_ENABLED
-  if(gTraceFilter->IsTraceEnabled())
-  {
-    DALI_TRACE_END(gTraceFilter, stream.str().c_str());
-  }
-#endif
 }
 
 } // namespace Internal
index 2bf82f1..b6fc151 100644 (file)
@@ -76,12 +76,12 @@ DecoratedVisualRendererPtr DecoratedVisualRenderer::New()
   // create scene object first so it's guaranteed to exist for the event side
   auto sceneObject = SceneGraph::Renderer::New();
 
-  auto animatableVisualProperties          = new AnimatableVisualProperties();
-  auto animatableDecoratedVisualProperties = new AnimatableDecoratedVisualProperties();
+  auto animatableVisualProperties          = new SceneGraph::VisualRenderer::AnimatableVisualProperties();
+  auto animatableDecoratedVisualProperties = new SceneGraph::VisualRenderer::AnimatableDecoratedVisualProperties();
 
   // Append extended properties as AnimatableDecoratedVisualProperties.
   animatableVisualProperties->mExtendedProperties               = animatableDecoratedVisualProperties;
-  animatableVisualProperties->mExtendedPropertiesDeleteFunction = AnimatableDecoratedVisualProperties::DeleteFunction;
+  animatableVisualProperties->mExtendedPropertiesDeleteFunction = SceneGraph::VisualRenderer::AnimatableDecoratedVisualProperties::DeleteFunction;
 
   sceneObject->SetVisualProperties(animatableVisualProperties);
 
@@ -118,12 +118,12 @@ void DecoratedVisualRenderer::SetDefaultProperty(Property::Index        index,
   }
   else
   {
-    const SceneGraph::Renderer& sceneObject = GetVisualRendererSceneObject();
-    auto visualProperties = sceneObject.GetVisualProperties();
+    const SceneGraph::Renderer& sceneObject      = GetVisualRendererSceneObject();
+    auto                        visualProperties = sceneObject.GetVisualProperties();
 
     if(visualProperties)
     {
-      auto decoratedVisualProperties = static_cast<AnimatableDecoratedVisualProperties*>(visualProperties->mExtendedProperties);
+      auto decoratedVisualProperties = static_cast<SceneGraph::VisualRenderer::AnimatableDecoratedVisualProperties*>(visualProperties->mExtendedProperties);
 
       if(decoratedVisualProperties)
       {
@@ -151,19 +151,19 @@ void DecoratedVisualRenderer::SetDefaultProperty(Property::Index        index,
 
           case Dali::DecoratedVisualRenderer::Property::BORDERLINE_COLOR:
           {
-            SetValue(eventThreadServices, propertyValue,mDecoratedPropertyCache.mBorderlineColor, decoratedVisualProperties->mBorderlineColor);
+            SetValue(eventThreadServices, propertyValue, mDecoratedPropertyCache.mBorderlineColor, decoratedVisualProperties->mBorderlineColor);
             break;
           }
 
           case Dali::DecoratedVisualRenderer::Property::BORDERLINE_OFFSET:
           {
-            SetValue(eventThreadServices, propertyValue,mDecoratedPropertyCache.mBorderlineOffset, decoratedVisualProperties->mBorderlineOffset);
+            SetValue(eventThreadServices, propertyValue, mDecoratedPropertyCache.mBorderlineOffset, decoratedVisualProperties->mBorderlineOffset);
             break;
           }
 
           case Dali::DecoratedVisualRenderer::Property::BLUR_RADIUS:
           {
-            SetValue(eventThreadServices, propertyValue,mDecoratedPropertyCache.mBlurRadius, decoratedVisualProperties->mBlurRadius);
+            SetValue(eventThreadServices, propertyValue, mDecoratedPropertyCache.mBlurRadius, decoratedVisualProperties->mBlurRadius);
             break;
           }
         }
@@ -243,7 +243,7 @@ Property::Value DecoratedVisualRenderer::GetDefaultPropertyCurrentValue(Property
         auto visualProperties = sceneObject.GetVisualProperties();
         if(visualProperties)
         {
-          auto decoratedVisualProperties = static_cast<AnimatableDecoratedVisualProperties*>(visualProperties->mExtendedProperties);
+          auto decoratedVisualProperties = static_cast<SceneGraph::VisualRenderer::AnimatableDecoratedVisualProperties*>(visualProperties->mExtendedProperties);
           if(decoratedVisualProperties)
           {
             value = decoratedVisualProperties->mCornerRadius[GetEventThreadServices().GetEventBufferIndex()];
@@ -256,7 +256,7 @@ Property::Value DecoratedVisualRenderer::GetDefaultPropertyCurrentValue(Property
         auto visualProperties = sceneObject.GetVisualProperties();
         if(visualProperties)
         {
-          auto decoratedVisualProperties = static_cast<AnimatableDecoratedVisualProperties*>(visualProperties->mExtendedProperties);
+          auto decoratedVisualProperties = static_cast<SceneGraph::VisualRenderer::AnimatableDecoratedVisualProperties*>(visualProperties->mExtendedProperties);
           if(decoratedVisualProperties)
           {
             value = decoratedVisualProperties->mCornerRadiusPolicy[GetEventThreadServices().GetEventBufferIndex()];
@@ -269,7 +269,7 @@ Property::Value DecoratedVisualRenderer::GetDefaultPropertyCurrentValue(Property
         auto visualProperties = sceneObject.GetVisualProperties();
         if(visualProperties)
         {
-          auto decoratedVisualProperties = static_cast<AnimatableDecoratedVisualProperties*>(visualProperties->mExtendedProperties);
+          auto decoratedVisualProperties = static_cast<SceneGraph::VisualRenderer::AnimatableDecoratedVisualProperties*>(visualProperties->mExtendedProperties);
           if(decoratedVisualProperties)
           {
             value = decoratedVisualProperties->mBorderlineWidth[GetEventThreadServices().GetEventBufferIndex()];
@@ -282,7 +282,7 @@ Property::Value DecoratedVisualRenderer::GetDefaultPropertyCurrentValue(Property
         auto visualProperties = sceneObject.GetVisualProperties();
         if(visualProperties)
         {
-          auto decoratedVisualProperties = static_cast<AnimatableDecoratedVisualProperties*>(visualProperties->mExtendedProperties);
+          auto decoratedVisualProperties = static_cast<SceneGraph::VisualRenderer::AnimatableDecoratedVisualProperties*>(visualProperties->mExtendedProperties);
           if(decoratedVisualProperties)
           {
             value = decoratedVisualProperties->mBorderlineColor[GetEventThreadServices().GetEventBufferIndex()];
@@ -295,7 +295,7 @@ Property::Value DecoratedVisualRenderer::GetDefaultPropertyCurrentValue(Property
         auto visualProperties = sceneObject.GetVisualProperties();
         if(visualProperties)
         {
-          auto decoratedVisualProperties = static_cast<AnimatableDecoratedVisualProperties*>(visualProperties->mExtendedProperties);
+          auto decoratedVisualProperties = static_cast<SceneGraph::VisualRenderer::AnimatableDecoratedVisualProperties*>(visualProperties->mExtendedProperties);
           if(decoratedVisualProperties)
           {
             value = decoratedVisualProperties->mBorderlineOffset[GetEventThreadServices().GetEventBufferIndex()];
@@ -308,7 +308,7 @@ Property::Value DecoratedVisualRenderer::GetDefaultPropertyCurrentValue(Property
         auto visualProperties = sceneObject.GetVisualProperties();
         if(visualProperties)
         {
-          auto decoratedVisualProperties = static_cast<AnimatableDecoratedVisualProperties*>(visualProperties->mExtendedProperties);
+          auto decoratedVisualProperties = static_cast<SceneGraph::VisualRenderer::AnimatableDecoratedVisualProperties*>(visualProperties->mExtendedProperties);
           if(decoratedVisualProperties)
           {
             value = decoratedVisualProperties->mBlurRadius[GetEventThreadServices().GetEventBufferIndex()];
@@ -412,7 +412,7 @@ const SceneGraph::PropertyBase* DecoratedVisualRenderer::GetSceneObjectAnimatabl
       auto visualProperties = GetVisualRendererSceneObject().GetVisualProperties();
       if(visualProperties)
       {
-        auto decoratedVisualProperties = static_cast<AnimatableDecoratedVisualProperties*>(visualProperties->mExtendedProperties);
+        auto decoratedVisualProperties = static_cast<SceneGraph::VisualRenderer::AnimatableDecoratedVisualProperties*>(visualProperties->mExtendedProperties);
         if(decoratedVisualProperties)
         {
           property = &decoratedVisualProperties->mCornerRadius;
@@ -425,7 +425,7 @@ const SceneGraph::PropertyBase* DecoratedVisualRenderer::GetSceneObjectAnimatabl
       auto visualProperties = GetVisualRendererSceneObject().GetVisualProperties();
       if(visualProperties)
       {
-        auto decoratedVisualProperties = static_cast<AnimatableDecoratedVisualProperties*>(visualProperties->mExtendedProperties);
+        auto decoratedVisualProperties = static_cast<SceneGraph::VisualRenderer::AnimatableDecoratedVisualProperties*>(visualProperties->mExtendedProperties);
         if(decoratedVisualProperties)
         {
           property = &decoratedVisualProperties->mBorderlineWidth;
@@ -438,7 +438,7 @@ const SceneGraph::PropertyBase* DecoratedVisualRenderer::GetSceneObjectAnimatabl
       auto visualProperties = GetVisualRendererSceneObject().GetVisualProperties();
       if(visualProperties)
       {
-        auto decoratedVisualProperties = static_cast<AnimatableDecoratedVisualProperties*>(visualProperties->mExtendedProperties);
+        auto decoratedVisualProperties = static_cast<SceneGraph::VisualRenderer::AnimatableDecoratedVisualProperties*>(visualProperties->mExtendedProperties);
         if(decoratedVisualProperties)
         {
           property = &decoratedVisualProperties->mBorderlineColor;
@@ -451,7 +451,7 @@ const SceneGraph::PropertyBase* DecoratedVisualRenderer::GetSceneObjectAnimatabl
       auto visualProperties = GetVisualRendererSceneObject().GetVisualProperties();
       if(visualProperties)
       {
-        auto decoratedVisualProperties = static_cast<AnimatableDecoratedVisualProperties*>(visualProperties->mExtendedProperties);
+        auto decoratedVisualProperties = static_cast<SceneGraph::VisualRenderer::AnimatableDecoratedVisualProperties*>(visualProperties->mExtendedProperties);
         if(decoratedVisualProperties)
         {
           property = &decoratedVisualProperties->mBorderlineOffset;
@@ -464,7 +464,7 @@ const SceneGraph::PropertyBase* DecoratedVisualRenderer::GetSceneObjectAnimatabl
       auto visualProperties = GetVisualRendererSceneObject().GetVisualProperties();
       if(visualProperties)
       {
-        auto decoratedVisualProperties = static_cast<AnimatableDecoratedVisualProperties*>(visualProperties->mExtendedProperties);
+        auto decoratedVisualProperties = static_cast<SceneGraph::VisualRenderer::AnimatableDecoratedVisualProperties*>(visualProperties->mExtendedProperties);
         if(decoratedVisualProperties)
         {
           property = &decoratedVisualProperties->mBlurRadius;
@@ -496,7 +496,7 @@ const PropertyInputImpl* DecoratedVisualRenderer::GetSceneObjectInputProperty(Pr
       auto visualProperties = GetVisualRendererSceneObject().GetVisualProperties();
       if(visualProperties)
       {
-        auto decoratedVisualProperties = static_cast<AnimatableDecoratedVisualProperties*>(visualProperties->mExtendedProperties);
+        auto decoratedVisualProperties = static_cast<SceneGraph::VisualRenderer::AnimatableDecoratedVisualProperties*>(visualProperties->mExtendedProperties);
         if(decoratedVisualProperties)
         {
           return &decoratedVisualProperties->mCornerRadiusPolicy;
index b8405fe..a69cdd1 100644 (file)
@@ -145,43 +145,6 @@ public:
     float   mBlurRadius{0.0f};
   };
 
-  struct AnimatableDecoratedVisualProperties
-  {
-    AnimatableDecoratedVisualProperties()
-    : mCornerRadius(Vector4::ZERO),
-      mCornerRadiusPolicy(1.0f),
-      mBorderlineWidth(0.0f),
-      mBorderlineColor(Color::BLACK),
-      mBorderlineOffset(0.0f),
-      mBlurRadius(0.0f),
-      mExtendedPropertiesDeleteFunction(nullptr)
-    {
-    }
-    ~AnimatableDecoratedVisualProperties()
-    {
-      if(mExtendedProperties && mExtendedPropertiesDeleteFunction)
-      {
-        mExtendedPropertiesDeleteFunction(mExtendedProperties);
-      }
-    }
-
-    // Delete function of AnimatableDecoratedVisualProperties* converted as void*
-    constexpr static void DeleteFunction(void* data)
-    {
-      delete static_cast<AnimatableDecoratedVisualProperties*>(data);
-    }
-
-    SceneGraph::AnimatableProperty<Vector4> mCornerRadius;
-    SceneGraph::AnimatableProperty<float>   mCornerRadiusPolicy;
-    SceneGraph::AnimatableProperty<float>   mBorderlineWidth;
-    SceneGraph::AnimatableProperty<Vector4> mBorderlineColor;
-    SceneGraph::AnimatableProperty<float>   mBorderlineOffset;
-    SceneGraph::AnimatableProperty<float>   mBlurRadius;
-
-    void* mExtendedProperties{nullptr};                        // Enable derived class to extend properties further
-    void (*mExtendedPropertiesDeleteFunction)(void*){nullptr}; // Derived class's custom delete functor
-  };
-
 private:
   DecoratedVisualPropertyCache mDecoratedPropertyCache;
 
index b7a758c..a359d81 100644 (file)
@@ -68,7 +68,7 @@ VisualRendererPtr VisualRenderer::New()
   // create scene object first so it's guaranteed to exist for the event side
   auto sceneObject = SceneGraph::Renderer::New();
 
-  sceneObject->SetVisualProperties(new AnimatableVisualProperties());
+  sceneObject->SetVisualProperties(new SceneGraph::VisualRenderer::AnimatableVisualProperties());
 
   OwnerPointer<SceneGraph::Renderer> transferOwnership(sceneObject);
   // pass the pointer to base for message passing
index b7af4d7..933c6bd 100644 (file)
@@ -20,8 +20,7 @@
 
 // INTERNAL INCLUDES
 #include <dali/internal/event/rendering/renderer-impl.h> // Dali::Internal::Renderer
-#include <dali/internal/update/common/animatable-property.h>
-#include <dali/public-api/rendering/visual-renderer.h> // Dali::VisualRenderer
+#include <dali/public-api/rendering/visual-renderer.h>   // Dali::VisualRenderer
 
 namespace Dali
 {
@@ -129,42 +128,6 @@ public:
     float   mPreMultipliedAlpha{0.0f};
   };
 
-  struct AnimatableVisualProperties
-  {
-    AnimatableVisualProperties()
-    : mTransformOffset(Vector2::ZERO),
-      mTransformSize(Vector2::ONE),
-      mTransformOrigin(Vector2::ZERO),
-      mTransformAnchorPoint(Vector2::ZERO),
-      mTransformOffsetSizeMode(Vector4::ZERO),
-      mExtraSize(Vector2::ZERO),
-      mMixColor(Vector3::ONE),
-      mPreMultipliedAlpha(0.0f),
-      mExtendedPropertiesDeleteFunction(nullptr)
-    {
-    }
-
-    ~AnimatableVisualProperties()
-    {
-      if(mExtendedProperties && mExtendedPropertiesDeleteFunction)
-      {
-        mExtendedPropertiesDeleteFunction(mExtendedProperties);
-      }
-    }
-
-    SceneGraph::AnimatableProperty<Vector2> mTransformOffset;
-    SceneGraph::AnimatableProperty<Vector2> mTransformSize;
-    SceneGraph::AnimatableProperty<Vector2> mTransformOrigin;
-    SceneGraph::AnimatableProperty<Vector2> mTransformAnchorPoint;
-    SceneGraph::AnimatableProperty<Vector4> mTransformOffsetSizeMode;
-    SceneGraph::AnimatableProperty<Vector2> mExtraSize;
-    SceneGraph::AnimatableProperty<Vector3> mMixColor;
-    SceneGraph::AnimatableProperty<float>   mPreMultipliedAlpha;
-
-    void* mExtendedProperties{nullptr};                        // Enable derived class to extend properties further
-    void (*mExtendedPropertiesDeleteFunction)(void*){nullptr}; // Derived class's custom delete functor
-  };
-
 private:
   VisualPropertyCache mPropertyCache;
 };
index dd0f98d..c32cebe 100644 (file)
@@ -439,7 +439,7 @@ void RelayoutController::Relayout()
     // 2. Iterate through the stack until it's empty.
     if(mRelayoutStack->Size() > 0)
     {
-      DALI_TRACE_BEGIN(gTraceFilter, "DALI_RELAYOUT");
+      DALI_TRACE_SCOPE(gTraceFilter, "DALI_RELAYOUT");
       PRINT_HIERARCHY;
 
       while(mRelayoutStack->Size() > 0)
@@ -464,7 +464,6 @@ void RelayoutController::Relayout()
       mRelayoutInfoAllocator.ResetMemoryPool();
 
       PRINT_HIERARCHY;
-      DALI_TRACE_END(gTraceFilter, "DALI_RELAYOUT");
     }
 
     mPerformingRelayout = false;
index fac9fbe..d5ba85d 100644 (file)
@@ -24,6 +24,7 @@
 #include <dali/internal/render/common/render-list.h>
 #include <dali/internal/render/renderers/render-renderer.h>
 #include <dali/internal/update/nodes/scene-graph-layer.h>
+#include <dali/public-api/math/uint-16-pair.h>
 
 using Dali::Internal::SceneGraph::RenderInstruction;
 using Dali::Internal::SceneGraph::RenderItem;
index fff4fe8..ba07eac 100644 (file)
@@ -777,7 +777,11 @@ void RenderManager::RenderScene(Integration::RenderStatus& status, Integration::
 
     Rect<int32_t> viewportRect;
 
-    int32_t surfaceOrientation = sceneObject->GetSurfaceOrientation();
+    int32_t surfaceOrientation = sceneObject->GetSurfaceOrientation() + sceneObject->GetScreenOrientation();
+    if(surfaceOrientation >= 360)
+    {
+      surfaceOrientation -= 360;
+    }
 
     // @todo Should these be part of scene?
     Integration::DepthBufferAvailable   depthBufferAvailable   = mImpl->depthBufferAvailable;
index ff4ff43..6fecc5e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -30,30 +30,29 @@ namespace Internal
 {
 namespace SceneGraph
 {
-PropertyNotification* PropertyNotification::New(Object&               object,
-                                                Property::Index       propertyIndex,
-                                                Property::Type        propertyType,
-                                                int                   componentIndex,
-                                                ConditionType         condition,
-                                                RawArgumentContainer& arguments,
-                                                NotifyMode            notifyMode,
-                                                bool                  compare)
+PropertyNotification* PropertyNotification::New(const PropertyInputImpl* property,
+                                                Property::Index          propertyIndex,
+                                                Property::Type           propertyType,
+                                                int                      componentIndex,
+                                                ConditionType            condition,
+                                                RawArgumentContainer&    arguments,
+                                                NotifyMode               notifyMode,
+                                                bool                     compare)
 {
-  return new PropertyNotification(object, propertyIndex, propertyType, componentIndex, condition, arguments, notifyMode, compare);
+  return new PropertyNotification(property, propertyIndex, propertyType, componentIndex, condition, arguments, notifyMode, compare);
 }
 
-PropertyNotification::PropertyNotification(Object&               object,
-                                           Property::Index       propertyIndex,
-                                           Property::Type        propertyType,
-                                           int                   componentIndex,
-                                           ConditionType         condition,
-                                           RawArgumentContainer& arguments,
-                                           NotifyMode            notifyMode,
-                                           bool                  compare)
-: mObject(&object),
-  mPropertyIndex(propertyIndex),
+PropertyNotification::PropertyNotification(const PropertyInputImpl* property,
+                                           Property::Index          propertyIndex,
+                                           Property::Type           propertyType,
+                                           int                      componentIndex,
+                                           ConditionType            condition,
+                                           RawArgumentContainer&    arguments,
+                                           NotifyMode               notifyMode,
+                                           bool                     compare)
+: mPropertyIndex(propertyIndex),
   mPropertyType(propertyType),
-  mProperty(nullptr),
+  mProperty(property),
   mComponentIndex(componentIndex),
   mConditionType(condition),
   mArguments(arguments),
@@ -108,14 +107,6 @@ PropertyNotification::PropertyNotification(Object&               object,
       break;
     }
   }
-
-  mProperty                  = mObject->GetSceneObjectInputProperty(mPropertyIndex);
-  int internalComponentIndex = mObject->GetPropertyComponentIndex(mPropertyIndex);
-  if(internalComponentIndex != Property::INVALID_COMPONENT_INDEX)
-  {
-    // override the one passed in
-    mComponentIndex = internalComponentIndex;
-  }
 }
 
 PropertyNotification::~PropertyNotification() = default;
index b0a1bc4..90465be 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_SCENE_GRAPH_PROPERTY_NOTIFICATION_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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,8 +54,8 @@ public:
 
   /**
    * Construct a new PropertyNotification
-   * @param[in] object The event-object for a scene-graph object to inspect.
-   * @param[in] propertyIndex The index of a property provided by the object.
+   * @param[in] property The scene graph property to inspect.
+   * @param[in] propertyIndex The index of a property to insprect.
    * @param[in] propertyType The type of property we're inspecting.
    * @param[in] componentIndex Index to the component of a complex property such as a Vector
    * @param[in] condition The condition type (e.g. LessThan, GreaterThan...)
@@ -64,14 +64,14 @@ public:
    * @param[in] compare The flag of comparing the previous and current data.
    * @return A new PropertyNotification object.
    */
-  static PropertyNotification* New(Object&               object,
-                                   Property::Index       propertyIndex,
-                                   Property::Type        propertyType,
-                                   int                   componentIndex,
-                                   ConditionType         condition,
-                                   RawArgumentContainer& arguments,
-                                   NotifyMode            notifyMode,
-                                   bool                  compare);
+  static PropertyNotification* New(const PropertyInputImpl* property,
+                                   Property::Index          propertyIndex,
+                                   Property::Type           propertyType,
+                                   int                      componentIndex,
+                                   ConditionType            condition,
+                                   RawArgumentContainer&    arguments,
+                                   NotifyMode               notifyMode,
+                                   bool                     compare);
 
   /**
    * Virtual destructor
@@ -104,22 +104,22 @@ public:
 protected:
   /**
    * Construct the PropertyNotification
-   * @param[in] object The event-object for a scene-graph object to inspect.
-   * @param[in] propertyIndex The index of a property provided by the object.
+   * @param[in] property The scene graph property to inspect.
+   * @param[in] propertyIndex The index of a property to inspect.
    * @param[in] propertyType The type of property we're inspecting.
    * @param[in] componentIndex Index to the component of a complex property such as a Vector
    * @param[in] condition The condition type (e.g. LessThan, GreaterThan...)
    * @param[in] arguments The arguments which accompany the condition.
    * @param[in] notifyMode The notification mode setting
    */
-  PropertyNotification(Object&               object,
-                       Property::Index       propertyIndex,
-                       Property::Type        propertyType,
-                       int                   componentIndex,
-                       ConditionType         condition,
-                       RawArgumentContainer& arguments,
-                       NotifyMode            notifyMode,
-                       bool                  compare);
+  PropertyNotification(const PropertyInputImpl* property,
+                       Property::Index          propertyIndex,
+                       Property::Type           propertyType,
+                       int                      componentIndex,
+                       ConditionType            condition,
+                       RawArgumentContainer&    arguments,
+                       NotifyMode               notifyMode,
+                       bool                     compare);
 
 private:
   /**
@@ -137,7 +137,6 @@ private:
   PropertyNotification& operator=(const PropertyNotification& rhs);
 
 protected:
-  Object*                  mObject;            ///< Not owned by the property notification. Valid until ObjectDestroyed() is called.
   Property::Index          mPropertyIndex;     ///< The index of this property.
   Property::Type           mPropertyType;      ///< The type of property this is.
   const PropertyInputImpl* mProperty;          ///< The scene graph property
index 10e7d8d..ad4e495 100644 (file)
@@ -67,7 +67,7 @@ void FrameCallbackProcessor::Update(BufferIndex bufferIndex, float elapsedSecond
 {
   if(!mFrameCallbacks.empty())
   {
-    DALI_TRACE_BEGIN(gTraceFilter, "DALI_FRAME_CALLBACK_UPDATE");
+    DALI_TRACE_SCOPE(gTraceFilter, "DALI_FRAME_CALLBACK_UPDATE");
 
     // If any of the FrameCallback::Update calls returns false, then they are no longer required & can be removed.
     auto iter = std::remove_if(
@@ -75,8 +75,6 @@ void FrameCallbackProcessor::Update(BufferIndex bufferIndex, float elapsedSecond
         return !frameCallback->Update(bufferIndex, elapsedSeconds, mNodeHierarchyChanged);
       });
     mFrameCallbacks.erase(iter, mFrameCallbacks.end());
-
-    DALI_TRACE_END(gTraceFilter, "DALI_FRAME_CALLBACK_UPDATE");
   }
 
   mNodeHierarchyChanged = false;
index 94fc6de..1550a98 100644 (file)
@@ -21,7 +21,6 @@
 #include <dali/internal/common/blending-options.h>
 #include <dali/internal/common/internal-constants.h>
 #include <dali/internal/common/memory-pool-object-allocator.h>
-#include <dali/internal/event/rendering/decorated-visual-renderer-impl.h> // For DecoratedVisualRenderer::AnimatableDecoratedVisualProperties
 #include <dali/internal/render/data-providers/node-data-provider.h>
 #include <dali/internal/render/data-providers/render-data-provider.h>
 #include <dali/internal/render/queue/render-queue.h>
@@ -772,6 +771,8 @@ Vector4 Renderer::GetVisualTransformedUpdateArea(BufferIndex updateBufferIndex,
 {
   if(mVisualProperties)
   {
+    auto& coefficient = mVisualProperties->mCoefficient;
+
     // TODO : We may need to get some method that visual properties changed, without hash.
     // Or, need to call this API in PreRender side.
 
@@ -784,9 +785,9 @@ Vector4 Renderer::GetVisualTransformedUpdateArea(BufferIndex updateBufferIndex,
     hash = mVisualProperties->mTransformAnchorPoint.Hash(updateBufferIndex, hash);
     hash = mVisualProperties->mExtraSize.Hash(updateBufferIndex, hash);
 
-    if(mVisualPropertiesCoefficient.hash != hash)
+    if(coefficient.hash != hash)
     {
-      mVisualPropertiesCoefficient.hash = hash;
+      coefficient.hash = hash;
 
       // VisualProperty
       const Vector2 transformOffset         = mVisualProperties->mTransformOffset.Get(updateBufferIndex);
@@ -833,14 +834,14 @@ Vector4 Renderer::GetVisualTransformedUpdateArea(BufferIndex updateBufferIndex,
       //    + transformOffset * transformOffsetSizeMode.xy
       // D = max((1.0 + clamp(borderlineOffset, -1.0, 1.0)) * borderlineWidth, 2.0 * blurRadius)
 
-      mVisualPropertiesCoefficient.coefXA = transformSize * Vector2(1.0f - transformOffsetSizeMode.z, 1.0f - transformOffsetSizeMode.w);
-      mVisualPropertiesCoefficient.coefXB = mVisualPropertiesCoefficient.coefXA * transformAnchorPoint + transformOffset * Vector2(1.0f - transformOffsetSizeMode.x, 1.0f - transformOffsetSizeMode.y) + transformOrigin;
-      mVisualPropertiesCoefficient.coefCA = transformSize * Vector2(transformOffsetSizeMode.z, transformOffsetSizeMode.w) + extraSize;
-      mVisualPropertiesCoefficient.coefCB = mVisualPropertiesCoefficient.coefCA * transformAnchorPoint + transformOffset * Vector2(transformOffsetSizeMode.x, transformOffsetSizeMode.y);
+      coefficient.coefXA = transformSize * Vector2(1.0f - transformOffsetSizeMode.z, 1.0f - transformOffsetSizeMode.w);
+      coefficient.coefXB = coefficient.coefXA * transformAnchorPoint + transformOffset * Vector2(1.0f - transformOffsetSizeMode.x, 1.0f - transformOffsetSizeMode.y) + transformOrigin;
+      coefficient.coefCA = transformSize * Vector2(transformOffsetSizeMode.z, transformOffsetSizeMode.w) + extraSize;
+      coefficient.coefCB = coefficient.coefCA * transformAnchorPoint + transformOffset * Vector2(transformOffsetSizeMode.x, transformOffsetSizeMode.y);
     }
     if(mVisualProperties->mExtendedProperties)
     {
-      const auto decoratedVisualProperties = static_cast<DecoratedVisualRenderer::AnimatableDecoratedVisualProperties*>(mVisualProperties->mExtendedProperties);
+      const auto decoratedVisualProperties = static_cast<VisualRenderer::AnimatableDecoratedVisualProperties*>(mVisualProperties->mExtendedProperties);
 
       uint64_t decoratedHash = 0xc70f6907UL;
 
@@ -848,9 +849,9 @@ Vector4 Renderer::GetVisualTransformedUpdateArea(BufferIndex updateBufferIndex,
       decoratedHash = decoratedVisualProperties->mBorderlineOffset.Hash(updateBufferIndex, decoratedHash);
       decoratedHash = decoratedVisualProperties->mBlurRadius.Hash(updateBufferIndex, decoratedHash);
 
-      if(mVisualPropertiesCoefficient.decoratedHash != decoratedHash)
+      if(coefficient.decoratedHash != decoratedHash)
       {
-        mVisualPropertiesCoefficient.decoratedHash = decoratedHash;
+        coefficient.decoratedHash = decoratedHash;
 
         // DecoratedVisualProperty
         const float borderlineWidth  = decoratedVisualProperties->mBorderlineWidth.Get(updateBufferIndex);
@@ -864,7 +865,7 @@ Vector4 Renderer::GetVisualTransformedUpdateArea(BufferIndex updateBufferIndex,
         // D coefficients be used only decoratedVisual.
         // It can be calculated parallely with transform.
 
-        mVisualPropertiesCoefficient.coefD = std::max((1.0f + Dali::Clamp(borderlineOffset, -1.0f, 1.0f)) * borderlineWidth, 2.0f * blurRadius);
+        coefficient.coefD = std::max((1.0f + Dali::Clamp(borderlineOffset, -1.0f, 1.0f)) * borderlineWidth, 2.0f * blurRadius);
       }
     }
 
@@ -889,14 +890,14 @@ Vector4 Renderer::GetVisualTransformedUpdateArea(BufferIndex updateBufferIndex,
     const Vector2 originalXY = Vector2(originalUpdateArea.x, originalUpdateArea.y);
     const Vector2 originalWH = Vector2(originalUpdateArea.z, originalUpdateArea.w);
 
-    const Vector2 basicVertexPosition = mVisualPropertiesCoefficient.coefXB * originalWH + mVisualPropertiesCoefficient.coefCB;
-    const Vector2 scaleVertexPosition = mVisualPropertiesCoefficient.coefXA * originalWH + mVisualPropertiesCoefficient.coefCA;
+    const Vector2 basicVertexPosition = coefficient.coefXB * originalWH + coefficient.coefCB;
+    const Vector2 scaleVertexPosition = coefficient.coefXA * originalWH + coefficient.coefCA;
 
     // TODO : We need to re-generate coefficient to consitder area width/height
     const Vector4 resultArea = Vector4(originalXY.x,
                                        originalXY.y,
-                                       scaleVertexPosition.x + 2.0f * abs(basicVertexPosition.x) + mVisualPropertiesCoefficient.coefD,
-                                       scaleVertexPosition.y + 2.0f * abs(basicVertexPosition.y) + mVisualPropertiesCoefficient.coefD);
+                                       scaleVertexPosition.x + 2.0f * abs(basicVertexPosition.x) + coefficient.coefD,
+                                       scaleVertexPosition.y + 2.0f * abs(basicVertexPosition.y) + coefficient.coefD);
 
     DALI_LOG_INFO(gSceneGraphRendererLogFilter, Debug::Verbose, "%f %f %f %f--> %f %f %f %f\n", originalUpdateArea.x, originalUpdateArea.y, originalUpdateArea.z, originalUpdateArea.w, resultArea.x, resultArea.y, resultArea.z, resultArea.w);
 
index f49f2fb..22ae4e8 100644 (file)
@@ -21,7 +21,6 @@
 #include <dali/internal/common/blending-options.h>
 #include <dali/internal/common/type-abstraction-enums.h>
 #include <dali/internal/event/common/event-thread-services.h>
-#include <dali/internal/event/rendering/visual-renderer-impl.h>
 #include <dali/internal/render/data-providers/render-data-provider.h>
 #include <dali/internal/render/renderers/render-renderer.h>
 #include <dali/internal/update/common/animatable-property.h>
@@ -52,6 +51,93 @@ using RendererConstIter = RendererContainer::ConstIterator;
 class TextureSet;
 class Geometry;
 
+namespace VisualRenderer
+{
+struct AnimatableVisualProperties
+{
+  AnimatableVisualProperties()
+  : mTransformOffset(Vector2::ZERO),
+    mTransformSize(Vector2::ONE),
+    mTransformOrigin(Vector2::ZERO),
+    mTransformAnchorPoint(Vector2::ZERO),
+    mTransformOffsetSizeMode(Vector4::ZERO),
+    mExtraSize(Vector2::ZERO),
+    mMixColor(Vector3::ONE),
+    mPreMultipliedAlpha(0.0f),
+    mExtendedPropertiesDeleteFunction(nullptr)
+  {
+  }
+
+  ~AnimatableVisualProperties()
+  {
+    if(mExtendedProperties && mExtendedPropertiesDeleteFunction)
+    {
+      mExtendedPropertiesDeleteFunction(mExtendedProperties);
+    }
+  }
+
+  /**
+   * @brief Cached coefficient value when we calculate visual transformed update size.
+   * It can reduce complexity of calculate the vertex position.
+   *
+   * Vector2 vertexPosition = (XA * aPosition + XB) * originalSize + (CA * aPosition + CB) + Vector2(D, D) * aPosition
+   */
+  struct VisualTransformedUpdateSizeCoefficientCache
+  {
+    Vector2 coefXA{Vector2::ZERO};
+    Vector2 coefXB{Vector2::ZERO};
+    Vector2 coefCA{Vector2::ZERO};
+    Vector2 coefCB{Vector2::ZERO};
+    float   coefD{0.0f};
+
+    uint64_t hash{0u};
+    uint64_t decoratedHash{0u};
+  };
+  VisualTransformedUpdateSizeCoefficientCache mCoefficient; ///< Coefficient value to calculate visual transformed update size by VisualProperties more faster.
+
+  AnimatableProperty<Vector2> mTransformOffset;
+  AnimatableProperty<Vector2> mTransformSize;
+  AnimatableProperty<Vector2> mTransformOrigin;
+  AnimatableProperty<Vector2> mTransformAnchorPoint;
+  AnimatableProperty<Vector4> mTransformOffsetSizeMode;
+  AnimatableProperty<Vector2> mExtraSize;
+  AnimatableProperty<Vector3> mMixColor;
+  AnimatableProperty<float>   mPreMultipliedAlpha;
+
+  void* mExtendedProperties{nullptr};                        // Enable derived class to extend properties further
+  void (*mExtendedPropertiesDeleteFunction)(void*){nullptr}; // Derived class's custom delete functor
+};
+
+struct AnimatableDecoratedVisualProperties
+{
+  AnimatableDecoratedVisualProperties()
+  : mCornerRadius(Vector4::ZERO),
+    mCornerRadiusPolicy(1.0f),
+    mBorderlineWidth(0.0f),
+    mBorderlineColor(Color::BLACK),
+    mBorderlineOffset(0.0f),
+    mBlurRadius(0.0f)
+  {
+  }
+  ~AnimatableDecoratedVisualProperties()
+  {
+  }
+
+  // Delete function of AnimatableDecoratedVisualProperties* converted as void*
+  static void DeleteFunction(void* data)
+  {
+    delete static_cast<AnimatableDecoratedVisualProperties*>(data);
+  }
+
+  AnimatableProperty<Vector4> mCornerRadius;
+  AnimatableProperty<float>   mCornerRadiusPolicy;
+  AnimatableProperty<float>   mBorderlineWidth;
+  AnimatableProperty<Vector4> mBorderlineColor;
+  AnimatableProperty<float>   mBorderlineOffset;
+  AnimatableProperty<float>   mBlurRadius;
+};
+} // namespace VisualRenderer
+
 class Renderer : public PropertyOwner,
                  public UniformMapDataProvider,
                  public RenderDataProvider,
@@ -463,7 +549,7 @@ public: // For VisualProperties
   /**
    * To be used only for 1st stage initialization in event thread.
    */
-  void SetVisualProperties(Internal::VisualRenderer::AnimatableVisualProperties* visualProperties)
+  void SetVisualProperties(VisualRenderer::AnimatableVisualProperties* visualProperties)
   {
     mVisualProperties = visualProperties;
   }
@@ -471,7 +557,7 @@ public: // For VisualProperties
   /**
    * May be accessed from event thread
    */
-  const Internal::VisualRenderer::AnimatableVisualProperties* GetVisualProperties() const
+  const VisualRenderer::AnimatableVisualProperties* GetVisualProperties() const
   {
     return mVisualProperties.Get();
   }
@@ -526,25 +612,6 @@ private:
   std::vector<Dali::DevelRenderer::DrawCommand> mDrawCommands;
   Dali::RenderCallback*                         mRenderCallback{nullptr};
 
-  /**
-   * @brief Cached coefficient value when we calculate visual transformed update size.
-   * It can reduce complexity of calculate the vertex position.
-   *
-   * Vector2 vertexPosition = (XA * aPosition + XB) * originalSize + (CA * aPosition + CB) + Vector2(D, D) * aPosition
-   */
-  struct VisualTransformedUpdateSizeCoefficientCache
-  {
-    Vector2 coefXA{Vector2::ZERO};
-    Vector2 coefXB{Vector2::ZERO};
-    Vector2 coefCA{Vector2::ZERO};
-    Vector2 coefCB{Vector2::ZERO};
-    float   coefD{0.0f};
-
-    uint64_t hash{0u};
-    uint64_t decoratedHash{0u};
-  };
-  VisualTransformedUpdateSizeCoefficientCache mVisualPropertiesCoefficient; ///< Coefficient value to calculate visual transformed update size by VisualProperties more faster.
-
 public:
   AnimatableProperty<float> mOpacity;    ///< The opacity value
   int32_t                   mDepthIndex; ///< Used only in PrepareRenderInstructions