summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinkyoung Kim <mer.kim@samsung.com>2016-08-17 17:50:18 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-08-17 17:56:17 +0900
commit042e94f10d821494bc79eb84637abfdff6e04bf7 (patch)
treebd6b1525992cf484f69f773a0e10b45137880ff3
parentbe5381960ba08ec14564d6bf7555a97a28f8bbf9 (diff)
downloadefl-042e94f10d821494bc79eb84637abfdff6e04bf7.tar.gz
evas/gl_x11 : Add multiple_buffer member in native surface x11 type union.
Summary: If native surface is multiple buffer pixmap such as named pixmap, Evas should recreate eglImage everyframe. Because DDK get the buffer ID once at eglImageCreate time. So if internal buffer ID is changed, should recreate eglImage. Test Plan: Wearable Tizen. Reviewers: wonsik, raster, cedric, jpeg Reviewed By: jpeg Subscribers: spacegrapher, dkdk, cedric Differential Revision: https://phab.enlightenment.org/D4211
-rw-r--r--src/lib/evas/Evas_Legacy.h3
-rw-r--r--src/modules/evas/engines/gl_x11/evas_engine.c32
-rw-r--r--src/modules/evas/engines/software_generic/evas_native_common.h1
3 files changed, 35 insertions, 1 deletions
diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h
index 96088916fe..b200c2850f 100644
--- a/src/lib/evas/Evas_Legacy.h
+++ b/src/lib/evas/Evas_Legacy.h
@@ -3245,7 +3245,7 @@ EAPI void evas_object_image_memfile_set(Evas_Object *ob
* Magic version number to know what the native surface struct looks like
*/
-#define EVAS_NATIVE_SURFACE_VERSION 3
+#define EVAS_NATIVE_SURFACE_VERSION 4
/**
* Native surface types that image object supports
@@ -3300,6 +3300,7 @@ typedef struct _Evas_Native_Surface
{
void *visual; /**< visual of the pixmap to use (Visual) */
unsigned long pixmap; /**< pixmap id to use (Pixmap) */
+ unsigned int multiple_buffer; /**< From version 4. 1 if pixmap is multiple buffer pixmap such as named pixmap created by enlightenment. driver dependent. @since 1.19 */
} x11; /**< Set this struct fields if surface data is X11 based. */
struct
diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c
index 34e04e5594..093a025170 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.c
+++ b/src/modules/evas/engines/gl_x11/evas_engine.c
@@ -2037,6 +2037,31 @@ _native_bind_cb(void *image)
#ifdef GL_GLES
if (n->ns_data.x11.surface)
{
+ if (n->ns_data.x11.multiple_buffer)
+ {
+ EGLint err;
+ if (!glsym_eglDestroyImage || !glsym_eglCreateImage)
+ {
+ ERR("Try eglDestroyImage()/eglCreateImage() on EGL with no support");
+ return;
+ }
+
+ glsym_eglDestroyImage(im->native.disp, n->ns_data.x11.surface);
+ if ((err = eglGetError()) != EGL_SUCCESS)
+ {
+ ERR("eglDestroyImage() failed.");
+ glsym_evas_gl_common_error_set(err - EGL_SUCCESS);
+ }
+
+ n->ns_data.x11.surface = glsym_eglCreateImage(im->native.disp,
+ EGL_NO_CONTEXT,
+ EGL_NATIVE_PIXMAP_KHR,
+ (void *)n->ns_data.x11.pixmap,
+ NULL);
+ if (!n->ns_data.x11.surface)
+ ERR("eglCreateImage() for Pixmap 0x%#lx failed: %#x", n->ns_data.x11.pixmap, eglGetError());
+
+ }
if (glsym_glEGLImageTargetTexture2DOES)
{
glsym_glEGLImageTargetTexture2DOES(im->native.target, n->ns_data.x11.surface);
@@ -2628,6 +2653,13 @@ eng_image_native_set(void *data, void *image, void *native)
EGL_NO_CONTEXT,
EGL_NATIVE_PIXMAP_KHR,
(void *)pm, NULL);
+
+ if ((ns->version < 4) ||
+ ((ns->version == 4) && !(ns->data.x11.multiple_buffer == 1)))
+ n->ns_data.x11.multiple_buffer = 0;
+ else
+ n->ns_data.x11.multiple_buffer = 1;
+
if (!n->ns_data.x11.surface)
{
ERR("eglCreateImage() for Pixmap %#lx failed: %#x", pm, eglGetError());
diff --git a/src/modules/evas/engines/software_generic/evas_native_common.h b/src/modules/evas/engines/software_generic/evas_native_common.h
index a13b7a0463..a3b721dc39 100644
--- a/src/modules/evas/engines/software_generic/evas_native_common.h
+++ b/src/modules/evas/engines/software_generic/evas_native_common.h
@@ -64,6 +64,7 @@ struct _Native
void *buffer;
void *config; /* egl configuration or glx configuration */
void *surface; /* egl surface or glx surface */
+ unsigned char multiple_buffer : 1; /* whether pixmap is multiple buffer */
} x11; /**< Set this struct fields if surface data is SW X11 based. */
/* EVAS_NATIVE_SURFACE_WL */