Test dmabuf via native_surface_set even in software render

This is necessary to verify the the attributes struct is the same
version EFL can process, before we commit to displaying it.

@fix
This commit is contained in:
Derek Foreman 2017-06-29 13:37:58 -05:00 committed by Mike Blumenkrantz
parent 47a09b739f
commit 53f10f0da9
1 changed files with 13 additions and 14 deletions

View File

@ -1066,25 +1066,24 @@ e_pixmap_dmabuf_test(struct linux_dmabuf_buffer *dmabuf)
{
Evas_Native_Surface ns;
Evas_Object *test;
Eina_Bool ret;
int size;
void *data;
memset(&ns, 0, sizeof(ns));
if (e_comp->gl)
{
Eina_Bool ret;
ns.type = EVAS_NATIVE_SURFACE_WL_DMABUF;
ns.version = EVAS_NATIVE_SURFACE_VERSION;
ns.data.wl_dmabuf.attr = &dmabuf->attributes;
ns.data.wl_dmabuf.resource = NULL;
test = evas_object_image_add(e_comp->evas);
evas_object_image_native_surface_set(test, &ns);
ret = evas_object_image_load_error_get(test) == EVAS_LOAD_ERROR_NONE;
evas_object_del(test);
if (!ns.data.wl_dmabuf.attr) return EINA_FALSE;
return ret;
}
ns.type = EVAS_NATIVE_SURFACE_WL_DMABUF;
ns.version = EVAS_NATIVE_SURFACE_VERSION;
ns.data.wl_dmabuf.attr = &dmabuf->attributes;
ns.data.wl_dmabuf.resource = NULL;
test = evas_object_image_add(e_comp->evas);
evas_object_image_native_surface_set(test, &ns);
ret = evas_object_image_load_error_get(test) == EVAS_LOAD_ERROR_NONE;
evas_object_del(test);
if (!ns.data.wl_dmabuf.attr) return EINA_FALSE;
if (e_comp->gl || !ret)
return ret;
/* TODO: Software rendering for multi-plane formats */
if (dmabuf->attributes.n_planes != 1) return EINA_FALSE;