[Tizen] Fix rendering issue by tbm_surface and eglSwapBuffers in native render surface 89/118589/1
authortaeyoon0.lee <taeyoon0.lee@samsung.com>
Mon, 13 Mar 2017 08:12:00 +0000 (17:12 +0900)
committertaeyoon0.lee <taeyoon0.lee@samsung.com>
Mon, 13 Mar 2017 08:12:23 +0000 (17:12 +0900)
This reverts commit 4efe850b068e4fcaefbbe803ed2954db2f8ce2da.

Change-Id: I909fb1dc3b4af352e6cb3e5c59b6728ee31c46a7

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

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