[3.0] Fix rendering issue by tbm_surface and eglSwapBuffers in native render surface 14/91814/1 accepted/tizen/3.0/ivi/20161028.133854 accepted/tizen/3.0/mobile/20161028.132950 accepted/tizen/3.0/tv/20161028.133313 accepted/tizen/3.0/wearable/20161028.133613 accepted/tizen/common/20161014.103225 accepted/tizen/ivi/20161017.013531 accepted/tizen/mobile/20161017.013324 accepted/tizen/tv/20161017.013419 accepted/tizen/wearable/20161017.013456 submit/tizen/20161014.094936 submit/tizen_3.0/20161028.062323 submit/tizen_3.0/20161028.082423 submit/tizen_3.0_common/20161104.104000
authortaeyoon <taeyoon0.lee@samsung.com>
Tue, 11 Oct 2016 12:43:23 +0000 (21:43 +0900)
committertaeyoon <taeyoon0.lee@samsung.com>
Tue, 11 Oct 2016 12:46:39 +0000 (21:46 +0900)
Change-Id: Ice50f3df18d078672ac3f420f0eebb98c4e6b1b8

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

index a205f2e..3799b0e 100644 (file)
@@ -186,10 +186,9 @@ void NativeRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstract
   Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
   eglImpl.SwapBuffers();
 
-  // flush gl instruction queue
-  glAbstraction.Flush();
-
   {
+    ConditionalWait::ScopedLock lock( mImpl->mTbmSurfaceCondition );
+
     if( tbm_surface_queue_can_acquire( mImpl->mTbmQueue, 1 ) )
     {
       if( tbm_surface_queue_acquire( mImpl->mTbmQueue, &mImpl->mConsumeSurface ) != TBM_SURFACE_QUEUE_ERROR_NONE )
@@ -204,14 +203,9 @@ void NativeRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstract
   if( mImpl->mRenderNotification )
   {
     // use notification trigger
-    // Tell the event-thread to render the pixmap
+    // Tell the event-thread to render the tbm_surface
     mImpl->mRenderNotification->Trigger();
   }
-  else
-  {
-    // FIXME
-  }
-
 }
 
 void NativeRenderSurface::StopRender()
@@ -261,6 +255,7 @@ void NativeRenderSurface::CreateNativeRenderable()
 
 void NativeRenderSurface::ReleaseSurface()
 {
+  ConditionalWait::ScopedLock lock( mImpl->mTbmSurfaceCondition );
   if( mImpl->mConsumeSurface )
   {
     tbm_surface_queue_release( mImpl->mTbmQueue, mImpl->mConsumeSurface );