From: Chandan Padhi Date: Wed, 13 May 2015 13:34:19 +0000 (+0530) Subject: [M40 Merge][WAYLAND_BRINGUP] Display size for Wayland X-Git-Tag: submit/tizen/20201118.160233~869 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7f2e71df86405c87b0b8cb45d49c993ccc2456e6;p=platform%2Fframework%2Fweb%2Fchromium-efl.git [M40 Merge][WAYLAND_BRINGUP] Display size for Wayland This patch gets the display width and height using ecore_wl_screen_size_get(). Bug: http://web.sec.samsung.net/bugzilla/show_bug.cgi?id=12492 Reviewed by: Antonio Gomes, DaeHyun Ko Change-Id: Idef09cfcd18eb091bd66387dc53808dd955381cf Signed-off-by: Chandan Padhi --- diff --git a/tizen_src/chromium_impl/ui/gfx/screen_efl.cc b/tizen_src/chromium_impl/ui/gfx/screen_efl.cc index bf0949c..2736226 100644 --- a/tizen_src/chromium_impl/ui/gfx/screen_efl.cc +++ b/tizen_src/chromium_impl/ui/gfx/screen_efl.cc @@ -4,9 +4,7 @@ #include "ui/gfx/screen_efl.h" -#if !defined(WAYLAND_BRINGUP) -#include -#endif +#include "ecore_x_wayland_wrapper.h" #include "content/browser/renderer_host/dip_util.h" #include "ui/gfx/screen_type_delegate.h" @@ -75,13 +73,6 @@ class ScreenEfl : public gfx::Screen { } gfx::Display GetPrimaryDisplay() const override { - // TODO: Rendering TG will implement following for Wayland. -#if !defined(WAYLAND_BRINGUP) - Ecore_X_Screen* screen = ecore_x_default_screen_get(); -#else - NOTIMPLEMENTED(); -#endif - const float device_scale_factor = gfx::Display::HasForceDeviceScaleFactor() ? gfx::Display::GetForcedDeviceScaleFactor() : kDefaultDeviceScaleFactor; @@ -96,16 +87,24 @@ class ScreenEfl : public gfx::Screen { #endif int width, height; - // TODO: Rendering TG will implement following for Wayland. -#if !defined(WAYLAND_BRINGUP) +#if defined(USE_WAYLAND) if (display.rotation() == gfx::Display::ROTATE_90 || display.rotation() == gfx::Display::ROTATE_270) { - ecore_x_screen_size_get(screen, &height, &width); - } else { - ecore_x_screen_size_get(screen, &width, &height); + ecore_wl_screen_size_get(&height, &width); + } + else { + ecore_wl_screen_size_get(&width, &height); } #else - NOTIMPLEMENTED(); + Ecore_X_Screen* screen = ecore_x_default_screen_get(); + + if (display.rotation() == gfx::Display::ROTATE_90 || + display.rotation() == gfx::Display::ROTATE_270) { + ecore_x_screen_size_get(screen, &height, &width); + } + else { + ecore_x_screen_size_get(screen, &width, &height); + } #endif const gfx::Rect bounds_in_pixels = gfx::Rect(width, height);