#include "ui/gfx/screen_efl.h"
-#if !defined(WAYLAND_BRINGUP)
-#include <Ecore_X.h>
-#endif
+#include "ecore_x_wayland_wrapper.h"
#include "content/browser/renderer_host/dip_util.h"
#include "ui/gfx/screen_type_delegate.h"
}
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;
#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);