From: Heeyong Song Date: Tue, 7 Feb 2023 06:10:21 +0000 (+0900) Subject: Make another ConditionalWait for post-rendearing X-Git-Tag: dali_2.2.14~3^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=11af5d96f037c59d36deb838be40554d49d2f4b4;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Make another ConditionalWait for post-rendearing The mUpdateRenderThreadWaitCondition was also used for post-rendering. But it can be notified by other method - ResizeSurface() etc. The PostRenderWaitForCompletion() should wait for the PostRenderComplete() of the main thread. So use another ConditionalWait. Change-Id: I890abcf95045e2d9701208cbe18ac8082219457b --- diff --git a/dali/internal/adaptor/common/combined-update-render-controller.cpp b/dali/internal/adaptor/common/combined-update-render-controller.cpp index 53514de..4cc78b6 100644 --- a/dali/internal/adaptor/common/combined-update-render-controller.cpp +++ b/dali/internal/adaptor/common/combined-update-render-controller.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -91,6 +91,7 @@ CombinedUpdateRenderController::CombinedUpdateRenderController(AdaptorInternalSe mEventThreadSemaphore(0), mSurfaceSemaphore(0), mUpdateRenderThreadWaitCondition(), + mPostRenderWaitCondition(), mAdaptorInterfaces(adaptorInterfaces), mPerformanceInterface(adaptorInterfaces.GetPerformanceInterface()), mCore(adaptorInterfaces.GetCore()), @@ -307,8 +308,7 @@ void CombinedUpdateRenderController::ReplaceSurface(Dali::RenderSurfaceInterface // Start replacing the surface. { ConditionalWait::ScopedLock lock(mUpdateRenderThreadWaitCondition); - mPostRendering = FALSE; // Clear the post-rendering flag as Update/Render thread will replace the surface now - mNewSurface = newSurface; + mNewSurface = newSurface; mUpdateRenderThreadWaitCondition.Notify(lock); } @@ -330,7 +330,6 @@ void CombinedUpdateRenderController::DeleteSurface(Dali::RenderSurfaceInterface* // Start replacing the surface. { ConditionalWait::ScopedLock lock(mUpdateRenderThreadWaitCondition); - mPostRendering = FALSE; // Clear the post-rendering flag as Update/Render thread will delete the surface now mDeletedSurface = surface; mUpdateRenderThreadWaitCondition.Notify(lock); } @@ -366,7 +365,6 @@ void CombinedUpdateRenderController::ResizeSurface() { ConditionalWait::ScopedLock lock(mUpdateRenderThreadWaitCondition); - mPostRendering = FALSE; // Clear the post-rendering flag as Update/Render thread will resize the surface now // Surface is resized and the surface resized count is increased. mSurfaceResized++; mUpdateRenderThreadWaitCondition.Notify(lock); @@ -966,9 +964,9 @@ void CombinedUpdateRenderController::AddPerformanceMarker(PerformanceInterface:: void CombinedUpdateRenderController::PostRenderComplete() { - ConditionalWait::ScopedLock lock(mUpdateRenderThreadWaitCondition); + ConditionalWait::ScopedLock lock(mPostRenderWaitCondition); mPostRendering = FALSE; - mUpdateRenderThreadWaitCondition.Notify(lock); + mPostRenderWaitCondition.Notify(lock); } /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -977,19 +975,19 @@ void CombinedUpdateRenderController::PostRenderComplete() void CombinedUpdateRenderController::PostRenderStarted() { - ConditionalWait::ScopedLock lock(mUpdateRenderThreadWaitCondition); + ConditionalWait::ScopedLock lock(mPostRenderWaitCondition); mPostRendering = TRUE; } void CombinedUpdateRenderController::PostRenderWaitForCompletion() { - ConditionalWait::ScopedLock lock(mUpdateRenderThreadWaitCondition); + ConditionalWait::ScopedLock lock(mPostRenderWaitCondition); while(mPostRendering && !mNewSurface && // We should NOT wait if we're replacing the surface !mDeletedSurface && // We should NOT wait if we're deleting the surface !mDestroyUpdateRenderThread) { - mUpdateRenderThreadWaitCondition.Wait(lock); + mPostRenderWaitCondition.Wait(lock); } } diff --git a/dali/internal/adaptor/common/combined-update-render-controller.h b/dali/internal/adaptor/common/combined-update-render-controller.h index 8902875..3c4f29b 100644 --- a/dali/internal/adaptor/common/combined-update-render-controller.h +++ b/dali/internal/adaptor/common/combined-update-render-controller.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_COMBINED_UPDATE_RENDER_CONTROLLER_H /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -340,6 +340,7 @@ private: Semaphore<> mSurfaceSemaphore; ///< Used by the event thread to ensure the surface has been deleted or replaced. ConditionalWait mUpdateRenderThreadWaitCondition; ///< The wait condition for the update-render-thread. + ConditionalWait mPostRenderWaitCondition; ///< The wait condition for the post render. AdaptorInternalServices& mAdaptorInterfaces; ///< The adaptor internal interface PerformanceInterface* mPerformanceInterface; ///< The performance logging interface