Revert "[Tizen] Add screen and client rotation itself function"
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / tizen-wayland / native-render-surface-ecore-wl.cpp
index 876e989..48069c7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -142,11 +142,6 @@ void NativeRenderSurfaceEcoreWl::GetDpi( unsigned int& dpiHorizontal, unsigned i
   dpiVertical   = int( yres + 0.5f );
 }
 
-int NativeRenderSurfaceEcoreWl::GetOrientation() const
-{
-  return 0;
-}
-
 void NativeRenderSurfaceEcoreWl::InitializeGraphics()
 {
   DALI_LOG_TRACE_METHOD( gNativeSurfaceLogFilter );
@@ -221,20 +216,30 @@ void NativeRenderSurfaceEcoreWl::StartRender()
 {
 }
 
-bool NativeRenderSurfaceEcoreWl::PreRender( bool )
+bool NativeRenderSurfaceEcoreWl::PreRender( bool resizingSurface, const std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect )
 {
-  // nothing to do for pixmaps
+  auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics*>(mGraphics);
+  if (eglGraphics)
+  {
+    Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
+    if (resizingSurface)
+    {
+      eglImpl.SetFullSwapNextFrame();
+    }
+
+    eglImpl.SetDamage(mEGLSurface, damagedRects, clippingRect);
+  }
+
   return true;
 }
 
-void NativeRenderSurfaceEcoreWl::PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface )
+void NativeRenderSurfaceEcoreWl::PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface, const std::vector<Rect<int>>& damagedRects )
 {
   auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics *>(mGraphics);
-  if ( eglGraphics )
+  if (eglGraphics)
   {
     Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
-
-    eglImpl.SwapBuffers( mEGLSurface );
+    eglImpl.SwapBuffers( mEGLSurface, damagedRects );
   }
 
   if( mThreadSynchronization )
@@ -288,9 +293,9 @@ void NativeRenderSurfaceEcoreWl::SetThreadSynchronization( ThreadSynchronization
   mThreadSynchronization = &threadSynchronization;
 }
 
-Integration::RenderSurface::Type NativeRenderSurfaceEcoreWl::GetSurfaceType()
+Dali::RenderSurfaceInterface::Type NativeRenderSurfaceEcoreWl::GetSurfaceType()
 {
-  return Integration::RenderSurface::NATIVE_RENDER_SURFACE;
+  return Dali::RenderSurfaceInterface::NATIVE_RENDER_SURFACE;
 }
 
 void NativeRenderSurfaceEcoreWl::MakeContextCurrent()