summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authormythri.venugopal <mythri.venugopal@samsung.com>2015-02-09 14:23:29 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-02-09 14:28:16 +0900
commit48d8cdb4dd430667b6c70adeabd0daffbab6249f (patch)
tree835c78cf68a30b3da901d26ce3da7537d42312c7 /src/modules
parent28e21eac0ed832714afa12413e832ee59c5bced4 (diff)
Evas GL: Fix GLES1.1 extension initialisation bug
Summary: Extension function pointer initialisation requires glGetString(GL_EXTENSIONS). To get GLESv1 extension string, GLESv1 context has to be bound. Change involves updating extensions after GLESv1 context has been bound. Reviewers: jpeg Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1946 Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_api_ext.c34
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_core.c6
2 files changed, 35 insertions, 5 deletions
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 d6a30935de..f79c1ce3e6 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
@@ -505,13 +505,37 @@ _evgl_api_gles1_ext_init(void)
505 int _curext_supported = 0; 505 int _curext_supported = 0;
506 Evas_GL_API *gles1_funcs; 506 Evas_GL_API *gles1_funcs;
507 const char *gles1_exts; 507 const char *gles1_exts;
508 EVGL_Resource *rsc;
509 EGLint context_version;
510 EGLDisplay dpy = EGLDISPLAY_GET();
508 511
509 /* Note from the EGL documentation: 512 /* glGetString returns the information for the currently bound context
510 * Function pointers returned by eglGetProcAddress are independent of the 513 * So, update gles1_exts only if GLES1 context is currently bound.
511 * display and the currently bound context and may be used by any context 514 * Check here if GLESv1 is current
512 * which supports the extension.
513 * So, we don't need to check that GLESv1 is current.
514 */ 515 */
516 if (!(rsc=_evgl_tls_resource_get()))
517 {
518 ERR("Unable to initialize GLES1 extensions. Error retrieving tls");
519 return EINA_FALSE;
520 }
521
522 if ((dpy == EGL_NO_DISPLAY) || !rsc->current_ctx)
523 {
524 DBG("Unable to initialize GLES1 extensions. Engine not initialised");
525 return EINA_FALSE;
526 }
527
528 if (!eglQueryContext(dpy, rsc->current_ctx->context, EGL_CONTEXT_CLIENT_VERSION, &context_version))
529 {
530 ERR("Unable to initialize GLES1 extensions. eglQueryContext failed 0x%x", eglGetError());
531 return EINA_FALSE;
532 }
533
534 if (context_version != EVAS_GL_GLES_1_X)
535 {
536 DBG("GLESv1 context not bound");
537 return EINA_FALSE;
538 }
515 539
516 gles1_funcs = _evgl_api_gles1_internal_get(); 540 gles1_funcs = _evgl_api_gles1_internal_get();
517 if (!gles1_funcs || !gles1_funcs->glGetString) 541 if (!gles1_funcs || !gles1_funcs->glGetString)
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 242127a985..e23777d44e 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_core.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_core.c
@@ -2304,6 +2304,12 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx)
2304 rsc->current_ctx = ctx; 2304 rsc->current_ctx = ctx;
2305 rsc->current_eng = eng_data; 2305 rsc->current_eng = eng_data;
2306 2306
2307 // Update GLESv1 extension functions after GLESv1 context is bound
2308 if (ctx->version == EVAS_GL_GLES_1_X)
2309 {
2310 evgl_api_gles1_ext_get(gles1_funcs);
2311 }
2312
2307 _surface_context_list_print(); 2313 _surface_context_list_print();
2308 2314
2309 return 1; 2315 return 1;