summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/wayland_egl/evas_engine.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2016-12-19 16:14:46 -0600
committerDerek Foreman <derekf@osg.samsung.com>2016-12-19 16:20:00 -0600
commit00f8cc45667ed33418533d000ab909744d8149ee (patch)
tree80016879f2d86d69f2d0036b72e801f9509f0a1e /src/modules/evas/engines/wayland_egl/evas_engine.c
parentfba3927a7d7b3eb4986b302ae775e188a9ada8fa (diff)
wayland_egl: Use common implementation of eglCreateImage
This might fix nested compositors on some architectures...
Diffstat (limited to 'src/modules/evas/engines/wayland_egl/evas_engine.c')
-rw-r--r--src/modules/evas/engines/wayland_egl/evas_engine.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c b/src/modules/evas/engines/wayland_egl/evas_engine.c
index 4653f50..d416760 100644
--- a/src/modules/evas/engines/wayland_egl/evas_engine.c
+++ b/src/modules/evas/engines/wayland_egl/evas_engine.c
@@ -67,7 +67,7 @@ Evas_GL_Preload_Render_Call glsym_evas_gl_preload_render_unlock = NULL;
67Evas_GL_Preload_Render_Call glsym_evas_gl_preload_render_relax = NULL; 67Evas_GL_Preload_Render_Call glsym_evas_gl_preload_render_relax = NULL;
68 68
69_eng_fn (*glsym_eglGetProcAddress) (const char *a) = NULL; 69_eng_fn (*glsym_eglGetProcAddress) (const char *a) = NULL;
70void *(*glsym_eglCreateImage) (EGLDisplay a, EGLContext b, EGLenum c, EGLClientBuffer d, const int *e) = NULL; 70EGLImage (*glsym_evas_gl_common_eglCreateImage)(EGLDisplay a, EGLContext b, EGLenum c, EGLClientBuffer d, const EGLAttrib *e) = NULL;
71void (*glsym_eglDestroyImage) (EGLDisplay a, void *b) = NULL; 71void (*glsym_eglDestroyImage) (EGLDisplay a, void *b) = NULL;
72void (*glsym_glEGLImageTargetTexture2DOES) (int a, void *b) = NULL; 72void (*glsym_glEGLImageTargetTexture2DOES) (int a, void *b) = NULL;
73unsigned int (*glsym_eglSwapBuffersWithDamage) (EGLDisplay a, void *b, const EGLint *d, EGLint c) = NULL; 73unsigned int (*glsym_eglSwapBuffersWithDamage) (EGLDisplay a, void *b, const EGLint *d, EGLint c) = NULL;
@@ -135,6 +135,7 @@ gl_symbols(void)
135 LINK2GENERIC(evgl_engine_shutdown); 135 LINK2GENERIC(evgl_engine_shutdown);
136 LINK2GENERIC(evas_gl_symbols); 136 LINK2GENERIC(evas_gl_symbols);
137 LINK2GENERIC(eglGetProcAddress); 137 LINK2GENERIC(eglGetProcAddress);
138 LINK2GENERIC(evas_gl_common_eglCreateImage);
138 139
139#define FINDSYM(dst, sym, typ) \ 140#define FINDSYM(dst, sym, typ) \
140 if (glsym_eglGetProcAddress) { \ 141 if (glsym_eglGetProcAddress) { \
@@ -145,15 +146,8 @@ gl_symbols(void)
145 146
146 glsym_evas_gl_symbols((void*)glsym_eglGetProcAddress); 147 glsym_evas_gl_symbols((void*)glsym_eglGetProcAddress);
147 148
148 FINDSYM(glsym_eglCreateImage, "eglCreateImageKHR", glsym_func_void_ptr);
149 FINDSYM(glsym_eglCreateImage, "eglCreateImageEXT", glsym_func_void_ptr);
150 FINDSYM(glsym_eglCreateImage, "eglCreateImageARB", glsym_func_void_ptr);
151 FINDSYM(glsym_eglCreateImage, "eglCreateImage", glsym_func_void_ptr);
152
153 FINDSYM(glsym_eglDestroyImage, "eglDestroyImageKHR", glsym_func_void);
154 FINDSYM(glsym_eglDestroyImage, "eglDestroyImageEXT", glsym_func_void);
155 FINDSYM(glsym_eglDestroyImage, "eglDestroyImageARB", glsym_func_void);
156 FINDSYM(glsym_eglDestroyImage, "eglDestroyImage", glsym_func_void); 149 FINDSYM(glsym_eglDestroyImage, "eglDestroyImage", glsym_func_void);
150 FINDSYM(glsym_eglDestroyImage, "eglDestroyImageKHR", glsym_func_void);
157 151
158 FINDSYM(glsym_glEGLImageTargetTexture2DOES, "glEGLImageTargetTexture2DOES", 152 FINDSYM(glsym_glEGLImageTargetTexture2DOES, "glEGLImageTargetTexture2DOES",
159 glsym_func_void); 153 glsym_func_void);
@@ -1200,7 +1194,7 @@ eng_image_native_set(void *data, void *image, void *native)
1200 { 1194 {
1201 if ((n = calloc(1, sizeof(Native)))) 1195 if ((n = calloc(1, sizeof(Native))))
1202 { 1196 {
1203 EGLint attribs[3]; 1197 EGLAttrib attribs[3];
1204 int format, yinvert = 1; 1198 int format, yinvert = 1;
1205 1199
1206 glsym_eglQueryWaylandBufferWL(ob->egl_disp, wl_buf, 1200 glsym_eglQueryWaylandBufferWL(ob->egl_disp, wl_buf,
@@ -1233,8 +1227,8 @@ eng_image_native_set(void *data, void *image, void *native)
1233 &wlid, img); 1227 &wlid, img);
1234 1228
1235 n->ns_data.wl_surface.wl_buf = wl_buf; 1229 n->ns_data.wl_surface.wl_buf = wl_buf;
1236 if (glsym_eglCreateImage) 1230 if (glsym_eglDestroyImage)
1237 n->ns_data.wl_surface.surface = glsym_eglCreateImage(ob->egl_disp, 1231 n->ns_data.wl_surface.surface = glsym_evas_gl_common_eglCreateImage(ob->egl_disp,
1238 NULL, 1232 NULL,
1239 EGL_WAYLAND_BUFFER_WL, 1233 EGL_WAYLAND_BUFFER_WL,
1240 wl_buf, attribs); 1234 wl_buf, attribs);
@@ -1343,8 +1337,8 @@ eng_image_native_set(void *data, void *image, void *native)
1343 memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface)); 1337 memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface));
1344 n->ns_data.tbm.buffer = buffer; 1338 n->ns_data.tbm.buffer = buffer;
1345 1339
1346 if (glsym_eglCreateImage) 1340 if (glsym_eglDestroyImage)
1347 n->ns_data.tbm.surface = glsym_eglCreateImage(ob->egl_disp, 1341 n->ns_data.tbm.surface = glsym_evas_gl_common_eglCreateImage(ob->egl_disp,
1348 EGL_NO_CONTEXT, 1342 EGL_NO_CONTEXT,
1349 EGL_NATIVE_SURFACE_TIZEN, 1343 EGL_NATIVE_SURFACE_TIZEN,
1350 (void *)buffer, 1344 (void *)buffer,