summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/wayland_egl/evas_engine.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-07-19 12:00:07 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-07-19 12:00:07 -0500
commitc7fe083a57c7047b2752592545e419e60b1adfd9 (patch)
tree899951d3b98f20eede1b282cc82a34e3ce44bec5 /src/modules/evas/engines/wayland_egl/evas_engine.c
parent86377caa0e373d30ebe9772f21389a89e8f730dc (diff)
wayland_egl: Defer gl symbol lookups until they're possible
Commit 2e6587a14b adds a gl extension string to glsym_evas_gl_symbols() to prevent using functions that are provided by extensions that aren't available in the current gl context. However, we can't query the extension strings until after we create an egl context. Split the regular symbol lookup stuff from the gl symbol lookup stuff so we can query at the appropriate time.
Diffstat (limited to 'src/modules/evas/engines/wayland_egl/evas_engine.c')
-rw-r--r--src/modules/evas/engines/wayland_egl/evas_engine.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c b/src/modules/evas/engines/wayland_egl/evas_engine.c
index db2e3c6..1c90a5b 100644
--- a/src/modules/evas/engines/wayland_egl/evas_engine.c
+++ b/src/modules/evas/engines/wayland_egl/evas_engine.c
@@ -90,10 +90,9 @@ eng_get_ob(Render_Engine *re)
90} 90}
91 91
92static void 92static void
93gl_symbols(void) 93symbols(void)
94{ 94{
95 static Eina_Bool done = EINA_FALSE; 95 static Eina_Bool done = EINA_FALSE;
96 const char *exts = NULL;
97 96
98 if (done) return; 97 if (done) return;
99 98
@@ -137,6 +136,16 @@ gl_symbols(void)
137 LINK2GENERIC(evas_gl_common_eglCreateImage); 136 LINK2GENERIC(evas_gl_common_eglCreateImage);
138 LINK2GENERIC(evas_gl_common_eglDestroyImage); 137 LINK2GENERIC(evas_gl_common_eglDestroyImage);
139 138
139 done = EINA_TRUE;
140}
141
142void
143eng_gl_symbols(EGLDisplay edsp)
144{
145 static Eina_Bool done = EINA_FALSE;
146 const char *exts = NULL;
147
148 if (done) return;
140#define FINDSYM(dst, sym, typ) \ 149#define FINDSYM(dst, sym, typ) \
141 if (glsym_eglGetProcAddress) { \ 150 if (glsym_eglGetProcAddress) { \
142 if (!dst) dst = (typ)glsym_eglGetProcAddress(sym); \ 151 if (!dst) dst = (typ)glsym_eglGetProcAddress(sym); \
@@ -146,8 +155,7 @@ gl_symbols(void)
146 155
147 // Find EGL extensions 156 // Find EGL extensions
148 // FIXME: whgen above eglGetDisplay() is fixed... fix the below... 157 // FIXME: whgen above eglGetDisplay() is fixed... fix the below...
149// exts = eglQueryString(ob->egl_disp, EGL_EXTENSIONS); 158 exts = eglQueryString(edsp, EGL_EXTENSIONS);
150
151 // Find GL extensions 159 // Find GL extensions
152 glsym_evas_gl_symbols(glsym_eglGetProcAddress, exts); 160 glsym_evas_gl_symbols(glsym_eglGetProcAddress, exts);
153 161
@@ -1455,7 +1463,7 @@ module_open(Evas_Module *em)
1455 ORD(image_native_init); 1463 ORD(image_native_init);
1456 ORD(image_native_shutdown); 1464 ORD(image_native_shutdown);
1457 1465
1458 gl_symbols(); 1466 symbols();
1459 1467
1460 /* advertise out which functions we support */ 1468 /* advertise out which functions we support */
1461 em->functions = (void *)(&func); 1469 em->functions = (void *)(&func);