evas tbm: Fix compilation warnings

Previous patch used a wrong type... harmless but warned.
This commit is contained in:
Jean-Philippe Andre 2016-01-05 16:54:48 +09:00
parent 7db9613e8c
commit d7903e40b3
1 changed files with 18 additions and 35 deletions

View File

@ -210,24 +210,17 @@ _native_bind_cb(void *data EINA_UNUSED, void *image, int x EINA_UNUSED, int y EI
RGBA_Image *im = image; RGBA_Image *im = image;
Native *n = im->native.data; Native *n = im->native.data;
tbm_surface_info_s info; tbm_surface_info_s info;
tbm_surface_h *tbm_surf; tbm_surface_h tbm_surf;
if (!im) return; if (!im || !n) return;
if (n) if (n->ns.type != EVAS_NATIVE_SURFACE_TBM)
{ return;
if (n->ns.type == EVAS_NATIVE_SURFACE_TBM)
{
tbm_surf = n->ns.data.tbm.buffer;
}
else tbm_surf = NULL;
if (!tbm_surf) tbm_surf = n->ns.data.tbm.buffer;
return; if (sym_tbm_surface_map(tbm_surf, TBM_SURF_OPTION_READ|TBM_SURF_OPTION_WRITE, &info))
if (sym_tbm_surface_map(tbm_surf, TBM_SURF_OPTION_READ|TBM_SURF_OPTION_WRITE, &info)) return;
return;
im->image.data = (DATA32 *)info.planes[0].ptr; im->image.data = (DATA32 *)info.planes[0].ptr;
}
} }
static void static void
@ -235,21 +228,14 @@ _native_unbind_cb(void *data EINA_UNUSED, void *image)
{ {
RGBA_Image *im = image; RGBA_Image *im = image;
Native *n = im->native.data; Native *n = im->native.data;
tbm_surface_h *tbm_surf; tbm_surface_h tbm_surf;
if (!im) return; if (!im || !n) return;
if (n) if (n->ns.type != EVAS_NATIVE_SURFACE_TBM)
{ return;
if (n->ns.type == EVAS_NATIVE_SURFACE_TBM)
{
tbm_surf = n->ns.data.tbm.buffer;
}
else tbm_surf = NULL;
if (!tbm_surf) tbm_surf = n->ns.data.tbm.buffer;
return; sym_tbm_surface_unmap(tbm_surf);
sym_tbm_surface_unmap(tbm_surf);
}
} }
static void static void
@ -276,7 +262,7 @@ evas_native_tbm_surface_image_set(void *data EINA_UNUSED, void *image, void *nat
{ {
Evas_Native_Surface *ns = native; Evas_Native_Surface *ns = native;
RGBA_Image *im = image; RGBA_Image *im = image;
tbm_surface_h *tbm_surf; tbm_surface_h tbm_surf;
if (!im) return NULL; if (!im) return NULL;
@ -288,13 +274,10 @@ evas_native_tbm_surface_image_set(void *data EINA_UNUSED, void *image, void *nat
tbm_surface_info_s info; tbm_surface_info_s info;
Native *n; Native *n;
if (ns->type == EVAS_NATIVE_SURFACE_TBM) if (ns->type != EVAS_NATIVE_SURFACE_TBM)
{ return NULL;
tbm_surf = ns->data.tbm.buffer;
}
else tbm_surf = NULL;
if (!tbm_surf) return NULL; tbm_surf = ns->data.tbm.buffer;
if (!tbm_init()) if (!tbm_init())
{ {