Revert "[Tizen] Fix rendering issue by tbm_surface and eglSwapBuffers in native rende... 98/123998/1
authorminho.sun <minho.sun@samsung.com>
Mon, 10 Apr 2017 01:59:47 +0000 (10:59 +0900)
committerminho.sun <minho.sun@samsung.com>
Mon, 10 Apr 2017 01:59:49 +0000 (10:59 +0900)
This reverts commit eee34b6ab4d214b0159d5658ac1ea061e90b599e.

Change-Id: I4dff8e3b54a9b356cd12e24744411ef1b734a9e9

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

index 43678c73e9128af191918aa02e65a9090b5da3ef..e02822d1ee73f530cc716fc62c251156f6aece5b 100644 (file)
@@ -170,6 +170,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 )
@@ -196,6 +201,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();
 }
@@ -247,8 +258,7 @@ void NativeRenderSurface::CreateNativeRenderable()
 
 void NativeRenderSurface::ReleaseLock()
 {
-  ConditionalWait::ScopedLock lock( mImpl->mTbmSurfaceCondition );
-  if( mImpl->mConsumeSurface )
+  if( mImpl->mThreadSynchronization )
   {
     mImpl->mThreadSynchronization->PostRenderComplete();
   }