Revert "[Tizen] Fix rendering issue by tbm_surface and eglSwapBuffers in native rende... 95/113795/1
authorminho.sun <minho.sun@samsung.com>
Thu, 9 Feb 2017 01:58:26 +0000 (10:58 +0900)
committerminho.sun <minho.sun@samsung.com>
Thu, 9 Feb 2017 01:59:04 +0000 (10:59 +0900)
This reverts commit 8bf75ce3ab39c80b0ae732f3670c3b4ae214f6e9.

Change-Id: Ic7444d428017c6db5d29fb23669a647f731db82b

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

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