#include <dali/integration-api/debug.h>
// INTERNAL HEADERS
-#include <pixmap-render-surface.h>
+#include <native-render-surface.h>
namespace Dali
{
}
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()
{
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;
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