* 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
{
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
#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);
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());
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 */