/* dynamic loaded local egl function pointers */
_eng_fn (*glsym_eglGetProcAddress)(const char *a) = NULL;
-EGLImage (*glsym_eglCreateImage) (EGLDisplay a, EGLContext b, EGLenum c, EGLClientBuffer d, const EGLAttrib *e) = NULL;
-EGLImage (*glsym_eglCreateImageKHR) (EGLDisplay a, EGLContext b, EGLenum c, EGLClientBuffer d, EGLint *e) = NULL;
+EGLImage (*glsym_evas_gl_common_eglCreateImage) (EGLDisplay a, EGLContext b, EGLenum c, EGLClientBuffer d, const EGLAttrib *e) = NULL;
void (*glsym_eglDestroyImage)(EGLDisplay a, void *b) = NULL;
void (*glsym_glEGLImageTargetTexture2DOES)(int a, void *b) = NULL;
unsigned int (*glsym_eglSwapBuffersWithDamage)(EGLDisplay a, void *b, const EGLint *d, EGLint c) = NULL;
return EINA_TRUE;
}
-static EGLImage
-_eflCreateImage(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list)
-{
- if (glsym_eglCreateImage)
- return glsym_eglCreateImage(dpy, ctx, target, buffer, attrib_list);
- if (glsym_eglCreateImageKHR)
- {
- int count, i;
- EGLint *ints = NULL;
-
- if (attrib_list)
- {
- for (count = 0; attrib_list[count] != EGL_NONE; count += 2);
- count++;
- ints = alloca(count * sizeof(EGLint));
- for (i = 0; i < count; i++)
- ints[i] = attrib_list[i];
- }
- return glsym_eglCreateImageKHR(dpy, ctx, target, buffer, ints);
- }
- return NULL;
-}
-
/* local functions */
static void
gl_symbols(void)
LINK2GENERIC(evas_gl_symbols);
LINK2GENERIC(eglGetProcAddress);
+ LINK2GENERIC(evas_gl_common_eglCreateImage);
#define FINDSYM(dst, sym, typ) \
if (!dst) dst = (typ)glsym_eglGetProcAddress(sym);
glsym_evas_gl_symbols((void*)glsym_eglGetProcAddress);
- FINDSYM(glsym_eglCreateImageKHR, "eglCreateImageKHR", glsym_func_void_ptr);
- FINDSYM(glsym_eglCreateImage, "eglCreateImage", glsym_func_void_ptr);
-
FINDSYM(glsym_eglDestroyImage, "eglDestroyImageKHR", glsym_func_void);
FINDSYM(glsym_eglDestroyImage, "eglDestroyImage", glsym_func_void);
int atti = 0;
if (!dmabuf_present) return NULL;
- if (!glsym_eglCreateImage && !glsym_eglCreateImageKHR) return NULL;
+ if (!glsym_eglDestroyImage) return NULL;
/* This requires the Mesa commit in
* Mesa 10.3 (08264e5dad4df448e7718e782ad9077902089a07) or
attribs[atti++] = EGL_NONE;
- return _eflCreateImage(display, EGL_NO_CONTEXT,
- EGL_LINUX_DMA_BUF_EXT,
- NULL, attribs);
+ return glsym_evas_gl_common_eglCreateImage(display, EGL_NO_CONTEXT,
+ EGL_LINUX_DMA_BUF_EXT,
+ NULL, attribs);
}
static void
&wlid, img);
n->ns_data.wl_surface.wl_buf = wl_buf;
- if (glsym_eglCreateImage || glsym_eglCreateImageKHR)
- n->ns_data.wl_surface.surface = _eflCreateImage(ob->egl.disp,
- NULL,
- EGL_WAYLAND_BUFFER_WL,
- wl_buf, attribs);
+ if (glsym_eglDestroyImage)
+ n->ns_data.wl_surface.surface = glsym_evas_gl_common_eglCreateImage(ob->egl.disp,
+ NULL,
+ EGL_WAYLAND_BUFFER_WL,
+ wl_buf, attribs);
else
{
ERR("Try eglCreateImage on EGL with no support");