From e26f2a12f53e6790950c91d6766f014f834cc2b1 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Thu, 29 Jun 2017 13:37:58 -0500 Subject: [PATCH] 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 --- src/bin/e_pixmap.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c index ed63c18b9..3dd608ef0 100644 --- a/src/bin/e_pixmap.c +++ b/src/bin/e_pixmap.c @@ -1107,25 +1107,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;