summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2016-12-19 15:51:30 -0600
committerDerek Foreman <derekf@osg.samsung.com>2016-12-19 15:52:58 -0600
commitac4c8dbbab52a7e2cc6e8b0ba7acff194a6d562a (patch)
tree08f3323fed4c6b3df6d147a09c3799ec19506246 /src
parent2e6f93ccda3945b83f2f4c683c407592c2034e91 (diff)
gl_x11: Use common implementation of eglCreateImage
Throw away the local copy and use the one in gl_common.
Diffstat (limited to 'src')
-rw-r--r--src/modules/evas/engines/gl_x11/evas_engine.c49
1 files changed, 10 insertions, 39 deletions
diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c
index 1aa74f2083..aecd0c77ce 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.c
+++ b/src/modules/evas/engines/gl_x11/evas_engine.c
@@ -84,8 +84,7 @@ typedef intptr_t EGLAttribKHR;
84#endif 84#endif
85 85
86_eng_fn (*glsym_eglGetProcAddress) (const char *a) = NULL; 86_eng_fn (*glsym_eglGetProcAddress) (const char *a) = NULL;
87EGLImageKHR (*glsym_eglCreateImage) (EGLDisplay a, EGLContext b, EGLenum c, EGLClientBuffer d, const EGLAttribKHR *e) = NULL; 87EGLImage (*glsym_evas_gl_common_eglCreateImage)(EGLDisplay a, EGLContext b, EGLenum c, EGLClientBuffer d, const EGLAttrib *e) = NULL;
88EGLImageKHR (*glsym_eglCreateImageKHR) (EGLDisplay a, EGLContext b, EGLenum c, EGLClientBuffer d, EGLint *e) = NULL;
89void (*glsym_eglDestroyImage) (EGLDisplay a, void *b) = NULL; 88void (*glsym_eglDestroyImage) (EGLDisplay a, void *b) = NULL;
90void (*glsym_glEGLImageTargetTexture2DOES) (int a, void *b) = NULL; 89void (*glsym_glEGLImageTargetTexture2DOES) (int a, void *b) = NULL;
91unsigned int (*glsym_eglSwapBuffersWithDamage) (EGLDisplay a, void *b, const EGLint *d, EGLint c) = NULL; 90unsigned int (*glsym_eglSwapBuffersWithDamage) (EGLDisplay a, void *b, const EGLint *d, EGLint c) = NULL;
@@ -1330,31 +1329,6 @@ gl_symbols(void)
1330 done = 1; 1329 done = 1;
1331} 1330}
1332 1331
1333#ifdef GL_GLES
1334static EGLImageKHR
1335_eflCreateImage(EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttribKHR *attrib_list)
1336{
1337 if (glsym_eglCreateImage)
1338 return glsym_eglCreateImage(dpy, ctx, target, buffer, attrib_list);
1339 if (glsym_eglCreateImageKHR)
1340 {
1341 int count, i;
1342 EGLint *ints = NULL;
1343
1344 if (attrib_list)
1345 {
1346 for (count = 0; attrib_list[count] != EGL_NONE; count += 2);
1347 count++;
1348 ints = alloca(count * sizeof(EGLint));
1349 for (i = 0; i < count; i++)
1350 ints[i] = attrib_list[i];
1351 }
1352 return glsym_eglCreateImageKHR(dpy, ctx, target, buffer, ints);
1353 }
1354 return NULL;
1355}
1356#endif
1357
1358void 1332void
1359eng_gl_symbols(Outbuf *ob) 1333eng_gl_symbols(Outbuf *ob)
1360{ 1334{
@@ -1387,9 +1361,7 @@ eng_gl_symbols(Outbuf *ob)
1387 // Find EGL extensions 1361 // Find EGL extensions
1388 exts = eglQueryString(ob->egl_disp, EGL_EXTENSIONS); 1362 exts = eglQueryString(ob->egl_disp, EGL_EXTENSIONS);
1389 1363
1390 FINDSYM(glsym_eglCreateImage, "eglCreateImage", NULL, glsym_func_void_ptr); 1364 LINK2GENERIC(evas_gl_common_eglCreateImage);
1391 FINDSYM(glsym_eglCreateImageKHR, "eglCreateImageKHR", "EGL_KHR_image_base", glsym_func_void_ptr);
1392 FINDSYM(glsym_eglCreateImageKHR, "eglCreateImageKHR", "EGL_KHR_image", glsym_func_void_ptr);
1393 1365
1394 FINDSYM(glsym_eglDestroyImage, "eglDestroyImage", NULL, glsym_func_void); 1366 FINDSYM(glsym_eglDestroyImage, "eglDestroyImage", NULL, glsym_func_void);
1395 FINDSYM(glsym_eglDestroyImage, "eglDestroyImageKHR", "EGL_KHR_image_base", glsym_func_void); 1367 FINDSYM(glsym_eglDestroyImage, "eglDestroyImageKHR", "EGL_KHR_image_base", glsym_func_void);
@@ -1998,8 +1970,7 @@ _native_bind_cb(void *image)
1998 if (n->ns_data.x11.multiple_buffer) 1970 if (n->ns_data.x11.multiple_buffer)
1999 { 1971 {
2000 EGLint err; 1972 EGLint err;
2001 if (!glsym_eglDestroyImage || 1973 if (!glsym_eglDestroyImage)
2002 (!glsym_eglCreateImage && !glsym_eglCreateImageKHR))
2003 { 1974 {
2004 ERR("Try eglDestroyImage()/eglCreateImage() on EGL with no support"); 1975 ERR("Try eglDestroyImage()/eglCreateImage() on EGL with no support");
2005 return; 1976 return;
@@ -2012,7 +1983,7 @@ _native_bind_cb(void *image)
2012 glsym_evas_gl_common_error_set(err - EGL_SUCCESS); 1983 glsym_evas_gl_common_error_set(err - EGL_SUCCESS);
2013 } 1984 }
2014 1985
2015 n->ns_data.x11.surface = _eflCreateImage(im->native.disp, 1986 n->ns_data.x11.surface = glsym_evas_gl_common_eglCreateImage(im->native.disp,
2016 EGL_NO_CONTEXT, 1987 EGL_NO_CONTEXT,
2017 EGL_NATIVE_PIXMAP_KHR, 1988 EGL_NATIVE_PIXMAP_KHR,
2018 (void *)n->ns_data.x11.pixmap, 1989 (void *)n->ns_data.x11.pixmap,
@@ -2551,7 +2522,7 @@ eng_image_native_set(void *data, void *image, void *native)
2551#ifdef GL_GLES 2522#ifdef GL_GLES
2552 if (native) 2523 if (native)
2553 { 2524 {
2554 if (!glsym_eglCreateImage && !glsym_eglCreateImageKHR) 2525 if (!glsym_eglDestroyImage)
2555 { 2526 {
2556 ERR("Try eglCreateImage on EGL with no support"); 2527 ERR("Try eglCreateImage on EGL with no support");
2557 return NULL; 2528 return NULL;
@@ -2608,7 +2579,7 @@ eng_image_native_set(void *data, void *image, void *native)
2608 memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface)); 2579 memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface));
2609 n->ns_data.x11.pixmap = pm; 2580 n->ns_data.x11.pixmap = pm;
2610 n->ns_data.x11.visual = vis; 2581 n->ns_data.x11.visual = vis;
2611 n->ns_data.x11.surface = _eflCreateImage(eng_get_ob(re)->egl_disp, 2582 n->ns_data.x11.surface = glsym_evas_gl_common_eglCreateImage(eng_get_ob(re)->egl_disp,
2612 EGL_NO_CONTEXT, 2583 EGL_NO_CONTEXT,
2613 EGL_NATIVE_PIXMAP_KHR, 2584 EGL_NATIVE_PIXMAP_KHR,
2614 (void *)pm, NULL); 2585 (void *)pm, NULL);
@@ -2898,8 +2869,8 @@ eng_image_native_set(void *data, void *image, void *native)
2898 2869
2899 memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface)); 2870 memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface));
2900 n->ns_data.tbm.buffer = buffer; 2871 n->ns_data.tbm.buffer = buffer;
2901 if (glsym_eglCreateImage || glsym_eglCreateImageKHR) 2872 if (glsym_eglDestroyImage)
2902 n->ns_data.tbm.surface = _eflCreateImage(eng_get_ob(re)->egl_disp, 2873 n->ns_data.tbm.surface = glsym_evas_gl_common_eglCreateImage(eng_get_ob(re)->egl_disp,
2903 EGL_NO_CONTEXT, 2874 EGL_NO_CONTEXT,
2904 EGL_NATIVE_SURFACE_TIZEN, 2875 EGL_NATIVE_SURFACE_TIZEN,
2905 (void *)buffer, 2876 (void *)buffer,
@@ -3000,8 +2971,8 @@ eng_image_native_set(void *data, void *image, void *native)
3000 &wlid, im); 2971 &wlid, im);
3001 2972
3002 n->ns_data.wl_surface.wl_buf = wl_buf; 2973 n->ns_data.wl_surface.wl_buf = wl_buf;
3003 if (glsym_eglCreateImage || glsym_eglCreateImageKHR) 2974 if (glsym_eglDestroyImage)
3004 n->ns_data.wl_surface.surface = _eflCreateImage(eng_get_ob(re)->egl_disp, 2975 n->ns_data.wl_surface.surface = glsym_evas_gl_common_eglCreateImage(eng_get_ob(re)->egl_disp,
3005 NULL, 2976 NULL,
3006 EGL_WAYLAND_BUFFER_WL, 2977 EGL_WAYLAND_BUFFER_WL,
3007 wl_buf, attribs); 2978 wl_buf, attribs);