Revert "[Tizen] Implement partial update"
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / ubuntu-x11 / pixmap-render-surface-ecore-x.cpp
index 03259eb..f54c3ea 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
 #include <X11/Xatom.h>
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
-
 #include <X11/extensions/Xfixes.h> // for damage notify
 #include <X11/extensions/Xdamage.h> // for damage notify
-
 #include <dali/integration-api/gl-abstraction.h>
 #include <dali/integration-api/debug.h>
 #include <dali/devel-api/threading/mutex.h>
 
 // INTERNAL INCLUDES
-#include <dali/integration-api/thread-synchronization-interface.h>
+#include <dali/integration-api/adaptor-framework/thread-synchronization-interface.h>
+#include <dali/internal/adaptor/common/adaptor-impl.h>
+#include <dali/internal/adaptor/common/adaptor-internal-services.h>
+#include <dali/internal/graphics/gles/egl-graphics.h>
 #include <dali/internal/system/common/trigger-event.h>
 #include <dali/internal/window-system/common/display-connection.h>
-#include <dali/internal/graphics/gles/egl-graphics.h>
-
 
 namespace Dali
 {
@@ -79,6 +78,8 @@ PixmapRenderSurfaceEcoreX::PixmapRenderSurfaceEcoreX( Dali::PositionSize positio
 
 PixmapRenderSurfaceEcoreX::~PixmapRenderSurfaceEcoreX()
 {
+  DestroySurface();
+
   // release the surface if we own one
   if( mOwnSurface )
   {
@@ -146,10 +147,16 @@ void PixmapRenderSurfaceEcoreX::GetDpi( unsigned int& dpiHorizontal, unsigned in
   dpiVertical   = int( yres + 0.5f );
 }
 
-void PixmapRenderSurfaceEcoreX::InitializeGraphics( GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection )
+int PixmapRenderSurfaceEcoreX::GetOrientation() const
 {
-  mGraphics = &graphics;
-  mDisplayConnection = &displayConnection;
+  return 0;
+}
+
+void PixmapRenderSurfaceEcoreX::InitializeGraphics()
+{
+  mGraphics = &mAdaptor->GetGraphicsInterface();
+  mDisplayConnection = &mAdaptor->GetDisplayConnectionInterface();
+
 
   auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
   Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
@@ -185,7 +192,7 @@ void PixmapRenderSurfaceEcoreX::DestroySurface()
     // need to cast to X handle as in 64bit system ECore handle is 32 bit whereas EGLnative and XWindow are 64 bit
     XPixmap pixmap = static_cast<XPixmap>( mX11Pixmaps[i] );
     eglImpl.MakeCurrent( EGLNativePixmapType( pixmap ), mEglSurfaces[i] );
-    eglImpl.DestroySurface();
+    eglImpl.DestroySurface( mEglSurfaces[i] );
   }
 }
 
@@ -307,9 +314,13 @@ void PixmapRenderSurfaceEcoreX::ReleaseLock()
   }
 }
 
-RenderSurface::Type PixmapRenderSurfaceEcoreX::GetSurfaceType()
+Integration::RenderSurface::Type PixmapRenderSurfaceEcoreX::GetSurfaceType()
+{
+  return Integration::RenderSurface::PIXMAP_RENDER_SURFACE;
+}
+
+void PixmapRenderSurfaceEcoreX::MakeContextCurrent()
 {
-  return RenderSurface::PIXMAP_RENDER_SURFACE;
 }
 
 void PixmapRenderSurfaceEcoreX::CreateRenderable()