jpeg pushed a commit to branch master.

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

commit cf2804a220c492674b219c2db65b18a502083aff
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Mon Apr 4 14:26:20 2016 +0900

    Evas x11: Fix warnings and invalid calls in engine
    
    This follows commit f10672dd7429dd98dd3b7d88d9c3c63aac392a40
    which apparently forgot some changes in xlib and eglfs.
    
    I hope there are no remains of the old native bind/unbind
    functions. Also... I can't build everything, so I'm just hoping
    this works. Note: GL and SW native images are not using the
    same internal api prototypes.
---
 src/modules/evas/engines/eglfs/evas_engine.c       | 24 ++++++++--------------
 .../evas/engines/software_x11/evas_xcb_image.c     | 16 +++++++--------
 .../engines/software_x11/evas_xlib_dri_image.c     |  4 ++--
 .../evas/engines/software_x11/evas_xlib_image.c    | 12 +++++------
 4 files changed, 24 insertions(+), 32 deletions(-)

diff --git a/src/modules/evas/engines/eglfs/evas_engine.c 
b/src/modules/evas/engines/eglfs/evas_engine.c
index c408375..648b54f 100644
--- a/src/modules/evas/engines/eglfs/evas_engine.c
+++ b/src/modules/evas/engines/eglfs/evas_engine.c
@@ -580,7 +580,7 @@ _re_winfree(Render_Engine *re)
 }
 
 static void
-_native_cb_bind(void *data EINA_UNUSED, void *image)
+_native_cb_bind(void *image)
 {
    Evas_GL_Image *img;
    Native *n;
@@ -609,7 +609,7 @@ _native_cb_bind(void *data EINA_UNUSED, void *image)
 }
 
 static void
-_native_cb_unbind(void *data EINA_UNUSED, void *image)
+_native_cb_unbind(void *image)
 {
    Evas_GL_Image *img;
    Native *n;
@@ -624,29 +624,26 @@ _native_cb_unbind(void *data EINA_UNUSED, void *image)
 }
 
 static void
-_native_cb_free(void *data, void *image)
+_native_cb_free(void *image)
 {
-   Render_Engine *re;
-   Outbuf *ob;
    Evas_GL_Image *img;
    Native *n;
    uint32_t texid;
    void *wlid;
 
-   if (!(re = (Render_Engine *)data)) return;
    if (!(img = image)) return;
    if (!(n = img->native.data)) return;
-   if (!(ob = eng_get_ob(re))) return;
+   if (!img->native.shared) return;
 
    if (n->ns.type == EVAS_NATIVE_SURFACE_WL)
      {
-        wlid = (void*)n->wl_buf;
-        eina_hash_del(ob->gl_context->shared->native_wl_hash, &wlid, img);
+        wlid = n->wl_buf;
+        eina_hash_del(img->native.shared->native_wl_hash, &wlid, img);
         if (n->egl_surface)
           {
              if (glsym_eglDestroyImage)
                {
-                  glsym_eglDestroyImage(ob->egl.disp, n->egl_surface);
+                  glsym_eglDestroyImage(img->native.disp, n->egl_surface);
                   if (eglGetError() != EGL_SUCCESS)
                     ERR("eglDestroyImage() failed.");
                }
@@ -657,11 +654,10 @@ _native_cb_free(void *data, void *image)
    else if (n->ns.type == EVAS_NATIVE_SURFACE_OPENGL)
      {
         texid = n->ns.data.opengl.texture_id;
-        eina_hash_del(ob->gl_context->shared->native_tex_hash, &texid, img);
+        eina_hash_del(img->native.shared->native_tex_hash, &texid, img);
      }
 
    img->native.data = NULL;
-   img->native.func.data = NULL;
    img->native.func.bind = NULL;
    img->native.func.unbind = NULL;
    img->native.func.free = NULL;
@@ -1038,7 +1034,7 @@ eng_image_native_set(void *data, void *image, void 
*native)
    if (img->native.data)
      {
         if (img->native.func.free)
-          img->native.func.free(img->native.func.data, img);
+          img->native.func.free(img);
         glsym_evas_gl_common_image_native_disable(img);
      }
 
@@ -1145,7 +1141,6 @@ eng_image_native_set(void *data, void *image, void 
*native)
                   img->native.yinvert = 1;
                   img->native.loose = 0;
                   img->native.data = n;
-                  img->native.func.data = re;
                   img->native.func.bind = _native_cb_bind;
                   img->native.func.unbind = _native_cb_unbind;
                   img->native.func.free = _native_cb_free;
@@ -1171,7 +1166,6 @@ eng_image_native_set(void *data, void *image, void 
*native)
                   img->native.yinvert = 0;
                   img->native.loose = 0;
                   img->native.data = n;
-                  img->native.func.data = re;
                   img->native.func.bind = _native_cb_bind;
                   img->native.func.unbind = _native_cb_unbind;
                   img->native.func.free = _native_cb_free;
diff --git a/src/modules/evas/engines/software_x11/evas_xcb_image.c 
b/src/modules/evas/engines/software_x11/evas_xcb_image.c
index 8688d07..3794cb9 100644
--- a/src/modules/evas/engines/software_x11/evas_xcb_image.c
+++ b/src/modules/evas/engines/software_x11/evas_xcb_image.c
@@ -6,12 +6,11 @@
 #include "evas_xcb_image.h"
 
 static void 
-_evas_xcb_image_update(void *data EINA_UNUSED, void *image, int x, int y, int 
w, int h)
+_evas_xcb_image_update(void *image, int x, int y, int w, int h)
 {
-   RGBA_Image *im;
+   RGBA_Image *im = image;
    Native *n;
 
-   im = image;
    n = im->native.data;
 
    if (ecore_x_image_get(n->ns_data.x11.exim, n->ns_data.x11.pixmap, 0, 0, x, 
y, w, h))
@@ -37,16 +36,15 @@ _evas_xcb_image_update(void *data EINA_UNUSED, void *image, 
int x, int y, int w,
 }
 
 static void 
-_native_cb_bind(int x, int y, int w, int h)
+_native_cb_bind(void *image, int x, int y, int w, int h)
 {
-   RGBA_Image *im;
+   RGBA_Image *im = image;
    Native *n;
 
-   im = image;
    n = im->native.data;
 
    if ((n) && (n->ns.type == EVAS_NATIVE_SURFACE_X11))
-     _evas_xcb_image_update(NULL, image, x, y, w, h);
+     _evas_xcb_image_update(image, x, y, w, h);
 }
 
 static void 
@@ -75,7 +73,7 @@ _native_cb_free(void *image)
 }
 
 void *
-evas_xcb_image_native_set(void *data, void *image, void *native)
+evas_xcb_image_native_set(void *data EINA_UNUSED, void *image, void *native)
 {
    RGBA_Image *im;
    Evas_Native_Surface *ns;
@@ -118,7 +116,7 @@ evas_xcb_image_native_set(void *data, void *image, void 
*native)
         im->native.func.unbind = NULL;
         im->native.func.free = _native_cb_free;
 
-        _evas_xcb_image_update(data, image, 0, 0, w, h);
+        _evas_xcb_image_update(image, 0, 0, w, h);
      }
 
    return im;
diff --git a/src/modules/evas/engines/software_x11/evas_xlib_dri_image.c 
b/src/modules/evas/engines/software_x11/evas_xlib_dri_image.c
index a4fc0e0..7c968ee 100644
--- a/src/modules/evas/engines/software_x11/evas_xlib_dri_image.c
+++ b/src/modules/evas/engines/software_x11/evas_xlib_dri_image.c
@@ -511,7 +511,7 @@ evas_xlib_image_dri_new(int w, int h, Visual *vis, int 
depth)
 }
 
 static void
-_native_bind_cb(void *data EINA_UNUSED, void *image, int x EINA_UNUSED, int y 
EINA_UNUSED, int w EINA_UNUSED, int h EINA_UNUSED)
+_native_bind_cb(void *image, int x EINA_UNUSED, int y EINA_UNUSED, int w 
EINA_UNUSED, int h EINA_UNUSED)
 {
    RGBA_Image *im = image;
    Native *n = im->native.data;
@@ -526,7 +526,7 @@ _native_bind_cb(void *data EINA_UNUSED, void *image, int x 
EINA_UNUSED, int y EI
 }
 
 static void
-_native_free_cb(void *data EINA_UNUSED, void *image)
+_native_free_cb(void *image)
 {
    RGBA_Image *im = image;
    Native *n = im->native.data;
diff --git a/src/modules/evas/engines/software_x11/evas_xlib_image.c 
b/src/modules/evas/engines/software_x11/evas_xlib_image.c
index fdbcee6..c8f5eca 100644
--- a/src/modules/evas/engines/software_x11/evas_xlib_image.c
+++ b/src/modules/evas/engines/software_x11/evas_xlib_image.c
@@ -6,7 +6,7 @@
 #include "evas_xlib_image.h"
 
 static void
-evas_xlib_image_update(void *data EINA_UNUSED, void *image, int x, int y, int 
w, int h)
+evas_xlib_image_update(void *image, int x, int y, int w, int h)
 {
    RGBA_Image *im = image;
    Native *n = im->native.data;
@@ -33,19 +33,19 @@ evas_xlib_image_update(void *data EINA_UNUSED, void *image, 
int x, int y, int w,
 }
 
 static void
-_native_bind_cb(void *data, void *image, int x, int y, int w, int h)
+_native_bind_cb(void *image, int x, int y, int w, int h)
 {
    RGBA_Image *im = image;
    Native *n = im->native.data;
 
    if ((n) && (n->ns.type == EVAS_NATIVE_SURFACE_X11))
      {
-        evas_xlib_image_update(data, image, x, y, w, h);
+        evas_xlib_image_update(image, x, y, w, h);
      }
 }
 
 static void
-_native_free_cb(void *data EINA_UNUSED, void *image)
+_native_free_cb(void *image)
 {
    RGBA_Image *im = image;
    Native *n = im->native.data;
@@ -66,7 +66,7 @@ _native_free_cb(void *data EINA_UNUSED, void *image)
 }
 
 void *
-evas_xlib_image_native_set(void *data, void *image, void *native)
+evas_xlib_image_native_set(void *data EINA_UNUSED, void *image, void *native)
 {
    RGBA_Image *im = image;
    Evas_Native_Surface *ns = native;
@@ -105,7 +105,7 @@ evas_xlib_image_native_set(void *data, void *image, void 
*native)
         im->native.func.bind = _native_bind_cb;
         im->native.func.free = _native_free_cb;
 
-        evas_xlib_image_update(data, image, 0, 0, w, h);
+        evas_xlib_image_update(image, 0, 0, w, h);
      }
    return im;
 }

-- 


Reply via email to