[Tizen] Do not reset mPostRendering in ResizeSurface 71/293971/1 accepted/tizen/7.0/unified/20230615.051449 accepted/tizen/7.0/unified/20230615.061142 accepted/tizen/7.0/unified/20230623.162706
authorHeeyong Song <heeyong.song@samsung.com>
Fri, 9 Jun 2023 08:00:13 +0000 (17:00 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Fri, 9 Jun 2023 08:00:13 +0000 (17:00 +0900)
We should wait for PostRenderComplete in this case

Change-Id: Iad8518bfe9485a6206d91c8fba1875249f8f0587

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

index 9679554..8d73e51 100644 (file)
@@ -92,7 +92,6 @@ CombinedUpdateRenderController::CombinedUpdateRenderController(AdaptorInternalSe
   mEventThreadSemaphore(0),
   mSurfaceSemaphore(0),
   mUpdateRenderThreadWaitCondition(),
-  mPostRenderWaitCondition(),
   mAdaptorInterfaces(adaptorInterfaces),
   mPerformanceInterface(adaptorInterfaces.GetPerformanceInterface()),
   mCore(adaptorInterfaces.GetCore()),
@@ -309,7 +308,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);
     }
 
@@ -331,6 +331,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);
     }
@@ -953,9 +954,9 @@ void CombinedUpdateRenderController::AddPerformanceMarker(PerformanceInterface::
 
 void CombinedUpdateRenderController::PostRenderComplete()
 {
-  ConditionalWait::ScopedLock lock(mPostRenderWaitCondition);
+  ConditionalWait::ScopedLock lock(mUpdateRenderThreadWaitCondition);
   mPostRendering = FALSE;
-  mPostRenderWaitCondition.Notify(lock);
+  mUpdateRenderThreadWaitCondition.Notify(lock);
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -964,19 +965,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..d0e0f07 100644 (file)
@@ -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