forked from enlightenment/enlightenment
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:
parent
47a09b739f
commit
53f10f0da9
|
@ -1066,25 +1066,24 @@ e_pixmap_dmabuf_test(struct linux_dmabuf_buffer *dmabuf)
|
||||||
{
|
{
|
||||||
Evas_Native_Surface ns;
|
Evas_Native_Surface ns;
|
||||||
Evas_Object *test;
|
Evas_Object *test;
|
||||||
|
Eina_Bool ret;
|
||||||
int size;
|
int size;
|
||||||
void *data;
|
void *data;
|
||||||
|
|
||||||
memset(&ns, 0, sizeof(ns));
|
memset(&ns, 0, sizeof(ns));
|
||||||
|
|
||||||
if (e_comp->gl)
|
ns.type = EVAS_NATIVE_SURFACE_WL_DMABUF;
|
||||||
{
|
ns.version = EVAS_NATIVE_SURFACE_VERSION;
|
||||||
Eina_Bool ret;
|
ns.data.wl_dmabuf.attr = &dmabuf->attributes;
|
||||||
ns.type = EVAS_NATIVE_SURFACE_WL_DMABUF;
|
ns.data.wl_dmabuf.resource = NULL;
|
||||||
ns.version = EVAS_NATIVE_SURFACE_VERSION;
|
test = evas_object_image_add(e_comp->evas);
|
||||||
ns.data.wl_dmabuf.attr = &dmabuf->attributes;
|
evas_object_image_native_surface_set(test, &ns);
|
||||||
ns.data.wl_dmabuf.resource = NULL;
|
ret = evas_object_image_load_error_get(test) == EVAS_LOAD_ERROR_NONE;
|
||||||
test = evas_object_image_add(e_comp->evas);
|
evas_object_del(test);
|
||||||
evas_object_image_native_surface_set(test, &ns);
|
if (!ns.data.wl_dmabuf.attr) return EINA_FALSE;
|
||||||
ret = evas_object_image_load_error_get(test) == EVAS_LOAD_ERROR_NONE;
|
|
||||||
evas_object_del(test);
|
if (e_comp->gl || !ret)
|
||||||
if (!ns.data.wl_dmabuf.attr) return EINA_FALSE;
|
return ret;
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* TODO: Software rendering for multi-plane formats */
|
/* TODO: Software rendering for multi-plane formats */
|
||||||
if (dmabuf->attributes.n_planes != 1) return EINA_FALSE;
|
if (dmabuf->attributes.n_planes != 1) return EINA_FALSE;
|
||||||
|
|
Loading…
Reference in New Issue