[Tizen] Fix rendering issue by tbm_surface and eglSwapBuffers in native render surface 83/133583/1
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Tue, 13 Jun 2017 01:59:20 +0000 (10:59 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Tue, 13 Jun 2017 01:59:22 +0000 (10:59 +0900)
This reverts commit 395a7f76822a4897bc9d0d94b746074d82e7024b.

Change-Id: I76ea45709c90daa2541ceea9e53846c22ebd5e3a

adaptors/tizen/native-render-surface-tizen.cpp

index 7af6a74acc46b06360b953ceaa464fdd7e4f7510..ab849e61a9527464249d58a57a3dbb9911647fe8 100644 (file)
@@ -170,11 +170,6 @@ void NativeRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstract
   Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
   eglImpl.SwapBuffers();
 
-  if( mImpl->mThreadSynchronization )
-  {
-    mImpl->mThreadSynchronization->PostRenderStarted();
-  }
-
   if( tbm_surface_queue_can_acquire( mImpl->mTbmQueue, 1 ) )
   {
     if( tbm_surface_queue_acquire( mImpl->mTbmQueue, &mImpl->mConsumeSurface ) != TBM_SURFACE_QUEUE_ERROR_NONE )
@@ -201,12 +196,6 @@ void NativeRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstract
     mImpl->mRenderNotification->Trigger();
   }
 
-  if( mImpl->mThreadSynchronization )
-  {
-    // wait until the event-thread completed to use the tbm_surface
-    mImpl->mThreadSynchronization->PostRenderWaitForCompletion();
-  }
-
   // release the consumed surface after post render was completed
   ReleaseDrawable();
 }
@@ -258,7 +247,8 @@ void NativeRenderSurface::CreateNativeRenderable()
 
 void NativeRenderSurface::ReleaseLock()
 {
-  if( mImpl->mThreadSynchronization )
+  ConditionalWait::ScopedLock lock( mImpl->mTbmSurfaceCondition );
+  if( mImpl->mConsumeSurface )
   {
     mImpl->mThreadSynchronization->PostRenderComplete();
   }