Revert "[Tizen] Implement partial update"
[platform/core/uifw/dali-core.git] / automated-tests / src / dali / utc-Dali-Actor.cpp
index b8c7e95..12cbecd 100644 (file)
@@ -1269,6 +1269,29 @@ int UtcDaliActorGetCurrentSizeImmediate(void)
   END_TEST;
 }
 
+int UtcDaliActorCalculateScreenExtents(void)
+{
+  TestApplication application;
+
+  Actor actor = Actor::New();
+
+  actor.SetPosition(Vector3(2.0f, 2.0f, 16.0f));
+  actor.SetSize(Vector3{ 1.0f, 1.0f, 1.0f });
+
+  application.SendNotification();
+  application.Render();
+
+  auto expectedExtent = Rect<>{ -0.5f, -0.5f, 1.0f, 1.0f };
+  auto actualExtent = DevelActor::CalculateScreenExtents( actor );
+  DALI_TEST_EQUALS( expectedExtent.x, actualExtent.x, Math::MACHINE_EPSILON_10000, TEST_LOCATION );
+  DALI_TEST_EQUALS( expectedExtent.y, actualExtent.y, Math::MACHINE_EPSILON_10000, TEST_LOCATION );
+  DALI_TEST_EQUALS( expectedExtent.width, actualExtent.width, Math::MACHINE_EPSILON_10000, TEST_LOCATION );
+  DALI_TEST_EQUALS( expectedExtent.height, actualExtent.height, Math::MACHINE_EPSILON_10000, TEST_LOCATION );
+
+  Stage::GetCurrent().Remove( actor );
+  END_TEST;
+}
+
 // SetPosition(float x, float y)
 int UtcDaliActorSetPosition01(void)
 {
@@ -7199,3 +7222,30 @@ int utcDaliEnsureRenderWhenRemovingLastRenderableActor(void)
 
   END_TEST;
 }
+
+int utcDaliEnsureRenderWhenMakingLastActorInvisible(void)
+{
+  TestApplication application;
+  auto stage = Stage::GetCurrent();
+
+  tet_infoline( "Ensure we clear the screen when the last actor is made invisible" );
+
+  Actor actor = CreateRenderableActor();
+  actor.SetSize( 100.0f, 100.0f );
+  stage.Add( actor );
+
+  application.SendNotification();
+  application.Render();
+
+  auto& glAbstraction = application.GetGlAbstraction();
+  const auto clearCountBefore = glAbstraction.GetClearCountCalled();
+
+  actor.SetVisible( false );
+
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( glAbstraction.GetClearCountCalled(), clearCountBefore + 1, TEST_LOCATION );
+
+  END_TEST;
+}