derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=388f8c41c88658ed8d2ae10bcec28a2b0d9a720e

commit 388f8c41c88658ed8d2ae10bcec28a2b0d9a720e
Author: Derek Foreman <der...@osg.samsung.com>
Date:   Wed Aug 30 12:22:49 2017 -0500

    wayland: Store Ecore_Wl2_Display instead of wl_display in engines
    
    We'll need to call ecore_wl2 functions on it soon, and anything that
    really needs the wl_display can query it.
---
 .../ecore_evas/engines/wayland/ecore_evas_wayland_common.c    |  6 +++---
 src/modules/evas/engines/wayland_common/Evas_Engine_Wayland.h |  2 +-
 src/modules/evas/engines/wayland_egl/evas_engine.c            |  4 ++--
 src/modules/evas/engines/wayland_egl/evas_engine.h            |  2 +-
 src/modules/evas/engines/wayland_egl/evas_wl_main.c           | 11 ++++++-----
 src/modules/evas/engines/wayland_shm/evas_dmabuf.c            |  2 +-
 6 files changed, 14 insertions(+), 13 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 fe45f8a0d4..6c806765f1 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
@@ -187,7 +187,7 @@ _ee_display_unset(Ecore_Evas *ee)
    einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas);
    if (!einfo) return;
 
-   einfo->info.wl_display = NULL;
+   einfo->info.wl2_display = NULL;
    einfo->info.wl2_win = NULL;
 
    wdata = ee->engine.data;
@@ -2165,7 +2165,7 @@ _ee_cb_sync_done(void *data, int type EINA_UNUSED, void 
*event EINA_UNUSED)
 
    if ((einfo = (Evas_Engine_Info_Wayland *)evas_engine_info_get(ee->evas)))
      {
-        einfo->info.wl_display = ecore_wl2_display_get(wdata->display);
+        einfo->info.wl2_display = wdata->display;
         einfo->info.wl_dmabuf = ecore_wl2_display_dmabuf_get(wdata->display);
         einfo->info.wl_shm = ecore_wl2_display_shm_get(wdata->display);
         einfo->info.compositor_version =
@@ -2468,7 +2468,7 @@ _ecore_evas_wl_common_new_internal(const char *disp_name, 
unsigned int parent, i
         wdata->sync_done = EINA_TRUE;
         if ((einfo = (Evas_Engine_Info_Wayland 
*)evas_engine_info_get(ee->evas)))
           {
-             einfo->info.wl_display = ecore_wl2_display_get(ewd);
+             einfo->info.wl2_display = ewd;
              einfo->info.destination_alpha = EINA_TRUE;
              einfo->info.rotation = ee->rotation;
              einfo->info.depth = 32;
diff --git a/src/modules/evas/engines/wayland_common/Evas_Engine_Wayland.h 
b/src/modules/evas/engines/wayland_common/Evas_Engine_Wayland.h
index 7be7e2e9c9..c2c0b53b35 100644
--- a/src/modules/evas/engines/wayland_common/Evas_Engine_Wayland.h
+++ b/src/modules/evas/engines/wayland_common/Evas_Engine_Wayland.h
@@ -17,7 +17,7 @@ struct _Evas_Engine_Info_Wayland
         /* the wayland shm object used to create new shm pool */
         struct wl_shm *wl_shm;
         struct zwp_linux_dmabuf_v1 *wl_dmabuf;
-        struct wl_display *wl_display;
+        Ecore_Wl2_Display *wl2_display;
         Ecore_Wl2_Window *wl2_win;
         int depth, rotation, edges;
         int compositor_version;
diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c 
b/src/modules/evas/engines/wayland_egl/evas_engine.c
index c640f6ccd0..4455aebebf 100644
--- a/src/modules/evas/engines/wayland_egl/evas_engine.c
+++ b/src/modules/evas/engines/wayland_egl/evas_engine.c
@@ -659,7 +659,7 @@ eng_output_update(void *engine EINA_UNUSED, void *data, 
void *info, unsigned int
    if (ob)
      {
         ob->info = inf;
-        if ((ob->info->info.wl_display != ob->disp) ||
+        if ((ob->info->info.wl2_display != ob->wl2_disp) ||
             (ob->info->info.wl2_win != ob->wl2_win) ||
             /* FIXME: comment out below line.
              * since there is no place set the info->info.win for now,
@@ -672,7 +672,7 @@ eng_output_update(void *engine EINA_UNUSED, void *data, 
void *info, unsigned int
              Render_Output_Swap_Mode swap_mode = MODE_AUTO;
 
              gl_wins--;
-             if (!ob->info->info.wl_display)
+             if (!ob->info->info.wl2_display)
                {
                   eng_window_free(ob);
                   re->generic.software.ob = NULL;
diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.h 
b/src/modules/evas/engines/wayland_egl/evas_engine.h
index 49218a9121..bab7cad7c9 100644
--- a/src/modules/evas/engines/wayland_egl/evas_engine.h
+++ b/src/modules/evas/engines/wayland_egl/evas_engine.h
@@ -55,7 +55,7 @@ extern int _evas_engine_wl_egl_log_dom;
 
 struct _Outbuf
 {
-   struct wl_display *disp;
+   Ecore_Wl2_Display *wl2_disp;
    struct wl_egl_window *win;
    Ecore_Wl2_Window *wl2_win;
    int w, h;
diff --git a/src/modules/evas/engines/wayland_egl/evas_wl_main.c 
b/src/modules/evas/engines/wayland_egl/evas_wl_main.c
index a865502e97..b0249961ca 100644
--- a/src/modules/evas/engines/wayland_egl/evas_wl_main.c
+++ b/src/modules/evas/engines/wayland_egl/evas_wl_main.c
@@ -18,6 +18,7 @@ eng_window_new(Evas_Engine_Info_Wayland *einfo, int w, int h, 
Render_Output_Swap
    int num_config, n = 0;
    const GLubyte *vendor, *renderer, *version;
    Eina_Bool blacklist = EINA_FALSE;
+   struct wl_display *wl_disp;
 
    /* try to allocate space for our window */
    if (!(gw = calloc(1, sizeof(Outbuf))))
@@ -28,11 +29,11 @@ eng_window_new(Evas_Engine_Info_Wayland *einfo, int w, int 
h, Render_Output_Swap
    gw->w = w;
    gw->h = h;
    gw->swap_mode = swap_mode;
-   gw->disp = einfo->info.wl_display;
+   gw->wl2_disp = einfo->info.wl2_display;
    gw->wl2_win = einfo->info.wl2_win;
-   if (display && (display != gw->disp))
+   if (display && (display != ecore_wl2_display_get(gw->wl2_disp)))
      context = EGL_NO_CONTEXT;
-   display = gw->disp;
+   display = ecore_wl2_display_get(gw->wl2_disp);
    gw->depth = einfo->info.depth;
    gw->alpha = einfo->info.destination_alpha;
    gw->rot = einfo->info.rotation;
@@ -71,8 +72,8 @@ eng_window_new(Evas_Engine_Info_Wayland *einfo, int w, int h, 
Render_Output_Swap
     */
 
    setenv("EGL_PLATFORM", "wayland", 1);
-
-   gw->egl_disp = eglGetDisplay((EGLNativeDisplayType)gw->disp);
+   wl_disp = ecore_wl2_display_get(gw->wl2_disp);
+   gw->egl_disp = eglGetDisplay((EGLNativeDisplayType)wl_disp);
    if (!gw->egl_disp)
      {
         ERR("eglGetDisplay() fail. code=%#x", eglGetError());
diff --git a/src/modules/evas/engines/wayland_shm/evas_dmabuf.c 
b/src/modules/evas/engines/wayland_shm/evas_dmabuf.c
index ce408210c1..e06b11e3d7 100644
--- a/src/modules/evas/engines/wayland_shm/evas_dmabuf.c
+++ b/src/modules/evas/engines/wayland_shm/evas_dmabuf.c
@@ -790,7 +790,7 @@ _evas_dmabuf_surface_create(Surface *s, int w, int h, int 
num_buff)
    surf = s->surf.dmabuf;
 
    surf->surface = s;
-   surf->wl_display = s->info->info.wl_display;
+   surf->wl_display = ecore_wl2_display_get(s->info->info.wl2_display);
    surf->dmabuf = s->info->info.wl_dmabuf;
    surf->alpha = s->info->info.destination_alpha;
    surf->compositor_version = s->info->info.compositor_version;

-- 


Reply via email to