Revert "[Tizen] Fix rendering issue by tbm_surface and eglSwapBuffers in native rende... 36/131736/1
authorJinho, Lee <jeano.lee@samsung.com>
Tue, 30 May 2017 08:42:16 +0000 (17:42 +0900)
committerJinho, Lee <jeano.lee@samsung.com>
Tue, 30 May 2017 08:42:18 +0000 (17:42 +0900)
This reverts commit c64a656cfc30a3be11f32a1f79ccb0879689784c.

Change-Id: Ia86b7ea00b7e90b768f5ffdaa5f94e951de12764

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();
   }