// First render pass, nothing to render, adaptor would just do swap buffer.
DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION);
+
+ clippingRect = TestApplication::DEFAULT_SURFACE_RECT;
application.RenderWithPartialUpdate(damagedRects, clippingRect);
Actor actor = CreateRenderableActor();
// First render pass, nothing to render, adaptor would just do swap buffer.
DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION);
+
+ clippingRect = TestApplication::DEFAULT_SURFACE_RECT;
application.RenderWithPartialUpdate(damagedRects, clippingRect);
Actor actor = CreateRenderableActor();
// First render pass, nothing to render, adaptor would just do swap buffer.
DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION);
+
+ clippingRect = TestApplication::DEFAULT_SURFACE_RECT;
application.RenderWithPartialUpdate(damagedRects, clippingRect);
Texture image = CreateTexture(TextureType::TEXTURE_2D, Pixel::RGBA8888, 4u, 4u);
DALI_TEST_EQUALS<Rect<int>>(expectedRect1, damagedRects[0], TEST_LOCATION);
DALI_TEST_EQUALS<Rect<int>>(expectedRect2, damagedRects[1], TEST_LOCATION);
+ clippingRect = TestApplication::DEFAULT_SURFACE_RECT;
application.RenderWithPartialUpdate(damagedRects, clippingRect);
damagedRects.clear();
+ clippingRect = TestApplication::DEFAULT_SURFACE_RECT;
application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
application.RenderWithPartialUpdate(damagedRects, clippingRect);
application.SendNotification();
damagedRects.clear();
+ clippingRect = TestApplication::DEFAULT_SURFACE_RECT;
application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
application.RenderWithPartialUpdate(damagedRects, clippingRect);
damagedRects.clear();
// In animation deley time
+ clippingRect = TestApplication::DEFAULT_SURFACE_RECT;
application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
application.RenderWithPartialUpdate(damagedRects, clippingRect);
damagedRects.clear();
// Also in animation deley time
+ clippingRect = TestApplication::DEFAULT_SURFACE_RECT;
application.PreRenderWithPartialUpdate(100, nullptr, damagedRects);
application.RenderWithPartialUpdate(damagedRects, clippingRect);
DALI_TEST_EQUALS<Rect<int>>(expectedRect2, damagedRects[0], TEST_LOCATION);
DALI_TEST_EQUALS<Rect<int>>(expectedRect1, damagedRects[1], TEST_LOCATION);
+ clippingRect = TestApplication::DEFAULT_SURFACE_RECT;
application.RenderWithPartialUpdate(damagedRects, clippingRect);
- // Finished animation, but the actior was already unparented
+ // Finished animation, but the actor was already unparented
damagedRects.clear();
application.PreRenderWithPartialUpdate(500, nullptr, damagedRects);
DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
DALI_TEST_EQUALS<Rect<int>>(expectedRect2, damagedRects[0], TEST_LOCATION);
+ clippingRect = TestApplication::DEFAULT_SURFACE_RECT;
application.RenderWithPartialUpdate(damagedRects, clippingRect);
END_TEST;
END_TEST;
}
+int utcDaliActorPartialUpdateSkipRendering(void)
+{
+ TestApplication application(
+ TestApplication::DEFAULT_SURFACE_WIDTH,
+ TestApplication::DEFAULT_SURFACE_HEIGHT,
+ TestApplication::DEFAULT_HORIZONTAL_DPI,
+ TestApplication::DEFAULT_VERTICAL_DPI,
+ true,
+ true);
+
+ tet_infoline("Check to skip rendering in case of the empty damaged rect");
+
+ TraceCallStack& drawTrace = application.GetGlAbstraction().GetDrawTrace();
+ drawTrace.Enable(true);
+ drawTrace.Reset();
+
+ Actor actor1 = CreateRenderableActor();
+ actor1.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ actor1.SetProperty(Actor::Property::SIZE, Vector3(80.0f, 80.0f, 0.0f));
+ application.GetScene().Add(actor1);
+
+ std::vector<Rect<int>> damagedRects;
+ Rect<int> clippingRect;
+ Rect<int> expectedRect1;
+
+ application.SendNotification();
+ application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+
+ DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
+
+ // Aligned by 16
+ expectedRect1 = Rect<int>(0, 720, 96, 96); // in screen coordinates, includes 3 last frames updates
+ DALI_TEST_EQUALS<Rect<int>>(expectedRect1, damagedRects[0], TEST_LOCATION);
+
+ clippingRect = TestApplication::DEFAULT_SURFACE_RECT;
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+ DALI_TEST_EQUALS(drawTrace.CountMethod("DrawElements"), 1, TEST_LOCATION);
+
+ damagedRects.clear();
+ clippingRect = TestApplication::DEFAULT_SURFACE_RECT;
+ application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+ // Remove the actor
+ actor1.Unparent();
+
+ application.SendNotification();
+
+ damagedRects.clear();
+ application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+
+ DALI_TEST_EQUALS<Rect<int>>(expectedRect1, damagedRects[0], TEST_LOCATION);
+
+ clippingRect = TestApplication::DEFAULT_SURFACE_RECT;
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+ // Render again without any change
+ damagedRects.clear();
+ drawTrace.Reset();
+ application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+
+ DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION);
+
+ clippingRect = Rect<int>();
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+ // Skip rendering
+ DALI_TEST_EQUALS(drawTrace.CountMethod("DrawElements"), 0, TEST_LOCATION);
+
+ // Add the actor again
+ application.GetScene().Add(actor1);
+
+ application.SendNotification();
+
+ damagedRects.clear();
+ drawTrace.Reset();
+ application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+
+ DALI_TEST_EQUALS<Rect<int>>(expectedRect1, damagedRects[0], TEST_LOCATION);
+
+ clippingRect = TestApplication::DEFAULT_SURFACE_RECT;
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+ DALI_TEST_EQUALS(drawTrace.CountMethod("DrawElements"), 1, TEST_LOCATION);
+
+ END_TEST;
+}
+
+int utcDaliActorPartialUpdate3DNode(void)
+{
+ TestApplication application(
+ TestApplication::DEFAULT_SURFACE_WIDTH,
+ TestApplication::DEFAULT_SURFACE_HEIGHT,
+ TestApplication::DEFAULT_HORIZONTAL_DPI,
+ TestApplication::DEFAULT_VERTICAL_DPI,
+ true,
+ true);
+
+ tet_infoline("Partial update should be ignored in case of 3d layer of 3d node");
+
+ TraceCallStack& drawTrace = application.GetGlAbstraction().GetDrawTrace();
+ drawTrace.Enable(true);
+ drawTrace.Reset();
+
+ Actor actor1 = CreateRenderableActor();
+ actor1.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ actor1.SetProperty(Actor::Property::SIZE, Vector3(80.0f, 80.0f, 0.0f));
+ application.GetScene().Add(actor1);
+
+ std::vector<Rect<int>> damagedRects;
+ Rect<int> clippingRect;
+
+ application.SendNotification();
+ application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+
+ DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
+
+ clippingRect = TestApplication::DEFAULT_SURFACE_RECT;
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+ DALI_TEST_EQUALS(drawTrace.CountMethod("DrawElements"), 1, TEST_LOCATION);
+
+ // Change the layer to 3D
+ application.GetScene().GetRootLayer().SetProperty(Layer::Property::BEHAVIOR, Layer::LAYER_3D);
+
+ application.SendNotification();
+
+ damagedRects.clear();
+ application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+
+ DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
+ DALI_TEST_EQUALS<Rect<int>>(TestApplication::DEFAULT_SURFACE_RECT, damagedRects[0], TEST_LOCATION);
+
+ clippingRect = TestApplication::DEFAULT_SURFACE_RECT;
+ drawTrace.Reset();
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+ DALI_TEST_EQUALS(drawTrace.CountMethod("DrawElements"), 1, TEST_LOCATION);
+
+ // Change the layer to 2D
+ application.GetScene().GetRootLayer().SetProperty(Layer::Property::BEHAVIOR, Layer::LAYER_UI);
+
+ application.SendNotification();
+
+ damagedRects.clear();
+ application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+
+ DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
+
+ clippingRect = TestApplication::DEFAULT_SURFACE_RECT;
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+ // Make 3D transform
+ actor1.SetProperty(Actor::Property::ORIENTATION, Quaternion(Degree(90.0f), Vector3::YAXIS));
+
+ application.SendNotification();
+
+ damagedRects.clear();
+ application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+
+ DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
+ DALI_TEST_EQUALS<Rect<int>>(TestApplication::DEFAULT_SURFACE_RECT, damagedRects[0], TEST_LOCATION);
+
+ clippingRect = TestApplication::DEFAULT_SURFACE_RECT;
+ drawTrace.Reset();
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+ DALI_TEST_EQUALS(drawTrace.CountMethod("DrawElements"), 1, TEST_LOCATION);
+
+ END_TEST;
+}
+
int UtcDaliActorCaptureAllTouchAfterStartPropertyP(void)
{
TestApplication application;