Revert "[Tizen] Revert "Support multiple window rendering""
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / ubuntu-x11 / display-connection-impl-x.cpp
index b003cd1..ba1af14 100644 (file)
@@ -24,6 +24,7 @@
 
 // INTERNAL HEADERS
 #include <dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h>
+#include <dali/internal/graphics/gles/egl-graphics.h>
 
 namespace Dali
 {
@@ -43,7 +44,8 @@ DisplayConnection* DisplayConnectionX11::New()
 }
 
 DisplayConnectionX11::DisplayConnectionX11()
-: mDisplay(NULL)
+: mGraphics( nullptr ),
+  mDisplay( nullptr )
 {
 }
 
@@ -81,9 +83,10 @@ void DisplayConnectionX11::ConsumeEvents()
   while (events > 0);
 }
 
-bool DisplayConnectionX11::InitializeEgl(EglInterface& egl)
+bool DisplayConnectionX11::InitializeGraphics()
 {
-  EglImplementation& eglImpl = static_cast<EglImplementation&>(egl);
+  auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+  EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
 
   if (!eglImpl.InitializeGles(reinterpret_cast<EGLNativeDisplayType>(mDisplay)))
   {
@@ -94,15 +97,20 @@ bool DisplayConnectionX11::InitializeEgl(EglInterface& egl)
   return true;
 }
 
-void DisplayConnectionX11::SetSurfaceType( RenderSurface::Type type )
+void DisplayConnectionX11::SetSurfaceType( Integration::RenderSurface::Type type )
 {
-  if( type == RenderSurface::WINDOW_RENDER_SURFACE )
+  if( type == Integration::RenderSurface::WINDOW_RENDER_SURFACE )
   {
     // Because of DDK issue, we need to use separated x display instead of ecore default display
     mDisplay = XOpenDisplay(0);
   }
 }
 
+void DisplayConnectionX11::SetGraphicsInterface( GraphicsInterface& graphics )
+{
+  mGraphics = &graphics;
+}
+
 } // namespace Adaptor
 
 } // namespace Internal