Revert "[Tizen] Add key grab list API"
[platform/core/uifw/dali-adaptor.git] / adaptors / ecore / wayland / display-connection-impl-ecore-wl.cpp
index 49d293c..64d9389 100644 (file)
@@ -23,7 +23,7 @@
 #include <dali/integration-api/debug.h>
 
 // INTERNAL HEADERS
-#include <pixmap-render-surface.h>
+#include <native-render-surface.h>
 
 namespace Dali
 {
@@ -42,19 +42,22 @@ DisplayConnection* DisplayConnection::New()
 }
 
 DisplayConnection::DisplayConnection()
-: mDisplay(NULL)
+: mDisplay( NULL ),
+  mSurfaceType( RenderSurface::ECORE_RENDER_SURFACE )
 {
-  mDisplay = ecore_wl_display_get();
 }
 
 DisplayConnection::~DisplayConnection()
 {
-  //FIXME
+  if( mSurfaceType == RenderSurface::NATIVE_RENDER_SURFACE )
+  {
+    ReleaseNativeDisplay();
+  }
 }
 
 Any DisplayConnection::GetDisplay()
 {
-  return Any(mDisplay);
+  return Any( mDisplay );
 }
 
 void DisplayConnection::ConsumeEvents()
@@ -65,7 +68,7 @@ bool DisplayConnection::InitializeEgl(EglInterface& egl)
 {
   EglImplementation& eglImpl = static_cast<EglImplementation&>(egl);
 
-  if (!eglImpl.InitializeGles(reinterpret_cast<EGLNativeDisplayType>(mDisplay)))
+  if( !eglImpl.InitializeGles( mDisplay ) )
   {
     DALI_LOG_ERROR("Failed to initialize GLES.\n");
     return false;
@@ -74,6 +77,20 @@ bool DisplayConnection::InitializeEgl(EglInterface& egl)
   return true;
 }
 
+void DisplayConnection::SetSurfaceType( RenderSurface::Type type )
+{
+  mSurfaceType = type;
+
+  if( mSurfaceType == RenderSurface::NATIVE_RENDER_SURFACE )
+  {
+    mDisplay = GetNativeDisplay();
+  }
+  else
+  {
+    mDisplay = reinterpret_cast< EGLNativeDisplayType >( ecore_wl_display_get() );
+  }
+}
+
 void DisplayConnection::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical)
 {
   // calculate DPI