summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongyeon Kim <dy5.kim@samsung.com>2015-04-30 12:20:29 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-06-03 11:30:22 +0900
commit660bfcf3c2bafb58bf0957c28f92572195ffa3ec (patch)
treea76ff30b42f5be9ea05f0d605aa3e9b70204d679
parent411bc27390a102ffdb9d8bf77d34929b630ac8f1 (diff)
Evas GL: Separate EGL and GL extension lists
Summary: Separate EGL extensions from GL/GLES extension list, since we have extension list for each GL version, and we do not want to check EGL extensions differently when different GL versions are used. This also simplifies extension string get function as we just need to concatenate EGL and GL extensions rathan than keeping track of GL extensions only.
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_api.c2
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_api_ext.c295
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_api_ext.h13
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h89
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_core.c35
5 files changed, 361 insertions, 73 deletions
diff --git a/src/modules/evas/engines/gl_common/evas_gl_api.c b/src/modules/evas/engines/gl_common/evas_gl_api.c
index 6ef7a3d45b..2d755861da 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_api.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_api.c
@@ -727,7 +727,7 @@ _evgl_glGetString(GLenum name)
727#endif 727#endif
728 728
729 case GL_EXTENSIONS: 729 case GL_EXTENSIONS:
730 // Passing the verion - GLESv2/GLESv3. 730 // Passing the version - GLESv2/GLESv3.
731 return (GLubyte *) evgl_api_ext_string_get(EINA_TRUE, rsc->current_ctx->version); 731 return (GLubyte *) evgl_api_ext_string_get(EINA_TRUE, rsc->current_ctx->version);
732 732
733 default: 733 default:
diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c
index 1d9869e361..639f60cf5b 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_api_ext.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext.c
@@ -3,14 +3,20 @@
3 3
4#include <dlfcn.h> 4#include <dlfcn.h>
5 5
6// list of exts like "discard_framebuffer GL_EXT_discard_framebuffer multi_draw_arrays GL_EXT_multi_draw_arrays" 6// list of egl extensions
7#ifdef GL_GLES
8static char *_egl_ext_string = NULL;
9#endif
10// list of gles 2.0 exts by official name
7static char *_gl_ext_string = NULL; 11static char *_gl_ext_string = NULL;
8// list of exts by official name only like "GL_EXT_discard_framebuffer GL_EXT_multi_draw_arrays" 12// list of exts by official name only like "GL_EXT_discard_framebuffer GL_EXT_multi_draw_arrays"
9static char *_gl_ext_string_official = NULL; 13static char *_gl_ext_string_official = NULL;
10// list of gles 1.1 exts by official name 14// list of gles 1.1 exts by official name
11static char *_gles1_ext_string = NULL; 15static char *_gles1_ext_string = NULL;
16static char *_gles1_ext_string_official = NULL;
12// list of gles 3.1 exts by official name 17// list of gles 3.1 exts by official name
13static char *_gles3_ext_string = NULL; 18static char *_gles3_ext_string = NULL;
19static char *_gles3_ext_string_official = NULL;
14 20
15typedef void (*_getproc_fn) (void); 21typedef void (*_getproc_fn) (void);
16typedef _getproc_fn (*fp_getproc)(const char *); 22typedef _getproc_fn (*fp_getproc)(const char *);
@@ -35,6 +41,7 @@ struct wl_resource;
35#define _EVASGL_EXT_DRVNAME_PRIVATE(name) 41#define _EVASGL_EXT_DRVNAME_PRIVATE(name)
36#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname) 42#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
37#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) \ 43#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) \
44 ret (*egl_ext_sym_##name) param = NULL; \
38 ret (*gl_ext_sym_##name) param = NULL; \ 45 ret (*gl_ext_sym_##name) param = NULL; \
39 ret (*gles1_ext_sym_##name) param = NULL; \ 46 ret (*gles1_ext_sym_##name) param = NULL; \
40 ret (*gles3_ext_sym_##name) param = NULL; 47 ret (*gles3_ext_sym_##name) param = NULL;
@@ -67,12 +74,14 @@ struct wl_resource;
67#define _EVASGL_EXT_CHECK_SUPPORT(name) 74#define _EVASGL_EXT_CHECK_SUPPORT(name)
68#define _EVASGL_EXT_DISCARD_SUPPORT() 75#define _EVASGL_EXT_DISCARD_SUPPORT()
69#define _EVASGL_EXT_BEGIN(name) \ 76#define _EVASGL_EXT_BEGIN(name) \
77 int _egl_ext_support_##name = 0; \
70 int _gl_ext_support_##name = 0; \ 78 int _gl_ext_support_##name = 0; \
71 int _gles1_ext_support_##name = 0; \ 79 int _gles1_ext_support_##name = 0; \
72 int _gles3_ext_support_##name = 0; 80 int _gles3_ext_support_##name = 0;
73#define _EVASGL_EXT_END() 81#define _EVASGL_EXT_END()
74#define _EVASGL_EXT_DRVNAME(name) 82#define _EVASGL_EXT_DRVNAME(name)
75#define _EVASGL_EXT_DRVNAME_PRIVATE(name) \ 83#define _EVASGL_EXT_DRVNAME_PRIVATE(name) \
84 int _egl_ext_support_func_##name = 0; \
76 int _gl_ext_support_func_##name = 0; \ 85 int _gl_ext_support_func_##name = 0; \
77 int _gles1_ext_support_func_##name = 0; \ 86 int _gles1_ext_support_func_##name = 0; \
78 int _gles3_ext_support_func_##name = 0; 87 int _gles3_ext_support_func_##name = 0;
@@ -86,6 +95,8 @@ struct wl_resource;
86 95
87#include "evas_gl_api_ext_def.h" 96#include "evas_gl_api_ext_def.h"
88 97
98#undef _EVASGL_EXT_ENABLE_EGL
99#undef _EVASGL_EXT_ENABLE_GL_GLES
89#undef _EVASGL_EXT_CHECK_SUPPORT 100#undef _EVASGL_EXT_CHECK_SUPPORT
90#undef _EVASGL_EXT_DISCARD_SUPPORT 101#undef _EVASGL_EXT_DISCARD_SUPPORT
91#undef _EVASGL_EXT_BEGIN 102#undef _EVASGL_EXT_BEGIN
@@ -166,7 +177,7 @@ _evgl_eglCreateImageKHR(EGLDisplay dpy, EGLContext ctx,
166 *a = EGL_NONE; 177 *a = EGL_NONE;
167 } 178 }
168 179
169 return EXT_FUNC(eglCreateImage)(dpy, ctx, target, buffer, attribs); 180 return EXT_FUNC_EGL(eglCreateImage)(dpy, ctx, target, buffer, attribs);
170} 181}
171 182
172static void * 183static void *
@@ -205,7 +216,7 @@ evgl_evasglDestroyImage(EvasGLImage image)
205{ 216{
206 EGLDisplay dpy = EGLDISPLAY_GET(); 217 EGLDisplay dpy = EGLDISPLAY_GET();
207 if (!dpy) return; 218 if (!dpy) return;
208 EXT_FUNC(eglDestroyImage)(dpy, image); 219 EXT_FUNC_EGL(eglDestroyImage)(dpy, image);
209} 220}
210 221
211static void 222static void
@@ -226,7 +237,7 @@ evgl_evasglCreateSync(Evas_GL *evas_gl EINA_UNUSED,
226{ 237{
227 EGLDisplay dpy = EGLDISPLAY_GET(); 238 EGLDisplay dpy = EGLDISPLAY_GET();
228 if (!dpy) return NULL; 239 if (!dpy) return NULL;
229 return EXT_FUNC(eglCreateSyncKHR)(dpy, type, attrib_list); 240 return EXT_FUNC_EGL(eglCreateSyncKHR)(dpy, type, attrib_list);
230} 241}
231 242
232static Eina_Bool 243static Eina_Bool
@@ -234,7 +245,7 @@ evgl_evasglDestroySync(Evas_GL *evas_gl EINA_UNUSED, EvasGLSync sync)
234{ 245{
235 EGLDisplay dpy = EGLDISPLAY_GET(); 246 EGLDisplay dpy = EGLDISPLAY_GET();
236 if (!dpy) return EINA_FALSE; 247 if (!dpy) return EINA_FALSE;
237 return EXT_FUNC(eglDestroySyncKHR)(dpy, sync); 248 return EXT_FUNC_EGL(eglDestroySyncKHR)(dpy, sync);
238} 249}
239 250
240static int 251static int
@@ -243,7 +254,7 @@ evgl_evasglClientWaitSync(Evas_GL *evas_gl EINA_UNUSED,
243{ 254{
244 EGLDisplay dpy = EGLDISPLAY_GET(); 255 EGLDisplay dpy = EGLDISPLAY_GET();
245 if (!dpy) return EINA_FALSE; 256 if (!dpy) return EINA_FALSE;
246 return EXT_FUNC(eglClientWaitSyncKHR)(dpy, sync, flags, timeout); 257 return EXT_FUNC_EGL(eglClientWaitSyncKHR)(dpy, sync, flags, timeout);
247} 258}
248 259
249static Eina_Bool 260static Eina_Bool
@@ -252,7 +263,7 @@ evgl_evasglSignalSync(Evas_GL *evas_gl EINA_UNUSED,
252{ 263{
253 EGLDisplay dpy = EGLDISPLAY_GET(); 264 EGLDisplay dpy = EGLDISPLAY_GET();
254 if (!dpy) return EINA_FALSE; 265 if (!dpy) return EINA_FALSE;
255 return EXT_FUNC(eglSignalSyncKHR)(dpy, sync, mode); 266 return EXT_FUNC_EGL(eglSignalSyncKHR)(dpy, sync, mode);
256} 267}
257 268
258static Eina_Bool 269static Eina_Bool
@@ -261,7 +272,7 @@ evgl_evasglGetSyncAttrib(Evas_GL *evas_gl EINA_UNUSED,
261{ 272{
262 EGLDisplay dpy = EGLDISPLAY_GET(); 273 EGLDisplay dpy = EGLDISPLAY_GET();
263 if (!dpy) return EINA_FALSE; 274 if (!dpy) return EINA_FALSE;
264 return EXT_FUNC(eglGetSyncAttribKHR)(dpy, sync, attribute, value); 275 return EXT_FUNC_EGL(eglGetSyncAttribKHR)(dpy, sync, attribute, value);
265} 276}
266 277
267static int 278static int
@@ -270,7 +281,7 @@ evgl_evasglWaitSync(Evas_GL *evas_gl EINA_UNUSED,
270{ 281{
271 EGLDisplay dpy = EGLDISPLAY_GET(); 282 EGLDisplay dpy = EGLDISPLAY_GET();
272 if (!dpy) return EINA_FALSE; 283 if (!dpy) return EINA_FALSE;
273 return EXT_FUNC(eglWaitSyncKHR)(dpy, sync, flags); 284 return EXT_FUNC_EGL(eglWaitSyncKHR)(dpy, sync, flags);
274} 285}
275 286
276static Eina_Bool 287static Eina_Bool
@@ -279,7 +290,7 @@ evgl_evasglBindWaylandDisplay(Evas_GL *evas_gl EINA_UNUSED,
279{ 290{
280 EGLDisplay dpy = EGLDISPLAY_GET(); 291 EGLDisplay dpy = EGLDISPLAY_GET();
281 if (!dpy) return EINA_FALSE; 292 if (!dpy) return EINA_FALSE;
282 return EXT_FUNC(eglBindWaylandDisplayWL)(dpy, wl_display); 293 return EXT_FUNC_EGL(eglBindWaylandDisplayWL)(dpy, wl_display);
283} 294}
284 295
285static Eina_Bool 296static Eina_Bool
@@ -288,7 +299,7 @@ evgl_evasglUnbindWaylandDisplay(Evas_GL *evas_gl EINA_UNUSED,
288{ 299{
289 EGLDisplay dpy = EGLDISPLAY_GET(); 300 EGLDisplay dpy = EGLDISPLAY_GET();
290 if (!dpy) return EINA_FALSE; 301 if (!dpy) return EINA_FALSE;
291 return EXT_FUNC(eglUnbindWaylandDisplayWL)(dpy, wl_display); 302 return EXT_FUNC_EGL(eglUnbindWaylandDisplayWL)(dpy, wl_display);
292} 303}
293 304
294static Eina_Bool 305static Eina_Bool
@@ -297,7 +308,7 @@ evgl_evasglQueryWaylandBuffer(Evas_GL *evas_gl EINA_UNUSED,
297{ 308{
298 EGLDisplay dpy = EGLDISPLAY_GET(); 309 EGLDisplay dpy = EGLDISPLAY_GET();
299 if (!dpy) return EINA_FALSE; 310 if (!dpy) return EINA_FALSE;
300 return EXT_FUNC(eglQueryWaylandBufferWL)(dpy, buffer, attribute, value); 311 return EXT_FUNC_EGL(eglQueryWaylandBufferWL)(dpy, buffer, attribute, value);
301} 312}
302 313
303 314
@@ -313,7 +324,171 @@ static int _evgl_api_ext_status = 0;
313#define EVASGL_API_GLES2_EXT_INITIALIZED 0x1 324#define EVASGL_API_GLES2_EXT_INITIALIZED 0x1
314#define EVASGL_API_GLES1_EXT_INITIALIZED 0x2 325#define EVASGL_API_GLES1_EXT_INITIALIZED 0x2
315#define EVASGL_API_GLES3_EXT_INITIALIZED 0x4 326#define EVASGL_API_GLES3_EXT_INITIALIZED 0x4
327#define EVASGL_API_EGL_EXT_INITIALIZED 0x8
328
329#ifdef GL_GLES
330Eina_Bool
331evgl_api_egl_ext_init(void *getproc, const char *glueexts)
332{
333 fp_getproc gp = (fp_getproc)getproc;
334 int _curext_supported = 0;
335 Eina_Strbuf *sb = NULL;
336
337 if (_evgl_api_ext_status & EVASGL_API_EGL_EXT_INITIALIZED)
338 return EINA_TRUE;
339
340 sb = eina_strbuf_new();
341
342 /////////////////////////////////////////////////////////////////////////////////////////////////////
343 // Extension HEADER
344 /////////////////////////////////////////////////////////////////////////////////////////////////////
345#define GETPROCADDR(sym) \
346 (((!(*drvfunc)) && (gp)) ? (__typeof__((*drvfunc)))gp(sym) : (__typeof__((*drvfunc)))dlsym(RTLD_DEFAULT, sym))
347
348#define _EVASGL_EXT_BEGIN(name) \
349 { \
350 int *ext_support = &_egl_ext_support_##name; \
351 *ext_support = 0;
352
353#define _EVASGL_EXT_END() \
354 }
355
356#define _EVASGL_EXT_CHECK_SUPPORT(name) \
357 (strstr(glueexts, name) != NULL)
358
359#define _EVASGL_EXT_DISCARD_SUPPORT() \
360 *ext_support = 0;
361
362#define _EVASGL_EXT_DRVNAME(name) \
363 if (_EVASGL_EXT_CHECK_SUPPORT(#name)) *ext_support = 1;
364
365#define _EVASGL_EXT_DRVNAME_PRIVATE(name) \
366 if (_EVASGL_EXT_CHECK_SUPPORT(#name)) { *ext_support = 1; _egl_ext_support_func_##name = 1; }
367
368#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname) \
369 if (_EVASGL_EXT_CHECK_SUPPORT(deskname)) *ext_support = 1;
370
371#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) \
372 { \
373 ret (**drvfunc)param = &egl_ext_sym_##name; \
374 if (*ext_support == 1) \
375 {
376
377#define _EVASGL_EXT_FUNCTION_END() \
378 } \
379 if ((*drvfunc) == NULL) _EVASGL_EXT_DISCARD_SUPPORT(); \
380 }
381#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
382#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
383#define _EVASGL_EXT_FUNCTION_DRVFUNC(name) \
384 if ((*drvfunc) == NULL) *drvfunc = name;
385
386// This adds all the function names to the "safe" list but only one pointer
387// will be stored in the hash table.
388#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name) \
389 if ((*drvfunc) == NULL) \
390 { \
391 *drvfunc = GETPROCADDR(name); \
392 evgl_safe_extension_add(name, (void *) (*drvfunc)); \
393 } \
394 else evgl_safe_extension_add(name, NULL);
395
396#ifdef _EVASGL_EXT_FUNCTION_WHITELIST
397# undef _EVASGL_EXT_FUNCTION_WHITELIST
398#endif
399#define _EVASGL_EXT_FUNCTION_WHITELIST(name) evgl_safe_extension_add(name, NULL);
316 400
401#define _EVASGL_EXT_ENABLE_GL_GLES 0
402#define _EVASGL_EXT_ENABLE_EGL 1
403
404#include "evas_gl_api_ext_def.h"
405
406#undef _EVASGL_EXT_ENABLE_EGL
407#undef _EVASGL_EXT_ENABLE_GL_GLES
408#undef _EVASGL_EXT_FUNCTION_WHITELIST
409#undef _EVASGL_EXT_CHECK_SUPPORT
410#undef _EVASGL_EXT_DISCARD_SUPPORT
411#undef _EVASGL_EXT_BEGIN
412#undef _EVASGL_EXT_END
413#undef _EVASGL_EXT_DRVNAME
414#undef _EVASGL_EXT_DRVNAME_PRIVATE
415#undef _EVASGL_EXT_DRVNAME_DESKTOP
416#undef _EVASGL_EXT_FUNCTION_BEGIN
417#undef _EVASGL_EXT_FUNCTION_END
418#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
419#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
420#undef _EVASGL_EXT_FUNCTION_DRVFUNC
421#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
422
423#undef GETPROCADDR
424 /////////////////////////////////////////////////////////////////////////////////////////////////////
425
426 /////////////////////////////////////////////////////////////////////////////////////////////////////
427 // Extension HEADER
428 /////////////////////////////////////////////////////////////////////////////////////////////////////
429#define _EVASGL_EXT_BEGIN(name) \
430 if (_egl_ext_support_##name != 0) \
431 { \
432 eina_strbuf_append(sb, #name" "); \
433 _curext_supported = 1; \
434 } \
435 else _curext_supported = 0;
436
437#define _EVASGL_EXT_END()
438#define _EVASGL_EXT_CHECK_SUPPORT(name)
439#define _EVASGL_EXT_DISCARD_SUPPORT()
440#define _EVASGL_EXT_DRVNAME_PRINT(name) \
441 { \
442 if ((strncmp(name, "EGL_", 4) == 0) && (strstr(eina_strbuf_string_get(sb), name) == NULL)) \
443 eina_strbuf_append(sb, name" "); \
444 }
445#define _EVASGL_EXT_DRVNAME(name) \
446 if (_curext_supported) \
447 _EVASGL_EXT_DRVNAME_PRINT(#name)
448#define _EVASGL_EXT_DRVNAME_PRIVATE(name) \
449 if (_curext_supported && _egl_ext_support_func_##name) \
450 _EVASGL_EXT_DRVNAME_PRINT(#name)
451#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
452#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param)
453#define _EVASGL_EXT_FUNCTION_END()
454#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
455#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
456#define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
457#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
458
459#define _EVASGL_EXT_ENABLE_GL_GLES 0
460#define _EVASGL_EXT_ENABLE_EGL 1
461
462#include "evas_gl_api_ext_def.h"
463
464#undef _EVASGL_EXT_ENABLE_EGL
465#undef _EVASGL_EXT_ENABLE_GL_GLES
466#undef _EVASGL_EXT_CHECK_SUPPORT
467#undef _EVASGL_EXT_DISCARD_SUPPORT
468#undef _EVASGL_EXT_BEGIN
469#undef _EVASGL_EXT_END
470#undef _EVASGL_EXT_DRVNAME_PRINT
471#undef _EVASGL_EXT_DRVNAME
472#undef _EVASGL_EXT_DRVNAME_DESKTOP
473#undef _EVASGL_EXT_DRVNAME_PRIVATE
474#undef _EVASGL_EXT_FUNCTION_BEGIN
475#undef _EVASGL_EXT_FUNCTION_END
476#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN
477#undef _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END
478#undef _EVASGL_EXT_FUNCTION_DRVFUNC
479#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
480 /////////////////////////////////////////////////////////////////////////////////////////////////////
481
482 if (_egl_ext_string) free(_egl_ext_string);
483 _egl_ext_string = eina_strbuf_string_steal(sb);
484 eina_strbuf_free(sb);
485
486 ERR("EGL extension string: %s", _egl_ext_string);
487
488 _evgl_api_ext_status |= EVASGL_API_EGL_EXT_INITIALIZED;
489 return EINA_TRUE;
490}
491#endif
317 492
318Eina_Bool 493Eina_Bool
319_evgl_api_gles2_ext_init(void *getproc, const char *glueexts) 494_evgl_api_gles2_ext_init(void *getproc, const char *glueexts)
@@ -401,8 +576,13 @@ _evgl_api_gles2_ext_init(void *getproc, const char *glueexts)
401#endif 576#endif
402#define _EVASGL_EXT_FUNCTION_WHITELIST(name) evgl_safe_extension_add(name, NULL); 577#define _EVASGL_EXT_FUNCTION_WHITELIST(name) evgl_safe_extension_add(name, NULL);
403 578
579#define _EVASGL_EXT_ENABLE_GL_GLES 1
580#define _EVASGL_EXT_ENABLE_EGL 1
581
404#include "evas_gl_api_ext_def.h" 582#include "evas_gl_api_ext_def.h"
405 583
584#undef _EVASGL_EXT_ENABLE_EGL
585#undef _EVASGL_EXT_ENABLE_GL_GLES
406#undef _EVASGL_EXT_FUNCTION_WHITELIST 586#undef _EVASGL_EXT_FUNCTION_WHITELIST
407#undef _EVASGL_EXT_CHECK_SUPPORT 587#undef _EVASGL_EXT_CHECK_SUPPORT
408#undef _EVASGL_EXT_DISCARD_SUPPORT 588#undef _EVASGL_EXT_DISCARD_SUPPORT
@@ -454,9 +634,13 @@ _evgl_api_gles2_ext_init(void *getproc, const char *glueexts)
454#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END() 634#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
455#define _EVASGL_EXT_FUNCTION_DRVFUNC(name) 635#define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
456#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name) 636#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
637#define _EVASGL_EXT_ENABLE_GL_GLES 1
638#define _EVASGL_EXT_ENABLE_EGL 1
457 639
458#include "evas_gl_api_ext_def.h" 640#include "evas_gl_api_ext_def.h"
459 641
642#undef _EVASGL_EXT_ENABLE_EGL
643#undef _EVASGL_EXT_ENABLE_GL_GLES
460#undef _EVASGL_EXT_CHECK_SUPPORT 644#undef _EVASGL_EXT_CHECK_SUPPORT
461#undef _EVASGL_EXT_DISCARD_SUPPORT 645#undef _EVASGL_EXT_DISCARD_SUPPORT
462#undef _EVASGL_EXT_BEGIN 646#undef _EVASGL_EXT_BEGIN
@@ -524,8 +708,13 @@ evgl_api_gles2_ext_get(Evas_GL_API *gl_funcs, void *getproc, const char *glueext
524#undef _EVASGL_EXT_WHITELIST_ONLY 708#undef _EVASGL_EXT_WHITELIST_ONLY
525#define _EVASGL_EXT_WHITELIST_ONLY 0 709#define _EVASGL_EXT_WHITELIST_ONLY 0
526 710
711#define _EVASGL_EXT_ENABLE_GL_GLES 1
712#define _EVASGL_EXT_ENABLE_EGL 1
713
527#include "evas_gl_api_ext_def.h" 714#include "evas_gl_api_ext_def.h"
528 715
716#undef _EVASGL_EXT_ENABLE_EGL
717#undef _EVASGL_EXT_ENABLE_GL_GLES
529#undef _EVASGL_EXT_WHITELIST_ONLY 718#undef _EVASGL_EXT_WHITELIST_ONLY
530#undef _EVASGL_EXT_CHECK_SUPPORT 719#undef _EVASGL_EXT_CHECK_SUPPORT
531#undef _EVASGL_EXT_DISCARD_SUPPORT 720#undef _EVASGL_EXT_DISCARD_SUPPORT
@@ -555,6 +744,7 @@ _evgl_api_gles1_ext_init(void *getproc, const char *glueexts)
555 int _curext_supported = 0; 744 int _curext_supported = 0;
556 Evas_GL_API *gles1_funcs; 745 Evas_GL_API *gles1_funcs;
557 Eina_Strbuf *sb = eina_strbuf_new(); 746 Eina_Strbuf *sb = eina_strbuf_new();
747 Eina_Strbuf *sboff = eina_strbuf_new();
558 748
559#ifdef GL_GLES 749#ifdef GL_GLES
560 EVGL_Resource *rsc; 750 EVGL_Resource *rsc;
@@ -665,12 +855,16 @@ _evgl_api_gles1_ext_init(void *getproc, const char *glueexts)
665#endif 855#endif
666#define _EVASGL_EXT_FUNCTION_WHITELIST(name) evgl_safe_extension_add(name, NULL); 856#define _EVASGL_EXT_FUNCTION_WHITELIST(name) evgl_safe_extension_add(name, NULL);
667 857
858#define _EVASGL_EXT_ENABLE_GL_GLES 1
859#define _EVASGL_EXT_ENABLE_EGL 1
668#define _EVASGL_EXT_GLES1_ONLY 1 860#define _EVASGL_EXT_GLES1_ONLY 1
669 861
670 // Okay, now we are ready to scan. 862 // Okay, now we are ready to scan.
671#include "evas_gl_api_ext_def.h" 863#include "evas_gl_api_ext_def.h"
672 864
673#undef _EVASGL_EXT_GLES1_ONLY 865#undef _EVASGL_EXT_GLES1_ONLY
866#undef _EVASGL_EXT_ENABLE_EGL
867#undef _EVASGL_EXT_ENABLE_GL_GLES
674#undef _EVASGL_EXT_FUNCTION_WHITELIST 868#undef _EVASGL_EXT_FUNCTION_WHITELIST
675#undef _EVASGL_EXT_CHECK_SUPPORT 869#undef _EVASGL_EXT_CHECK_SUPPORT
676#undef _EVASGL_EXT_DISCARD_SUPPORT 870#undef _EVASGL_EXT_DISCARD_SUPPORT
@@ -688,7 +882,12 @@ _evgl_api_gles1_ext_init(void *getproc, const char *glueexts)
688#undef GETPROCADDR 882#undef GETPROCADDR
689 883
690#define _EVASGL_EXT_BEGIN(name) \ 884#define _EVASGL_EXT_BEGIN(name) \
691 _curext_supported = (_gles1_ext_support_##name != 0); 885 if (_gles1_ext_support_##name != 0) \
886 { \
887 eina_strbuf_append(sb, #name" "); \
888 _curext_supported = 1; \
889 } \
890 else _curext_supported = 0;
692 891
693 892
694 ///////////////////////////////////////////////////////////////////////////////////////////////////// 893 /////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -700,8 +899,9 @@ _evgl_api_gles1_ext_init(void *getproc, const char *glueexts)
700#define _EVASGL_EXT_DISCARD_SUPPORT() 899#define _EVASGL_EXT_DISCARD_SUPPORT()
701#define _EVASGL_EXT_DRVNAME_PRINT(name) \ 900#define _EVASGL_EXT_DRVNAME_PRINT(name) \
702 { \ 901 { \
703 if ((strncmp(name, "GL_", 3) == 0) && (strstr(eina_strbuf_string_get(sb), name) == NULL)) \ 902 eina_strbuf_append(sb, name" "); \
704 eina_strbuf_append(sb, name" "); \ 903 if ((strncmp(name, "GL_", 3) == 0) && (strstr(eina_strbuf_string_get(sboff), name) == NULL)) \
904 eina_strbuf_append(sboff, name" "); \
705 } 905 }
706#define _EVASGL_EXT_DRVNAME(name) \ 906#define _EVASGL_EXT_DRVNAME(name) \
707 if (_curext_supported) \ 907 if (_curext_supported) \
@@ -716,9 +916,13 @@ _evgl_api_gles1_ext_init(void *getproc, const char *glueexts)
716#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END() 916#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
717#define _EVASGL_EXT_FUNCTION_DRVFUNC(name) 917#define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
718#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name) 918#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
919#define _EVASGL_EXT_ENABLE_GL_GLES 1
920#define _EVASGL_EXT_ENABLE_EGL 1
719 921
720#include "evas_gl_api_ext_def.h" 922#include "evas_gl_api_ext_def.h"
721 923
924#undef _EVASGL_EXT_ENABLE_EGL
925#undef _EVASGL_EXT_ENABLE_GL_GLES
722#undef _EVASGL_EXT_CHECK_SUPPORT 926#undef _EVASGL_EXT_CHECK_SUPPORT
723#undef _EVASGL_EXT_DISCARD_SUPPORT 927#undef _EVASGL_EXT_DISCARD_SUPPORT
724#undef _EVASGL_EXT_BEGIN 928#undef _EVASGL_EXT_BEGIN
@@ -735,8 +939,11 @@ _evgl_api_gles1_ext_init(void *getproc, const char *glueexts)
735#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR 939#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
736 940
737 if (_gles1_ext_string) free(_gles1_ext_string); 941 if (_gles1_ext_string) free(_gles1_ext_string);
942 if (_gles1_ext_string_official) free(_gles1_ext_string_official);
738 _gles1_ext_string = eina_strbuf_string_steal(sb); 943 _gles1_ext_string = eina_strbuf_string_steal(sb);
944 _gles1_ext_string_official = eina_strbuf_string_steal(sboff);
739 eina_strbuf_free(sb); 945 eina_strbuf_free(sb);
946 eina_strbuf_free(sboff);
740 947
741 if (evgl_engine->api_debug_mode) 948 if (evgl_engine->api_debug_mode)
742 DBG("GLES1: List of supported extensions:\n%s", _gles1_ext_string); 949 DBG("GLES1: List of supported extensions:\n%s", _gles1_ext_string);
@@ -786,9 +993,13 @@ evgl_api_gles1_ext_get(Evas_GL_API *gl_funcs, void *getproc, const char *glueext
786 993
787#undef _EVASGL_EXT_WHITELIST_ONLY 994#undef _EVASGL_EXT_WHITELIST_ONLY
788#define _EVASGL_EXT_WHITELIST_ONLY 0 995#define _EVASGL_EXT_WHITELIST_ONLY 0
996#define _EVASGL_EXT_ENABLE_GL_GLES 1
997#define _EVASGL_EXT_ENABLE_EGL 1
789 998
790#include "evas_gl_api_ext_def.h" 999#include "evas_gl_api_ext_def.h"
791 1000
1001#undef _EVASGL_EXT_ENABLE_EGL
1002#undef _EVASGL_EXT_ENABLE_GL_GLES
792#undef _EVASGL_EXT_CHECK_SUPPORT 1003#undef _EVASGL_EXT_CHECK_SUPPORT
793#undef _EVASGL_EXT_DISCARD_SUPPORT 1004#undef _EVASGL_EXT_DISCARD_SUPPORT
794#undef _EVASGL_EXT_BEGIN 1005#undef _EVASGL_EXT_BEGIN
@@ -817,6 +1028,7 @@ _evgl_api_gles3_ext_init(void *getproc, const char *glueexts)
817 int _curext_supported = 0; 1028 int _curext_supported = 0;
818 Evas_GL_API *gles3_funcs; 1029 Evas_GL_API *gles3_funcs;
819 Eina_Strbuf *sb = eina_strbuf_new(); 1030 Eina_Strbuf *sb = eina_strbuf_new();
1031 Eina_Strbuf *sboff = eina_strbuf_new();
820 1032
821#ifdef GL_GLES 1033#ifdef GL_GLES
822 EVGL_Resource *rsc; 1034 EVGL_Resource *rsc;
@@ -924,9 +1136,14 @@ _evgl_api_gles3_ext_init(void *getproc, const char *glueexts)
924#endif 1136#endif
925#define _EVASGL_EXT_FUNCTION_WHITELIST(name) evgl_safe_extension_add(name, NULL); 1137#define _EVASGL_EXT_FUNCTION_WHITELIST(name) evgl_safe_extension_add(name, NULL);
926 1138
1139#define _EVASGL_EXT_ENABLE_GL_GLES 1
1140#define _EVASGL_EXT_ENABLE_EGL 1
1141
927 // Okay, now we are ready to scan. 1142 // Okay, now we are ready to scan.
928#include "evas_gl_api_ext_def.h" 1143#include "evas_gl_api_ext_def.h"
929 1144
1145#undef _EVASGL_EXT_ENABLE_EGL
1146#undef _EVASGL_EXT_ENABLE_GL_GLES
930#undef _EVASGL_EXT_FUNCTION_WHITELIST 1147#undef _EVASGL_EXT_FUNCTION_WHITELIST
931#undef _EVASGL_EXT_CHECK_SUPPORT 1148#undef _EVASGL_EXT_CHECK_SUPPORT
932#undef _EVASGL_EXT_DISCARD_SUPPORT 1149#undef _EVASGL_EXT_DISCARD_SUPPORT
@@ -944,7 +1161,12 @@ _evgl_api_gles3_ext_init(void *getproc, const char *glueexts)
944#undef GETPROCADDR 1161#undef GETPROCADDR
945 1162
946#define _EVASGL_EXT_BEGIN(name) \ 1163#define _EVASGL_EXT_BEGIN(name) \
947 _curext_supported = (_gles3_ext_support_##name != 0); 1164 if (_gles3_ext_support_##name != 0) \
1165 { \
1166 eina_strbuf_append(sb, #name" "); \
1167 _curext_supported = 1; \
1168 } \
1169 else _curext_supported = 0;
948 1170
949 1171
950 ///////////////////////////////////////////////////////////////////////////////////////////////////// 1172 /////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -956,8 +1178,9 @@ _evgl_api_gles3_ext_init(void *getproc, const char *glueexts)
956#define _EVASGL_EXT_DISCARD_SUPPORT() 1178#define _EVASGL_EXT_DISCARD_SUPPORT()
957#define _EVASGL_EXT_DRVNAME_PRINT(name) \ 1179#define _EVASGL_EXT_DRVNAME_PRINT(name) \
958 { \ 1180 { \
959 if ((strncmp(name, "GL", 2) == 0) && (strstr(eina_strbuf_string_get(sb), name) == NULL)) \ 1181 eina_strbuf_append(sb, name" "); \
960 eina_strbuf_append(sb, name" "); \ 1182 if ((strncmp(name, "GL_", 3) == 0) && (strstr(eina_strbuf_string_get(sboff), name) == NULL)) \
1183 eina_strbuf_append(sboff, name" "); \
961 } 1184 }
962#define _EVASGL_EXT_DRVNAME(name) \ 1185#define _EVASGL_EXT_DRVNAME(name) \
963 if (_curext_supported) \ 1186 if (_curext_supported) \
@@ -973,8 +1196,13 @@ _evgl_api_gles3_ext_init(void *getproc, const char *glueexts)
973#define _EVASGL_EXT_FUNCTION_DRVFUNC(name) 1196#define _EVASGL_EXT_FUNCTION_DRVFUNC(name)
974#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name) 1197#define _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR(name)
975 1198
1199#define _EVASGL_EXT_ENABLE_GL_GLES 1
1200#define _EVASGL_EXT_ENABLE_EGL 1
1201
976#include "evas_gl_api_ext_def.h" 1202#include "evas_gl_api_ext_def.h"
977 1203
1204#undef _EVASGL_EXT_ENABLE_EGL
1205#undef _EVASGL_EXT_ENABLE_GL_GLES
978#undef _EVASGL_EXT_CHECK_SUPPORT 1206#undef _EVASGL_EXT_CHECK_SUPPORT
979#undef _EVASGL_EXT_DISCARD_SUPPORT 1207#undef _EVASGL_EXT_DISCARD_SUPPORT
980#undef _EVASGL_EXT_BEGIN 1208#undef _EVASGL_EXT_BEGIN
@@ -991,8 +1219,11 @@ _evgl_api_gles3_ext_init(void *getproc, const char *glueexts)
991#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR 1219#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
992 1220
993 if (_gles3_ext_string) free(_gles3_ext_string); 1221 if (_gles3_ext_string) free(_gles3_ext_string);
1222 if (_gles3_ext_string_official) free(_gles3_ext_string_official);
994 _gles3_ext_string = eina_strbuf_string_steal(sb); 1223 _gles3_ext_string = eina_strbuf_string_steal(sb);
1224 _gles3_ext_string_official = eina_strbuf_string_steal(sboff);
995 eina_strbuf_free(sb); 1225 eina_strbuf_free(sb);
1226 eina_strbuf_free(sboff);
996 1227
997 if (evgl_engine->api_debug_mode) 1228 if (evgl_engine->api_debug_mode)
998 DBG("GLES3: List of supported extensions:\n%s", _gles3_ext_string); 1229 DBG("GLES3: List of supported extensions:\n%s", _gles3_ext_string);
@@ -1043,8 +1274,13 @@ evgl_api_gles3_ext_get(Evas_GL_API *gl_funcs, void *getproc, const char *glueext
1043#undef _EVASGL_EXT_WHITELIST_ONLY 1274#undef _EVASGL_EXT_WHITELIST_ONLY
1044#define _EVASGL_EXT_WHITELIST_ONLY 0 1275#define _EVASGL_EXT_WHITELIST_ONLY 0
1045 1276
1277#define _EVASGL_EXT_ENABLE_GL_GLES 1
1278#define _EVASGL_EXT_ENABLE_EGL 1
1279
1046#include "evas_gl_api_ext_def.h" 1280#include "evas_gl_api_ext_def.h"
1047 1281
1282#undef _EVASGL_EXT_ENABLE_EGL
1283#undef _EVASGL_EXT_ENABLE_GL_GLES
1048#undef _EVASGL_EXT_CHECK_SUPPORT 1284#undef _EVASGL_EXT_CHECK_SUPPORT
1049#undef _EVASGL_EXT_DISCARD_SUPPORT 1285#undef _EVASGL_EXT_DISCARD_SUPPORT
1050#undef _EVASGL_EXT_BEGIN 1286#undef _EVASGL_EXT_BEGIN
@@ -1065,7 +1301,21 @@ evgl_api_gles3_ext_get(Evas_GL_API *gl_funcs, void *getproc, const char *glueext
1065 1301
1066} 1302}
1067 1303
1304const char *
1305evgl_api_ext_egl_string_get(void)
1306{
1307#ifdef GL_GLES
1308 if (!(_evgl_api_ext_status & EVASGL_API_EGL_EXT_INITIALIZED))
1309 {
1310 ERR("EVGL extension for egl is not yet initialized.");
1311 return NULL;
1312 }
1068 1313
1314 return _egl_ext_string;
1315#else
1316 return "";
1317#endif
1318}
1069 1319
1070const char * 1320const char *
1071evgl_api_ext_string_get(Eina_Bool official, int version) 1321evgl_api_ext_string_get(Eina_Bool official, int version)
@@ -1077,13 +1327,10 @@ evgl_api_ext_string_get(Eina_Bool official, int version)
1077 } 1327 }
1078 1328
1079 if (version == EVAS_GL_GLES_1_X) 1329 if (version == EVAS_GL_GLES_1_X)
1080 return _gles1_ext_string; 1330 return (official?_gles1_ext_string_official:_gles1_ext_string);
1081 1331
1082 if (version == EVAS_GL_GLES_3_X) 1332 if (version == EVAS_GL_GLES_3_X)
1083 return _gles3_ext_string; 1333 return (official?_gles3_ext_string_official:_gles3_ext_string);
1084
1085 if (official)
1086 return _gl_ext_string_official;
1087 1334
1088 return _gl_ext_string; 1335 return (official?_gl_ext_string_official:_gl_ext_string);
1089} 1336}
diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext.h b/src/modules/evas/engines/gl_common/evas_gl_api_ext.h
index f61fe191be..2cd5bc90d4 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_api_ext.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext.h
@@ -26,7 +26,11 @@
26#define _EVASGL_EXT_DRVNAME(name) 26#define _EVASGL_EXT_DRVNAME(name)
27#define _EVASGL_EXT_DRVNAME_PRIVATE(name) 27#define _EVASGL_EXT_DRVNAME_PRIVATE(name)
28#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname) 28#define _EVASGL_EXT_DRVNAME_DESKTOP(deskname)
29#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) extern ret (*gl_ext_sym_##name) param; 29#define _EVASGL_EXT_FUNCTION_BEGIN(ret, name, param) \
30 extern ret (*egl_ext_sym_##name) param; \
31 extern ret (*gl_ext_sym_##name) param; \
32 extern ret (*gles1_ext_sym_##name) param; \
33 extern ret (*gles3_ext_sym_##name) param;
30#define _EVASGL_EXT_FUNCTION_END() 34#define _EVASGL_EXT_FUNCTION_END()
31#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN() 35#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_BEGIN()
32#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END() 36#define _EVASGL_EXT_FUNCTION_DISABLE_FOR_GLES1_END()
@@ -49,6 +53,7 @@
49#undef _EVASGL_EXT_FUNCTION_DRVFUNC 53#undef _EVASGL_EXT_FUNCTION_DRVFUNC
50#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR 54#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
51///////////////////////////////////////////////////////////////////////////////////////////////////// 55/////////////////////////////////////////////////////////////////////////////////////////////////////
56#define EXT_FUNC_EGL(fname) egl_ext_sym_##fname
52#define EXT_FUNC(fname) gl_ext_sym_##fname 57#define EXT_FUNC(fname) gl_ext_sym_##fname
53#define EXT_FUNC_GLES1(fname) gles1_ext_sym_##fname 58#define EXT_FUNC_GLES1(fname) gles1_ext_sym_##fname
54#define EXT_FUNC_GLES3(fname) gles3_ext_sym_##fname 59#define EXT_FUNC_GLES3(fname) gles3_ext_sym_##fname
@@ -59,6 +64,7 @@
59#define _EVASGL_EXT_CHECK_SUPPORT(name) 64#define _EVASGL_EXT_CHECK_SUPPORT(name)
60#define _EVASGL_EXT_DISCARD_SUPPORT() 65#define _EVASGL_EXT_DISCARD_SUPPORT()
61#define _EVASGL_EXT_BEGIN(name) \ 66#define _EVASGL_EXT_BEGIN(name) \
67 extern int _egl_ext_support_##name; \
62 extern int _gl_ext_support_##name; \ 68 extern int _gl_ext_support_##name; \
63 extern int _gles1_ext_support_##name; \ 69 extern int _gles1_ext_support_##name; \
64 extern int _gles3_ext_support_##name; 70 extern int _gles3_ext_support_##name;
@@ -89,13 +95,18 @@
89#undef _EVASGL_EXT_FUNCTION_DRVFUNC 95#undef _EVASGL_EXT_FUNCTION_DRVFUNC
90#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR 96#undef _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR
91///////////////////////////////////////////////////////////////////////////////////////////////////// 97/////////////////////////////////////////////////////////////////////////////////////////////////////
98#define EXTENSION_SUPPORT_EGL(name) (_egl_ext_support_##name == 1)
92#define EXTENSION_SUPPORT(name) (_gl_ext_support_##name == 1) 99#define EXTENSION_SUPPORT(name) (_gl_ext_support_##name == 1)
93#define EXTENSION_SUPPORT_GLES1(name) (_gles1_ext_support_##name == 1) 100#define EXTENSION_SUPPORT_GLES1(name) (_gles1_ext_support_##name == 1)
94#define EXTENSION_SUPPORT_GLES3(name) (_gles3_ext_support_##name == 1) 101#define EXTENSION_SUPPORT_GLES3(name) (_gles3_ext_support_##name == 1)
95 102
103#ifdef GL_GLES
104extern Eina_Bool evgl_api_egl_ext_init(void *getproc, const char *glueexts);
105#endif
96extern void evgl_api_gles2_ext_get(Evas_GL_API *gl_funcs, void *getproc, const char *glueexts); 106extern void evgl_api_gles2_ext_get(Evas_GL_API *gl_funcs, void *getproc, const char *glueexts);
97extern void evgl_api_gles1_ext_get(Evas_GL_API *gl_funcs, void *getproc, const char *glueexts); 107extern void evgl_api_gles1_ext_get(Evas_GL_API *gl_funcs, void *getproc, const char *glueexts);
98extern void evgl_api_gles3_ext_get(Evas_GL_API *gl_funcs, void *getproc, const char *glueexts); 108extern void evgl_api_gles3_ext_get(Evas_GL_API *gl_funcs, void *getproc, const char *glueexts);
109extern const char *evgl_api_ext_egl_string_get(void);
99extern const char *evgl_api_ext_string_get(Eina_Bool official, int version); 110extern const char *evgl_api_ext_string_get(Eina_Bool official, int version);
100 111
101#endif //_EVAS_GL_API_EXT_H 112#endif //_EVAS_GL_API_EXT_H
diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h b/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h
index 09a9b75edd..f20c3a7893 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_api_ext_def.h
@@ -64,6 +64,14 @@
64# define _EVASGL_EXT_WHITELIST_ONLY 1 64# define _EVASGL_EXT_WHITELIST_ONLY 1
65#endif 65#endif
66 66
67#ifndef _EVASGL_EXT_ENABLE_GL_GLES
68# define _EVASGL_EXT_ENABLE_GL_GLES 1
69#endif
70
71#ifndef _EVASGL_EXT_ENABLE_EGL
72# define _EVASGL_EXT_ENABLE_EGL 1
73#endif
74
67#ifndef _EVASGL_EXT_FUNCTION_WHITELIST 75#ifndef _EVASGL_EXT_FUNCTION_WHITELIST
68# define _EVASGL_EXT_FUNCTION_WHITELIST(name) 76# define _EVASGL_EXT_FUNCTION_WHITELIST(name)
69#endif 77#endif
@@ -71,6 +79,7 @@
71/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 79///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
72// GL/GLES EXTENSIONS 80// GL/GLES EXTENSIONS
73/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 81///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
82#if _EVASGL_EXT_ENABLE_GL_GLES
74_EVASGL_EXT_BEGIN(get_program_binary) 83_EVASGL_EXT_BEGIN(get_program_binary)
75 _EVASGL_EXT_DRVNAME(GL_OES_get_program_binary) 84 _EVASGL_EXT_DRVNAME(GL_OES_get_program_binary)
76 85
@@ -1143,7 +1152,46 @@ _EVASGL_EXT_BEGIN(shader_texture_lod)
1143 _EVASGL_EXT_DRVNAME(GL_EXT_shader_texture_lod) 1152 _EVASGL_EXT_DRVNAME(GL_EXT_shader_texture_lod)
1144_EVASGL_EXT_END() 1153_EVASGL_EXT_END()
1145 1154
1155#ifdef GL_GLES
1156_EVASGL_EXT_BEGIN(GL_OES_EGL_image)
1157
1158 _EVASGL_EXT_DRVNAME(GL_OES_EGL_image)
1159
1160 _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(void, glEGLImageTargetTexture2DOES, (GLenum target, GLeglImageOES image))
1161 _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR("glEGLImageTargetTexture2DOES")
1162 _EVASGL_EXT_FUNCTION_PRIVATE_END()
1163 _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(void, glEGLImageTargetRenderbufferStorageOES, (GLenum target, GLeglImageOES image))
1164 _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR("glEGLImageTargetRenderbufferStorageOES")
1165 _EVASGL_EXT_FUNCTION_PRIVATE_END()
1166
1167 _EVASGL_EXT_FUNCTION_BEGIN(void, glEvasGLImageTargetTexture2DOES, (GLenum target, EvasGLImage image))
1168 _EVASGL_EXT_FUNCTION_DRVFUNC(evgl_glEvasGLImageTargetTexture2D)
1169 _EVASGL_EXT_FUNCTION_END()
1170 _EVASGL_EXT_FUNCTION_BEGIN(void, glEvasGLImageTargetRenderbufferStorageOES, (GLenum target, EvasGLImage image))
1171 _EVASGL_EXT_FUNCTION_DRVFUNC(evgl_glEvasGLImageTargetRenderbufferStorage)
1172 _EVASGL_EXT_FUNCTION_END()
1173
1174 #ifdef _EVASGL_EXT_VERIFY
1175 {
1176 if (!_EVASGL_EXT_CHECK_SUPPORT("EGL_KHR_image_base")) _EVASGL_EXT_DISCARD_SUPPORT();
1177 }
1178 #endif
1179
1180_EVASGL_EXT_END()
1181
1182
1183_EVASGL_EXT_BEGIN(GL_OES_EGL_image_external)
1184
1185 _EVASGL_EXT_DRVNAME(GL_OES_EGL_image_external)
1186
1187 #ifdef _EVASGL_EXT_VERIFY
1188 {
1189 if (!_EVASGL_EXT_CHECK_SUPPORT("EGL_KHR_image_base")) _EVASGL_EXT_DISCARD_SUPPORT();
1190 }
1191 #endif
1146 1192
1193_EVASGL_EXT_END()
1194#endif // GL_GLES
1147 1195
1148/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1196///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1149 1197
@@ -1400,6 +1448,7 @@ _EVASGL_EXT_END()
1400 1448
1401 1449
1402#endif // _EVASGL_EXT_WHITELIST_ONLY ("safe" extensions) 1450#endif // _EVASGL_EXT_WHITELIST_ONLY ("safe" extensions)
1451#endif // _EVASGL_EXT_ENABLE_GL_GLES
1403 1452
1404/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1453///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1405 1454
@@ -1410,7 +1459,7 @@ _EVASGL_EXT_END()
1410// EGL EXTENSIONS 1459// EGL EXTENSIONS
1411/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1460///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1412#ifdef GL_GLES 1461#ifdef GL_GLES
1413 1462#if _EVASGL_EXT_ENABLE_EGL
1414_EVASGL_EXT_BEGIN(EGL_KHR_image_base) 1463_EVASGL_EXT_BEGIN(EGL_KHR_image_base)
1415 1464
1416 _EVASGL_EXT_DRVNAME(EGL_KHR_image_base) 1465 _EVASGL_EXT_DRVNAME(EGL_KHR_image_base)
@@ -1444,34 +1493,6 @@ _EVASGL_EXT_END()
1444 1493
1445 1494
1446 1495
1447_EVASGL_EXT_BEGIN(GL_OES_EGL_image)
1448
1449 _EVASGL_EXT_DRVNAME(GL_OES_EGL_image)
1450
1451 _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(void, glEGLImageTargetTexture2DOES, (GLenum target, GLeglImageOES image))
1452 _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR("glEGLImageTargetTexture2DOES")
1453 _EVASGL_EXT_FUNCTION_PRIVATE_END()
1454 _EVASGL_EXT_FUNCTION_PRIVATE_BEGIN(void, glEGLImageTargetRenderbufferStorageOES, (GLenum target, GLeglImageOES image))
1455 _EVASGL_EXT_FUNCTION_DRVFUNC_PROCADDR("glEGLImageTargetRenderbufferStorageOES")
1456 _EVASGL_EXT_FUNCTION_PRIVATE_END()
1457
1458 _EVASGL_EXT_FUNCTION_BEGIN(void, glEvasGLImageTargetTexture2DOES, (GLenum target, EvasGLImage image))
1459 _EVASGL_EXT_FUNCTION_DRVFUNC(evgl_glEvasGLImageTargetTexture2D)
1460 _EVASGL_EXT_FUNCTION_END()
1461 _EVASGL_EXT_FUNCTION_BEGIN(void, glEvasGLImageTargetRenderbufferStorageOES, (GLenum target, EvasGLImage image))
1462 _EVASGL_EXT_FUNCTION_DRVFUNC(evgl_glEvasGLImageTargetRenderbufferStorage)
1463 _EVASGL_EXT_FUNCTION_END()
1464
1465 #ifdef _EVASGL_EXT_VERIFY
1466 {
1467 if (!_EVASGL_EXT_CHECK_SUPPORT("EGL_KHR_image_base")) _EVASGL_EXT_DISCARD_SUPPORT();
1468 }
1469 #endif
1470
1471_EVASGL_EXT_END()
1472
1473
1474
1475_EVASGL_EXT_BEGIN(EGL_KHR_image_pixmap) 1496_EVASGL_EXT_BEGIN(EGL_KHR_image_pixmap)
1476 _EVASGL_EXT_DRVNAME(EGL_KHR_image_pixmap) 1497 _EVASGL_EXT_DRVNAME(EGL_KHR_image_pixmap)
1477 #ifdef _EVASGL_EXT_VERIFY 1498 #ifdef _EVASGL_EXT_VERIFY
@@ -1542,14 +1563,6 @@ _EVASGL_EXT_BEGIN(EGL_KHR_gl_renderbuffer_image)
1542_EVASGL_EXT_END() 1563_EVASGL_EXT_END()
1543 1564
1544 1565
1545_EVASGL_EXT_BEGIN(GL_OES_EGL_image_external)
1546 _EVASGL_EXT_DRVNAME(GL_OES_EGL_image_external)
1547 #ifdef _EVASGL_EXT_VERIFY
1548 {
1549 if (!_EVASGL_EXT_CHECK_SUPPORT("EGL_KHR_image_base")) _EVASGL_EXT_DISCARD_SUPPORT();
1550 }
1551 #endif
1552_EVASGL_EXT_END()
1553 1566
1554 1567
1555_EVASGL_EXT_BEGIN(EGL_KHR_fence_sync) 1568_EVASGL_EXT_BEGIN(EGL_KHR_fence_sync)
@@ -1655,7 +1668,7 @@ _EVASGL_EXT_BEGIN(EGL_SEC_map_image)
1655_EVASGL_EXT_END() 1668_EVASGL_EXT_END()
1656#endif 1669#endif
1657 1670
1658 1671#endif // _EVASGL_EXT_ENABLE_EGL
1659#endif 1672#endif
1660/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 1673///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1661 1674
diff --git a/src/modules/evas/engines/gl_common/evas_gl_core.c b/src/modules/evas/engines/gl_common/evas_gl_core.c
index 5325bfefd9..3b75ca356c 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_core.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_core.c
@@ -266,7 +266,7 @@ _egl_image_create(EVGL_Context *context, int target, void *buffer)
266 attribs[n++] = 0; 266 attribs[n++] = 0;
267 attribs[n++] = EGL_NONE; 267 attribs[n++] = EGL_NONE;
268 268
269 return EXT_FUNC(eglCreateImage)(dpy, ctx, target, (EGLClientBuffer)(uintptr_t)buffer, attribs); 269 return EXT_FUNC_EGL(eglCreateImage)(dpy, ctx, target, (EGLClientBuffer)(uintptr_t)buffer, attribs);
270#else 270#else
271 (void) context; (void) target; (void) buffer; 271 (void) context; (void) target; (void) buffer;
272 return NULL; 272 return NULL;
@@ -290,7 +290,7 @@ _egl_image_destroy(void *image)
290 dpy = (EGLDisplay)rsc->display; 290 dpy = (EGLDisplay)rsc->display;
291 if (!dpy) return; 291 if (!dpy) return;
292 292
293 EXT_FUNC(eglDestroyImage)(dpy, image); 293 EXT_FUNC_EGL(eglDestroyImage)(dpy, image);
294#else 294#else
295 (void) image; 295 (void) image;
296#endif 296#endif
@@ -883,10 +883,9 @@ _context_ext_check(EVGL_Context *ctx)
883 fbo_supported = 1; 883 fbo_supported = 1;
884 } 884 }
885 885
886 if (EXTENSION_SUPPORT(EGL_KHR_image_base)) 886 if (EXTENSION_SUPPORT_EGL(EGL_KHR_image_base))
887 egl_image_supported = 1; 887 egl_image_supported = 1;
888 888 if (EXTENSION_SUPPORT_EGL(EGL_KHR_gl_texture_2D_image))
889 if (EXTENSION_SUPPORT(EGL_KHR_gl_texture_2D_image))
890 texture_image_supported = 1; 889 texture_image_supported = 1;
891#else 890#else
892 fbo_supported = 1; 891 fbo_supported = 1;
@@ -2505,10 +2504,22 @@ evgl_string_query(int name)
2505 switch(name) 2504 switch(name)
2506 { 2505 {
2507 case EVAS_GL_EXTENSIONS: 2506 case EVAS_GL_EXTENSIONS:
2508 rsc = _evgl_tls_resource_get(); 2507 {
2509 if ((rsc) && (rsc->current_ctx)) 2508 Eina_Strbuf *extstr = eina_strbuf_new();
2510 ctx_version = rsc->current_ctx->version; 2509 const char *glstr = NULL, *eglstr = NULL, *str = NULL;
2511 return evgl_api_ext_string_get(EINA_FALSE, ctx_version); 2510 rsc = _evgl_tls_resource_get();
2511 if ((rsc) && (rsc->current_ctx))
2512 ctx_version = rsc->current_ctx->version;
2513 glstr = evgl_api_ext_string_get(EINA_FALSE, ctx_version);
2514 if (glstr)
2515 eina_strbuf_append(extstr, glstr);
2516 eglstr = evgl_api_ext_egl_string_get();
2517 if (eglstr)
2518 eina_strbuf_append(extstr, eglstr);
2519 str = eina_strbuf_string_steal(extstr);
2520 eina_strbuf_free(extstr);
2521 return str;
2522 }
2512 2523
2513 default: 2524 default:
2514 return ""; 2525 return "";
@@ -2756,6 +2767,12 @@ evgl_get_pixels_post(void)
2756Evas_GL_API * 2767Evas_GL_API *
2757evgl_api_get(void *eng_data, Evas_GL_Context_Version version) 2768evgl_api_get(void *eng_data, Evas_GL_Context_Version version)
2758{ 2769{
2770#ifdef GL_GLES
2771 if (!evgl_api_egl_ext_init(evgl_engine->funcs->proc_address_get, evgl_engine->funcs->ext_string_get(eng_data)))
2772 {
2773 ERR("EGL extensions initialization failed");
2774 }
2775#endif
2759 if (version == EVAS_GL_GLES_2_X) 2776 if (version == EVAS_GL_GLES_2_X)
2760 { 2777 {
2761 if (!gles2_funcs) gles2_funcs = calloc(1, EVAS_GL_API_STRUCT_SIZE); 2778 if (!gles2_funcs) gles2_funcs = calloc(1, EVAS_GL_API_STRUCT_SIZE);