gl-renderer: fix configless_context check

EGL_MESA_configless_context is a display extension. The query for client
extensions was overwriting the pointer, so it was being searched from
the client extensions instead.

Fix any confusion here by moving all client extension checks into
another function. Drop a useless cast.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
dev
Pekka Paalanen 10 years ago committed by Daniel Stone
parent f282454cf6
commit 8b69d03faf
  1. 33
      src/gl-renderer.c

@ -2086,6 +2086,24 @@ gl_renderer_destroy(struct weston_compositor *ec)
free(gr); free(gr);
} }
static void
renderer_setup_egl_client_extensions(struct gl_renderer *gr)
{
const char *extensions;
extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
if (!extensions) {
weston_log("Retrieving EGL client extension string failed.\n");
return;
}
if (strstr(extensions, "EGL_EXT_platform_base"))
gr->create_platform_window =
(void *) eglGetProcAddress("eglCreatePlatformWindowSurfaceEXT");
else
weston_log("warning: EGL_EXT_platform_base not supported.\n");
}
static int static int
gl_renderer_setup_egl_extensions(struct weston_compositor *ec) gl_renderer_setup_egl_extensions(struct weston_compositor *ec)
{ {
@ -2132,24 +2150,13 @@ gl_renderer_setup_egl_extensions(struct weston_compositor *ec)
"supported. Performance could be affected.\n"); "supported. Performance could be affected.\n");
#endif #endif
extensions =
(const char *) eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
if (!extensions) {
weston_log("Retrieving EGL client extension string failed.\n");
return 0;
}
if (strstr(extensions, "EGL_EXT_platform_base"))
gr->create_platform_window =
(void *) eglGetProcAddress("eglCreatePlatformWindowSurfaceEXT");
else
weston_log("warning: EGL_EXT_platform_base not supported.\n");
#ifdef EGL_MESA_configless_context #ifdef EGL_MESA_configless_context
if (strstr(extensions, "EGL_MESA_configless_context")) if (strstr(extensions, "EGL_MESA_configless_context"))
gr->has_configless_context = 1; gr->has_configless_context = 1;
#endif #endif
renderer_setup_egl_client_extensions(gr);
return 0; return 0;
} }

Loading…
Cancel
Save