From 4260d5d3a2aa47a24cdd5afff1fb6741ad1e8cc5 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Wed, 2 Nov 2016 07:41:33 -0500 Subject: [PATCH] ecore_evas_wayland: Make resize code common Brings resize code into the common implementation - there is a functional change. There appears to have been a bug in the egl resize where it used the same w, h order for portrait evases as for landscape. This was fixed in shm. I've used the shm variant for the common code. --- .../wayland/ecore_evas_wayland_common.c | 31 +++++++++++++------ .../engines/wayland/ecore_evas_wayland_egl.c | 29 ----------------- .../wayland/ecore_evas_wayland_private.h | 10 ------ .../engines/wayland/ecore_evas_wayland_shm.c | 29 ----------------- 4 files changed, 21 insertions(+), 78 deletions(-) diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c index 80b1ff9ae2..260c17c17b 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c @@ -1790,21 +1790,32 @@ _ecore_evas_wl_common_screen_dpi_get(const Ecore_Evas *ee EINA_UNUSED, int *xdpi if (ydpi) *ydpi = dpi; } +static void +_ecore_evas_wayland_resize_edge_set(Ecore_Evas *ee, int edge) +{ + Evas_Engine_Info_Wayland *einfo; + + if ((einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas))) + einfo->info.edges = edge; +} + static void _ecore_evas_wayland_resize(Ecore_Evas *ee, int location) { + Ecore_Evas_Engine_Wl_Data *wdata; + + LOGFN(__FILE__, __LINE__, __FUNCTION__); + if (!ee) return; - if (!strcmp(ee->driver, "wayland_shm")) + wdata = ee->engine.data; + if (wdata->win) { -#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM - _ecore_evas_wayland_shm_resize(ee, location); -#endif - } - else if (!strcmp(ee->driver, "wayland_egl")) - { -#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL - _ecore_evas_wayland_egl_resize(ee, location); -#endif + _ecore_evas_wayland_resize_edge_set(ee, location); + + if (ECORE_EVAS_PORTRAIT(ee)) + ecore_wl2_window_resize(wdata->win, ee->w, ee->h, location); + else + ecore_wl2_window_resize(wdata->win, ee->h, ee->w, location); } } diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c index 366c7d20c8..631e603e92 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_egl.c @@ -442,33 +442,4 @@ conn_err: return NULL; } -void -_ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location) -{ - Ecore_Evas_Engine_Wl_Data *wdata; - - LOGFN(__FILE__, __LINE__, __FUNCTION__); - - if (!ee) return; - wdata = ee->engine.data; - if (wdata->win) - { - _ecore_evas_wayland_egl_resize_edge_set(ee, location); - - if (ECORE_EVAS_PORTRAIT(ee)) - ecore_wl2_window_resize(wdata->win, ee->w, ee->h, location); - else - ecore_wl2_window_resize(wdata->win, ee->w, ee->h, location); - } -} - -void -_ecore_evas_wayland_egl_resize_edge_set(Ecore_Evas *ee, int edge) -{ - Evas_Engine_Info_Wayland *einfo; - - if ((einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas))) - einfo->info.edges = edge; -} - #endif diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h index eb4a4c56e3..89c84a0325 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_private.h @@ -110,14 +110,4 @@ void _ecore_evas_wl_common_pointer_xy_get(const Ecore_Evas *ee, Evas_Coord *x, E extern Eina_List *ee_list; -#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM -void _ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location); -void _ecore_evas_wayland_shm_resize_edge_set(Ecore_Evas *ee, int edge); -#endif - -#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL -void _ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location); -void _ecore_evas_wayland_egl_resize_edge_set(Ecore_Evas *ee, int edge); -#endif - #endif /* _ECORE_EVAS_WAYLAND_PRIVATE_H_ */ diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c index 662912a5f2..c6cdb77c78 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c @@ -371,33 +371,4 @@ conn_err: return NULL; } -void -_ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location) -{ - Ecore_Evas_Engine_Wl_Data *wdata; - - LOGFN(__FILE__, __LINE__, __FUNCTION__); - - if (!ee) return; - wdata = ee->engine.data; - if (wdata->win) - { - _ecore_evas_wayland_shm_resize_edge_set(ee, location); - - if (ECORE_EVAS_PORTRAIT(ee)) - ecore_wl2_window_resize(wdata->win, ee->w, ee->h, location); - else - ecore_wl2_window_resize(wdata->win, ee->h, ee->w, location); - } -} - -void -_ecore_evas_wayland_shm_resize_edge_set(Ecore_Evas *ee, int edge) -{ - Evas_Engine_Info_Wayland *einfo; - - if ((einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas))) - einfo->info.edges = edge; -} - #endif