From 0527699f135ea5089f09a29cf9e049cf0422607a Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Fri, 26 Nov 2021 17:23:41 +0900 Subject: [PATCH] [Tizen] (Partial update) Reset the updated flag after calculating all damaged area of the scene Change-Id: I6abf26012f3053689abb461d42c2960b09886895 --- dali/internal/render/common/render-manager.cpp | 14 +++++------ dali/internal/update/common/scene-graph-scene.h | 28 +++++++++++++++++++--- dali/internal/update/manager/update-manager.cpp | 3 +++ .../update/render-tasks/scene-graph-camera.cpp | 4 ++-- 4 files changed, 37 insertions(+), 12 deletions(-) diff --git a/dali/internal/render/common/render-manager.cpp b/dali/internal/render/common/render-manager.cpp index d157b76..b9cf368 100644 --- a/dali/internal/render/common/render-manager.cpp +++ b/dali/internal/render/common/render-manager.cpp @@ -675,13 +675,6 @@ void RenderManager::PreRender(Integration::RenderStatus& status, Integration::Sc } } } - - // Reset updated flag from the root - Layer* sourceLayer = renderList->GetSourceLayer(); - if(sourceLayer) - { - sourceLayer->SetUpdatedTree(false); - } } } } @@ -706,6 +699,13 @@ void RenderManager::PreRender(Integration::RenderStatus& status, Integration::Sc itemsDirtyRects.resize(j - itemsDirtyRects.begin()); damagedRectCleaner.SetCleanOnReturn(false); + + // Reset updated flag from the root + Layer* root = sceneObject->GetRoot(); + if(root) + { + root->SetUpdatedTree(false); + } } void RenderManager::RenderScene(Integration::RenderStatus& status, Integration::Scene& scene, bool renderToFbo) diff --git a/dali/internal/update/common/scene-graph-scene.h b/dali/internal/update/common/scene-graph-scene.h index 14bcb08..1413cbd 100644 --- a/dali/internal/update/common/scene-graph-scene.h +++ b/dali/internal/update/common/scene-graph-scene.h @@ -24,6 +24,7 @@ #include #include #include +#include #include namespace Dali @@ -213,6 +214,25 @@ public: return mClearValues; } + /** + * @brief Set a root of the Scene + * + * @param layer The root layer + */ + void SetRoot(SceneGraph::Layer* layer) + { + mRoot = layer; + } + + /** + * @brief Get a root of the Scene + * @return The root layer + */ + SceneGraph::Layer* GetRoot() const + { + return mRoot; + } + private: // Render instructions describe what should be rendered during RenderManager::RenderScene() // Update manager updates instructions for the next frame while we render the current one @@ -224,9 +244,9 @@ private: bool mSkipRendering; ///< A flag to skip rendering - Rect mSurfaceRect; ///< The rectangle of surface which is related ot this scene. - int32_t mSurfaceOrientation; ///< The orientation of surface which is related of this scene - bool mSurfaceRectChanged; ///< The flag of surface's rectangle is changed when is resized, moved or rotated. + Rect mSurfaceRect; ///< The rectangle of surface which is related ot this scene. + int32_t mSurfaceOrientation; ///< The orientation of surface which is related of this scene + bool mSurfaceRectChanged; ///< The flag of surface's rectangle is changed when is resized, moved or rotated. bool mRotationCompletedAcknowledgement; ///< The flag of sending the acknowledgement to complete window rotation. // Render pass and render target @@ -242,6 +262,8 @@ private: // clear colors std::vector mClearValues{}; + + SceneGraph::Layer* mRoot{nullptr}; ///< Root node (root is a layer). The layer is not stored in the node memory pool. }; /// Messages diff --git a/dali/internal/update/manager/update-manager.cpp b/dali/internal/update/manager/update-manager.cpp index c96b6ca..80e8be3 100644 --- a/dali/internal/update/manager/update-manager.cpp +++ b/dali/internal/update/manager/update-manager.cpp @@ -482,6 +482,9 @@ void UpdateManager::AddScene(OwnerPointer& scene) { mImpl->scenes.back()->scene = scene.Release(); + // Set root to the Scene + mImpl->scenes.back()->scene->SetRoot(mImpl->scenes.back()->root); + // Initialize the context from render manager typedef MessageValue1 DerivedType; diff --git a/dali/internal/update/render-tasks/scene-graph-camera.cpp b/dali/internal/update/render-tasks/scene-graph-camera.cpp index cd3be71..f7b2b1c 100644 --- a/dali/internal/update/render-tasks/scene-graph-camera.cpp +++ b/dali/internal/update/render-tasks/scene-graph-camera.cpp @@ -328,8 +328,8 @@ void Camera::SetReflectByPlane(const Vector4& plane) void Camera::RotateProjection(int rotationAngle) { - mProjectionRotation = rotationAngle; - mUpdateViewFlag = UPDATE_COUNT; + mProjectionRotation = rotationAngle; + mUpdateProjectionFlag = UPDATE_COUNT; } const Matrix& Camera::GetProjectionMatrix(BufferIndex bufferIndex) const -- 2.7.4