Revert "Make another ConditionalWait for post-rendearing" 63/293963/2
authorHeeyong Song <heeyong.song@samsung.com>
Fri, 9 Jun 2023 06:40:32 +0000 (15:40 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Mon, 12 Jun 2023 04:49:18 +0000 (04:49 +0000)
This reverts commit 11af5d96f037c59d36deb838be40554d49d2f4b4.

Change-Id: Ibc44cb0f26c998d5e524c33783af73a6ceb38949

dali/internal/adaptor/common/combined-update-render-controller.cpp
dali/internal/adaptor/common/combined-update-render-controller.h

index 70a278d..c80ac40 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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,7 +91,6 @@ CombinedUpdateRenderController::CombinedUpdateRenderController(AdaptorInternalSe
   mEventThreadSemaphore(0),
   mSurfaceSemaphore(0),
   mUpdateRenderThreadWaitCondition(),
-  mPostRenderWaitCondition(),
   mAdaptorInterfaces(adaptorInterfaces),
   mPerformanceInterface(adaptorInterfaces.GetPerformanceInterface()),
   mCore(adaptorInterfaces.GetCore()),
@@ -308,7 +307,8 @@ void CombinedUpdateRenderController::ReplaceSurface(Dali::RenderSurfaceInterface
     // Start replacing the surface.
     {
       ConditionalWait::ScopedLock lock(mUpdateRenderThreadWaitCondition);
-      mNewSurface = newSurface;
+      mPostRendering = FALSE; // Clear the post-rendering flag as Update/Render thread will replace the surface now
+      mNewSurface    = newSurface;
       mUpdateRenderThreadWaitCondition.Notify(lock);
     }
 
@@ -330,6 +330,7 @@ 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);
     }
@@ -365,6 +366,7 @@ 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);
@@ -963,9 +965,9 @@ void CombinedUpdateRenderController::AddPerformanceMarker(PerformanceInterface::
 
 void CombinedUpdateRenderController::PostRenderComplete()
 {
-  ConditionalWait::ScopedLock lock(mPostRenderWaitCondition);
+  ConditionalWait::ScopedLock lock(mUpdateRenderThreadWaitCondition);
   mPostRendering = FALSE;
-  mPostRenderWaitCondition.Notify(lock);
+  mUpdateRenderThreadWaitCondition.Notify(lock);
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -974,19 +976,19 @@ void CombinedUpdateRenderController::PostRenderComplete()
 
 void CombinedUpdateRenderController::PostRenderStarted()
 {
-  ConditionalWait::ScopedLock lock(mPostRenderWaitCondition);
+  ConditionalWait::ScopedLock lock(mUpdateRenderThreadWaitCondition);
   mPostRendering = TRUE;
 }
 
 void CombinedUpdateRenderController::PostRenderWaitForCompletion()
 {
-  ConditionalWait::ScopedLock lock(mPostRenderWaitCondition);
+  ConditionalWait::ScopedLock lock(mUpdateRenderThreadWaitCondition);
   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)
   {
-    mPostRenderWaitCondition.Wait(lock);
+    mUpdateRenderThreadWaitCondition.Wait(lock);
   }
 }
 
index 3c4f29b..8902875 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_COMBINED_UPDATE_RENDER_CONTROLLER_H
 
 /*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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,7 +340,6 @@ 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