Revert "[Tizen] Fix rendering issue by tbm_surface and eglSwapBuffers in native rende... 24/116524/1
authorsuhyung Eom <suhyung.eom@samsung.com>
Mon, 27 Feb 2017 01:59:49 +0000 (10:59 +0900)
committersuhyung Eom <suhyung.eom@samsung.com>
Mon, 27 Feb 2017 02:00:11 +0000 (11:00 +0900)
This reverts commit 8284e920757051845c531e84efcca321bc96b34e.
Change-Id: I94d1f3fc8f36b64d7a174425c925a8ffcabe3768

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

index 1bb2f16..787507f 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();
   }