gl_drm: Allow testing of dmabuf objects

Enlightenment needs to know if a specific dmabuf format is supported
before it lets clients use it.  This lets E test commit a wayland
dmabuf object without assigning it a buffer.
This commit is contained in:
Derek Foreman 2016-12-06 10:43:18 -06:00
parent 673b735917
commit 4258fa4f70
1 changed files with 17 additions and 0 deletions

View File

@ -1177,6 +1177,23 @@ eng_image_native_set(void *data, void *image, void *native)
NULL, 1,
EVAS_COLORSPACE_ARGB8888);
}
else if ((ns) && (ns->type == EVAS_NATIVE_SURFACE_WL_DMABUF))
{
if (!ns->data.wl_dmabuf.resource)
{
struct dmabuf_attributes *attr;
void *v;
attr = ns->data.wl_dmabuf.attr;
v = import_simple_dmabuf(ob->egl.disp, attr);
if (!v) {
ns->data.wl_dmabuf.attr = NULL;
return NULL;
}
glsym_eglDestroyImage(ob->egl.disp, v);
return NULL;
}
}
else
return NULL;
}