From: Heeyong Song Date: Tue, 16 Nov 2021 06:21:05 +0000 (+0900) Subject: (Partial update) Reset the updated flag after calculating the update area X-Git-Tag: dali_2.0.53~2^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-core.git;a=commitdiff_plain;h=73d9eb4329d780832541e1d1df3d97e992666cc7 (Partial update) Reset the updated flag after calculating the update area We had an issue that the updated flag of non-renderable actor was not reset. It should also be reset after calculating the update area. So reset the updated flag of all nodes. Change-Id: I8b4d540996565ba2d0ef9e528114dad5e3de2475 --- diff --git a/automated-tests/src/dali/utc-Dali-Actor.cpp b/automated-tests/src/dali/utc-Dali-Actor.cpp index 60c0cfd..b9f8dba 100644 --- a/automated-tests/src/dali/utc-Dali-Actor.cpp +++ b/automated-tests/src/dali/utc-Dali-Actor.cpp @@ -9097,6 +9097,65 @@ int utcDaliActorPartialUpdate3DNode(void) END_TEST; } +int utcDaliActorPartialUpdateNotRenderableActor(void) +{ + TestApplication application( + TestApplication::DEFAULT_SURFACE_WIDTH, + TestApplication::DEFAULT_SURFACE_HEIGHT, + TestApplication::DEFAULT_HORIZONTAL_DPI, + TestApplication::DEFAULT_VERTICAL_DPI, + true, + true); + + tet_infoline("Check the damaged rect with not renderable parent actor"); + + const TestGlAbstraction::ScissorParams& glScissorParams(application.GetGlAbstraction().GetScissorParams()); + + Actor parent = Actor::New(); + parent[Actor::Property::ANCHOR_POINT] = AnchorPoint::TOP_LEFT; + parent[Actor::Property::POSITION] = Vector3(16.0f, 16.0f, 0.0f); + parent[Actor::Property::SIZE] = Vector3(16.0f, 16.0f, 0.0f); + parent.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS); + application.GetScene().Add(parent); + + Actor child = CreateRenderableActor(); + child[Actor::Property::ANCHOR_POINT] = AnchorPoint::TOP_LEFT; + child[Actor::Property::SIZE] = Vector3(16.0f, 16.0f, 0.0f); + child.SetResizePolicy(ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS); + parent.Add(child); + + application.SendNotification(); + + std::vector> damagedRects; + + // 1. Actor added, damaged rect is added size of actor + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION); + + // Aligned by 16 + Rect clippingRect = Rect(16, 768, 32, 32); // in screen coordinates, includes 3 last frames updates + DALI_TEST_EQUALS>(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); + + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + damagedRects.clear(); + application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects); + application.RenderWithPartialUpdate(damagedRects, clippingRect); + + // Ensure the damaged rect is empty + DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION); + + END_TEST; +} + int UtcDaliActorCaptureAllTouchAfterStartPropertyP(void) { TestApplication application; diff --git a/dali/internal/render/common/render-manager.cpp b/dali/internal/render/common/render-manager.cpp index 5079c33..8db070b 100644 --- a/dali/internal/render/common/render-manager.cpp +++ b/dali/internal/render/common/render-manager.cpp @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -614,7 +615,6 @@ void RenderManager::PreRender(Integration::Scene& scene, std::vector>& (item.mNode->Updated() || (item.mRenderer && item.mRenderer->Updated(mImpl->renderBufferIndex, item.mNode))))) { item.mIsUpdated = false; - item.mNode->SetUpdatedTree(false); rect = RenderItem::CalculateViewportSpaceAABB(item.mModelViewMatrix, item.mUpdateSize, viewportRect.width, viewportRect.height); if(rect.IsValid() && rect.Intersect(viewportRect) && !rect.IsEmpty()) @@ -677,6 +677,9 @@ void RenderManager::PreRender(Integration::Scene& scene, std::vector>& } } } + + // Reset updated flag from the root + renderList->GetSourceLayer()->SetUpdatedTree(false); } } }