X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fwindow-system%2Ftizen-wayland%2Fdisplay-connection-impl-ecore-wl.cpp;h=a445c5c0fcb7dd7535fc364c0b0e5b330ac0a2b9;hb=70189749d12fc175c530b8d852386e1c13088fbd;hp=42ffab6aeb90266934e37b4cced56f932a579666;hpb=761f75cd51351b7a4e072130f4a2ad0b3e3231bb;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/window-system/tizen-wayland/display-connection-impl-ecore-wl.cpp b/dali/internal/window-system/tizen-wayland/display-connection-impl-ecore-wl.cpp old mode 100644 new mode 100755 index 42ffab6..a445c5c --- a/dali/internal/window-system/tizen-wayland/display-connection-impl-ecore-wl.cpp +++ b/dali/internal/window-system/tizen-wayland/display-connection-impl-ecore-wl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 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. @@ -17,13 +17,17 @@ // CLASS HEADER #include +#include // EXTERNAL_HEADERS -#include +#include #include -// INTERNAL HEADERS -#include +#ifdef ECORE_WAYLAND2 +#include +#else +#include +#endif namespace Dali { @@ -43,13 +47,14 @@ DisplayConnection* DisplayConnectionEcoreWl::New() DisplayConnectionEcoreWl::DisplayConnectionEcoreWl() : mDisplay( NULL ), - mSurfaceType( RenderSurface::ECORE_RENDER_SURFACE ) + mSurfaceType( Integration::RenderSurface::WINDOW_RENDER_SURFACE ), + mGraphics( nullptr ) { } DisplayConnectionEcoreWl::~DisplayConnectionEcoreWl() { - if( mSurfaceType == RenderSurface::NATIVE_RENDER_SURFACE ) + if( mSurfaceType == Integration::RenderSurface::NATIVE_RENDER_SURFACE ) { ReleaseNativeDisplay(); } @@ -64,9 +69,10 @@ void DisplayConnectionEcoreWl::ConsumeEvents() { } -bool DisplayConnectionEcoreWl::InitializeEgl(EglInterface& egl) +bool DisplayConnectionEcoreWl::InitializeGraphics() { - EglImplementation& eglImpl = static_cast(egl); + auto eglGraphics = static_cast(mGraphics); + EglImplementation& eglImpl = eglGraphics->GetEglImplementation(); if( !eglImpl.InitializeGles( mDisplay ) ) { @@ -77,41 +83,41 @@ bool DisplayConnectionEcoreWl::InitializeEgl(EglInterface& egl) return true; } -void DisplayConnectionEcoreWl::SetSurfaceType( RenderSurface::Type type ) +void DisplayConnectionEcoreWl::SetSurfaceType( Integration::RenderSurface::Type type ) { mSurfaceType = type; - if( mSurfaceType == RenderSurface::NATIVE_RENDER_SURFACE ) + if( mSurfaceType == Integration::RenderSurface::NATIVE_RENDER_SURFACE ) { mDisplay = GetNativeDisplay(); } else { +#ifdef ECORE_WAYLAND2 + Ecore_Wl2_Display* display = ecore_wl2_connected_display_get( NULL ); + mDisplay = reinterpret_cast< EGLNativeDisplayType >( ecore_wl2_display_get( display ) ); +#else mDisplay = reinterpret_cast< EGLNativeDisplayType >( ecore_wl_display_get() ); +#endif } } -void DisplayConnectionEcoreWl::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical) +void DisplayConnectionEcoreWl::SetGraphicsInterface( GraphicsInterface& graphics ) { - // calculate DPI - float xres, yres; - - // 1 inch = 25.4 millimeters - xres = ecore_wl_dpi_get(); - yres = ecore_wl_dpi_get(); - - dpiHorizontal = int(xres + 0.5f); // rounding - dpiVertical = int(yres + 0.5f); + mGraphics = &graphics; } EGLNativeDisplayType DisplayConnectionEcoreWl::GetNativeDisplay() { - return EGLNativeDisplayType(); + return reinterpret_cast< EGLNativeDisplayType >( tbm_dummy_display_create() ); } void DisplayConnectionEcoreWl::ReleaseNativeDisplay() { - + if( mDisplay ) + { + tbm_dummy_display_destroy( reinterpret_cast< tbm_dummy_display* >( mDisplay ) ); + } } } // namespace Adaptor