Revert "[Tizen] Add OffscreenApplication"
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / tizen-wayland / native-render-surface-ecore-wl.cpp
index 15a603e..ed5d8fb 100644 (file)
@@ -231,8 +231,6 @@ void NativeRenderSurfaceEcoreWl::StartRender()
 
 bool NativeRenderSurfaceEcoreWl::PreRender( bool resizingSurface, const std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect )
 {
-  MakeContextCurrent();
-
   auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics*>(mGraphics);
   if (eglGraphics)
   {
@@ -257,62 +255,45 @@ void NativeRenderSurfaceEcoreWl::PostRender( bool renderToFbo, bool replacingSur
     eglImpl.SwapBuffers( mEGLSurface, damagedRects );
   }
 
-  if ( mOwnSurface )
+  if( mThreadSynchronization )
   {
-    if( mThreadSynchronization )
-    {
-      mThreadSynchronization->PostRenderStarted();
-    }
-
-    if( tbm_surface_queue_can_acquire( mTbmQueue, 1 ) )
-    {
-      if( tbm_surface_queue_acquire( mTbmQueue, &mConsumeSurface ) != TBM_SURFACE_QUEUE_ERROR_NONE )
-      {
-        DALI_LOG_ERROR( "Failed to acquire a tbm_surface\n" );
-        return;
-      }
-    }
-
-    if ( mConsumeSurface )
-    {
-      tbm_surface_internal_ref( mConsumeSurface );
-    }
+    mThreadSynchronization->PostRenderStarted();
+  }
 
-    if( replacingSurface )
+  if( tbm_surface_queue_can_acquire( mTbmQueue, 1 ) )
+  {
+    if( tbm_surface_queue_acquire( mTbmQueue, &mConsumeSurface ) != TBM_SURFACE_QUEUE_ERROR_NONE )
     {
-      ConditionalWait::ScopedLock lock( mTbmSurfaceCondition );
-      mDrawableCompleted = true;
-      mTbmSurfaceCondition.Notify( lock );
+      DALI_LOG_ERROR( "Failed to acquire a tbm_surface\n" );
+      return;
     }
+  }
 
-   // create damage for client applications which wish to know the update timing
-    if( !replacingSurface && mRenderNotification )
-    {
-      // use notification trigger
-      // Tell the event-thread to render the tbm_surface
-      mRenderNotification->Trigger();
-    }
+  tbm_surface_internal_ref( mConsumeSurface );
 
-    if( mThreadSynchronization )
-    {
-      // wait until the event-thread completed to use the tbm_surface
-      mThreadSynchronization->PostRenderWaitForCompletion();
-    }
+  if( replacingSurface )
+  {
+    ConditionalWait::ScopedLock lock( mTbmSurfaceCondition );
+    mDrawableCompleted = true;
+    mTbmSurfaceCondition.Notify( lock );
+  }
 
-    // release the consumed surface after post render was completed
-    ReleaseDrawable();
+ // create damage for client applications which wish to know the update timing
+  if( !replacingSurface && mRenderNotification )
+  {
+    // use notification trigger
+    // Tell the event-thread to render the tbm_surface
+    mRenderNotification->Trigger();
   }
-  else
+
+  if( mThreadSynchronization )
   {
-    // create damage for client applications which wish to know the update timing
-    if( !replacingSurface && mRenderNotification )
-    {
-      // use notification trigger
-      // Tell the event-thread to render the tbm_surface
-      mRenderNotification->Trigger();
-    }
+    // wait until the event-thread completed to use the tbm_surface
+    mThreadSynchronization->PostRenderWaitForCompletion();
   }
 
+  // release the consumed surface after post render was completed
+  ReleaseDrawable();
 }
 
 void NativeRenderSurfaceEcoreWl::StopRender()
@@ -348,11 +329,6 @@ Integration::StencilBufferAvailable NativeRenderSurfaceEcoreWl::GetStencilBuffer
   return mGraphics ? mGraphics->GetStencilBufferRequired() : Integration::StencilBufferAvailable::FALSE;
 }
 
-Any NativeRenderSurfaceEcoreWl::GetNativeHandle()
-{
-  return mTbmQueue;
-}
-
 void NativeRenderSurfaceEcoreWl::ReleaseLock()
 {
   if( mThreadSynchronization )