Revert "[Tizen] Fix rendering issue by tbm_surface and eglSwapBuffers in native rende... 59/137159/1
authorJinho, Lee <jeano.lee@samsung.com>
Tue, 4 Jul 2017 05:52:06 +0000 (14:52 +0900)
committerJinho, Lee <jeano.lee@samsung.com>
Tue, 4 Jul 2017 05:52:06 +0000 (14:52 +0900)
This reverts commit c62a0e8db89b1833de96b9a285f5d256c1363b6a.

Change-Id: I426090620c8327b4fc40f92838848b55f8bcd743

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

index ab849e6..7af6a74 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();
   }