derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=84f703cf675315f5ef90f3ffc46db2cc3234fce6

commit 84f703cf675315f5ef90f3ffc46db2cc3234fce6
Author: Derek Foreman <[email protected]>
Date:   Thu Jan 25 14:37:16 2018 -0600

    ecore_wl2: Call check function through a pointer
    
    We'll need this in the function array when we make surface managers
    modular.
---
 src/lib/ecore_wl2/ecore_wl2_private.h |  1 +
 src/lib/ecore_wl2/ecore_wl2_surface.c | 12 +++++++-----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/lib/ecore_wl2/ecore_wl2_private.h 
b/src/lib/ecore_wl2/ecore_wl2_private.h
index 6ec509e9c4..4640d6f41f 100644
--- a/src/lib/ecore_wl2/ecore_wl2_private.h
+++ b/src/lib/ecore_wl2/ecore_wl2_private.h
@@ -564,6 +564,7 @@ typedef struct _Ecore_Wl2_Surface
    Eina_Bool alpha : 1;
    struct
      {
+        Eina_Bool (*check)(Ecore_Wl2_Window *win);
         void (*destroy)(Ecore_Wl2_Surface *surface);
         void (*reconfigure)(Ecore_Wl2_Surface *surface, int w, int h, uint32_t 
flags, Eina_Bool force);
         void *(*data_get)(Ecore_Wl2_Surface *surface, int *w, int *h);
diff --git a/src/lib/ecore_wl2/ecore_wl2_surface.c 
b/src/lib/ecore_wl2/ecore_wl2_surface.c
index de10b8ad5f..9ee1df9695 100644
--- a/src/lib/ecore_wl2/ecore_wl2_surface.c
+++ b/src/lib/ecore_wl2/ecore_wl2_surface.c
@@ -245,18 +245,20 @@ ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool 
alpha)
    out->w = 0;
    out->h = 0;
 
-   if (!_evas_dmabuf_surface_check(win)) goto err;
-
+   out->funcs.check = _evas_dmabuf_surface_check;
    out->funcs.destroy = _evas_dmabuf_surface_destroy;
    out->funcs.reconfigure = _evas_dmabuf_surface_reconfigure;
    out->funcs.data_get = _evas_dmabuf_surface_data_get;
    out->funcs.assign = _evas_dmabuf_surface_assign;
    out->funcs.post = _evas_dmabuf_surface_post;
    out->funcs.flush = _surface_flush;
-   win->wl2_surface = out;
-   return out;
 
-err:
+   if (out->funcs.check(win))
+     {
+        win->wl2_surface = out;
+        return out;
+     }
+
    free(out);
    return NULL;
 }

-- 


Reply via email to