From 705b57dc6659ffb6af65e58cabc1b66617413972 Mon Sep 17 00:00:00 2001 From: seungho Date: Mon, 18 Apr 2022 15:59:22 +0900 Subject: [PATCH] Transfer uploadOnly flag to the core and update manager - uploadOnly flag is transferred to the update manager to do not change render-task state - uploadOnly flag that has been transferred to the render manager is removed. Change-Id: I06862bd376a0eacc7cd0a1f0a00b028bd249cad3 Signed-off-by: seungho --- .../dali-test-suite-utils/test-application.cpp | 27 ++++++++++++---------- .../dali-test-suite-utils/test-application.h | 4 ++-- .../test-graphics-application.cpp | 14 +++++------ .../common/combined-update-render-controller.cpp | 14 +++++++---- 4 files changed, 33 insertions(+), 26 deletions(-) diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.cpp b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.cpp index 2862284..873b7b3 100644 --- a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.cpp +++ b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.cpp @@ -179,7 +179,7 @@ void TestApplication::SendNotification() mCore->ProcessEvents(); } -void TestApplication::DoUpdate(uint32_t intervalMilliseconds, const char* location) +void TestApplication::DoUpdate(uint32_t intervalMilliseconds, const char* location, bool uploadOnly) { if(GetUpdateStatus() == 0 && mRenderStatus.NeedsUpdate() == false && @@ -191,25 +191,28 @@ void TestApplication::DoUpdate(uint32_t intervalMilliseconds, const char* locati uint32_t nextVSyncTime = mLastVSyncTime + intervalMilliseconds; float elapsedSeconds = static_cast(intervalMilliseconds) * 0.001f; - mCore->Update(elapsedSeconds, mLastVSyncTime, nextVSyncTime, mStatus, false, false); + mCore->Update(elapsedSeconds, mLastVSyncTime, nextVSyncTime, mStatus, false, false, uploadOnly); GetRenderController().Initialize(); mLastVSyncTime = nextVSyncTime; } -bool TestApplication::Render(uint32_t intervalMilliseconds, const char* location) +bool TestApplication::Render(uint32_t intervalMilliseconds, const char* location, bool uploadOnly) { - DoUpdate(intervalMilliseconds, location); + DoUpdate(intervalMilliseconds, location, uploadOnly); // Reset the status mRenderStatus.SetNeedsUpdate(false); mRenderStatus.SetNeedsPostRender(false); - mCore->PreRender(mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/); - mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/); - mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/); - mCore->PostRender(false /*do not skip rendering*/); + mCore->PreRender(mRenderStatus, false /*do not force clear*/); + if(!uploadOnly) + { + mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/); + mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/); + } + mCore->PostRender(); mFrame++; @@ -220,7 +223,7 @@ bool TestApplication::PreRenderWithPartialUpdate(uint32_t intervalMilliseconds, { DoUpdate(intervalMilliseconds, location); - mCore->PreRender(mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/); + mCore->PreRender(mRenderStatus, false /*do not force clear*/); mCore->PreRender(mScene, damagedRects); return mStatus.KeepUpdating() || mRenderStatus.NeedsUpdate(); @@ -230,7 +233,7 @@ bool TestApplication::RenderWithPartialUpdate(std::vector>& damagedRec { mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/); mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/, clippingRect); - mCore->PostRender(false /*do not skip rendering*/); + mCore->PostRender(); mFrame++; @@ -261,10 +264,10 @@ bool TestApplication::GetRenderNeedsPostRender() bool TestApplication::RenderOnly() { // Update Time values - mCore->PreRender(mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/); + mCore->PreRender(mRenderStatus, false /*do not force clear*/); mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/); mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/); - mCore->PostRender(false /*do not skip rendering*/); + mCore->PostRender(); mFrame++; diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.h b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.h index 02143a7..1b101c5 100644 --- a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.h +++ b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.h @@ -72,7 +72,7 @@ public: void ProcessEvent(const Integration::Event& event); void SendNotification(); - bool Render(uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location = NULL); + bool Render(uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location = NULL, bool uploadOnly = false); bool PreRenderWithPartialUpdate(uint32_t intervalMilliseconds, const char* location, std::vector>& damagedRects); bool RenderWithPartialUpdate(std::vector>& damagedRects, Rect& clippingRect); uint32_t GetUpdateStatus(); @@ -93,7 +93,7 @@ public: } private: - void DoUpdate(uint32_t intervalMilliseconds, const char* location = NULL); + void DoUpdate(uint32_t intervalMilliseconds, const char* location = NULL, bool uploadOnly = false); protected: TestPlatformAbstraction mPlatformAbstraction; diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-graphics-application.cpp b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-graphics-application.cpp index 66fae8f..0c6996e 100644 --- a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-graphics-application.cpp +++ b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-graphics-application.cpp @@ -189,7 +189,7 @@ void TestGraphicsApplication::DoUpdate(uint32_t intervalMilliseconds, const char uint32_t nextVSyncTime = mLastVSyncTime + intervalMilliseconds; float elapsedSeconds = static_cast(intervalMilliseconds) * 0.001f; - mCore->Update(elapsedSeconds, mLastVSyncTime, nextVSyncTime, mStatus, false, false); + mCore->Update(elapsedSeconds, mLastVSyncTime, nextVSyncTime, mStatus, false, false, false); GetRenderController().Initialize(); @@ -204,10 +204,10 @@ bool TestGraphicsApplication::Render(uint32_t intervalMilliseconds, const char* mRenderStatus.SetNeedsUpdate(false); mRenderStatus.SetNeedsPostRender(false); - mCore->PreRender(mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/); + mCore->PreRender(mRenderStatus, false /*do not force clear*/); mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/); mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/); - mCore->PostRender(false /*do not skip rendering*/); + mCore->PostRender(); mFrame++; @@ -218,7 +218,7 @@ bool TestGraphicsApplication::PreRenderWithPartialUpdate(uint32_t intervalMillis { DoUpdate(intervalMilliseconds, location); - mCore->PreRender(mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/); + mCore->PreRender(mRenderStatus, false /*do not force clear*/); mCore->PreRender(mScene, damagedRects); return mStatus.KeepUpdating() || mRenderStatus.NeedsUpdate(); @@ -228,7 +228,7 @@ bool TestGraphicsApplication::RenderWithPartialUpdate(std::vector>& da { mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/, clippingRect); mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/, clippingRect); - mCore->PostRender(false /*do not skip rendering*/); + mCore->PostRender(); mFrame++; @@ -259,10 +259,10 @@ bool TestGraphicsApplication::GetRenderNeedsPostRender() bool TestGraphicsApplication::RenderOnly() { // Update Time values - mCore->PreRender(mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/); + mCore->PreRender(mRenderStatus, false /*do not force clear*/); mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/); mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/); - mCore->PostRender(false /*do not skip rendering*/); + mCore->PostRender(); mFrame++; diff --git a/dali/internal/adaptor/common/combined-update-render-controller.cpp b/dali/internal/adaptor/common/combined-update-render-controller.cpp index cd81f5c..0f1f71b 100644 --- a/dali/internal/adaptor/common/combined-update-render-controller.cpp +++ b/dali/internal/adaptor/common/combined-update-render-controller.cpp @@ -544,6 +544,9 @@ void CombinedUpdateRenderController::UpdateRenderThread() { LOG_UPDATE_RENDER_TRACE; + // For thread safe + bool uploadOnly = mUploadWithoutRendering; + // Performance statistics are logged upon a VSYNC tick so use this point for a VSync marker AddPerformanceMarker(PerformanceInterface::VSYNC); @@ -622,7 +625,8 @@ void CombinedUpdateRenderController::UpdateRenderThread() nextFrameTime, updateStatus, renderToFboEnabled, - isRenderingToFbo); + isRenderingToFbo, + uploadOnly); TRACE_UPDATE_RENDER_END("DALI_UPDATE"); AddPerformanceMarker(PerformanceInterface::UPDATE_END); @@ -670,9 +674,9 @@ void CombinedUpdateRenderController::UpdateRenderThread() TRACE_UPDATE_RENDER_BEGIN("DALI_RENDER"); // Upload shared resources - mCore.PreRender(renderStatus, mForceClear, mUploadWithoutRendering); + mCore.PreRender(renderStatus, mForceClear); - if(!mUploadWithoutRendering) + if(!uploadOnly) { // Go through each window WindowContainer windows; @@ -721,12 +725,12 @@ void CombinedUpdateRenderController::UpdateRenderThread() } } - if(!mUploadWithoutRendering) + if(!uploadOnly) { graphics.PostRender(); } - mCore.PostRender(mUploadWithoutRendering); + mCore.PostRender(); ////////////////////////////// // DELETE SURFACE -- 2.7.4