[Tizen] Fix rendering issue by tbm_surface and eglSwapBuffers in native render surface 02/113802/1
authorminho.sun <minho.sun@samsung.com>
Thu, 9 Feb 2017 02:03:56 +0000 (11:03 +0900)
committerminho.sun <minho.sun@samsung.com>
Thu, 9 Feb 2017 02:04:16 +0000 (11:04 +0900)
This reverts commit eb413915eccec5f6884df987fce51374e39f7547.

Change-Id: I9146c568ea580afcec0a3ee3e27bc3e0d983718b

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

index 787507fd35f3895256b81b0375253b059cd3af8f..1bb2f160cf8e23be0daf934fb05d81245ec9d571 100644 (file)
@@ -169,11 +169,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 )
@@ -200,12 +195,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();
 }
@@ -257,7 +246,8 @@ void NativeRenderSurface::CreateNativeRenderable()
 
 void NativeRenderSurface::ReleaseLock()
 {
-  if( mImpl->mThreadSynchronization )
+  ConditionalWait::ScopedLock lock( mImpl->mTbmSurfaceCondition );
+  if( mImpl->mConsumeSurface )
   {
     mImpl->mThreadSynchronization->PostRenderComplete();
   }