mutter/cogl/winsys
Neil Roberts d259a87602 Don't use the 'NULL' GModule to resolve GL symbols
Previously, _cogl_get_proc_address had a fallback to resolve the
symbol using g_module_open(NULL) to get the symbol from anywhere in
the address space. The EGL backend ends up using this on some drivers
because eglGetProcAddress isn't meant to return a pointer for core
functions. This causes problems if something in the process is linking
against a different GL library, for example Cairo may be linking
against libGL itself. In this case it may end up resolving symbols
from the GL library even if GLES is being used.

This patch removes the fallback. The EGL version now has its own
fallback instead which passes the existing libgl_module from the
renderer to g_module_symbol so that it should only get symbols from
that library or its dependency chain. The GLX and WGL winsys only call
glXGetProcAddress and wglGetProcAddress. The stub winsys does however
continue using the global symbol lookup.

The internal _cogl_get_proc_address function has been renamed to
_cogl_renderer_get_proc_address because it needs a connected renderer
to work so it could be considered to be a renderer method. The pointer
to the renderer is passed down to the winsys backends so that it can
use the data attached to the renderer to get the module pointers.

https://bugzilla.gnome.org/show_bug.cgi?id=655412

Reviewed-by: Robert Bragg <robert@linux.intel.com>
2011-07-27 16:10:02 +01:00
..
cogl-texture-pixmap-x11-private.h texture-pixmap-x11: Move GLX code to cogl-winsys-glx.c 2011-05-05 14:46:01 +01:00
cogl-texture-pixmap-x11.c texture-pixmap-x11: set ->winsys = NULL if _create fails 2011-07-18 16:49:07 +01:00
cogl-texture-pixmap-x11.h docs: API reference fixes 2010-09-20 13:15:44 +01:00
cogl-winsys-egl-feature-functions.h build: don't referencing wayland syms if not available 2011-07-13 19:06:19 +01:00
cogl-winsys-egl-private.h Add _cogl_egl_texture_2d_new_from_image API 2011-06-01 20:44:42 +01:00
cogl-winsys-egl.c Don't use the 'NULL' GModule to resolve GL symbols 2011-07-27 16:10:02 +01:00
cogl-winsys-glx-feature-functions.h Moves all GLX code down from Clutter to Cogl 2011-04-11 17:54:36 +01:00
cogl-winsys-glx.c Don't use the 'NULL' GModule to resolve GL symbols 2011-07-27 16:10:02 +01:00
cogl-winsys-private.h Don't use the 'NULL' GModule to resolve GL symbols 2011-07-27 16:10:02 +01:00
cogl-winsys-sdl.c Don't use the 'NULL' GModule to resolve GL symbols 2011-07-27 16:10:02 +01:00
cogl-winsys-stub-private.h Make stub winsys into a proper winsys backend 2011-06-01 20:44:41 +01:00
cogl-winsys-stub.c Don't use the 'NULL' GModule to resolve GL symbols 2011-07-27 16:10:02 +01:00
cogl-winsys-wgl-feature-functions.h Add a WGL winsys 2011-05-10 17:58:41 +01:00
cogl-winsys-wgl.c Don't use the 'NULL' GModule to resolve GL symbols 2011-07-27 16:10:02 +01:00
cogl-winsys.c Don't use the 'NULL' GModule to resolve GL symbols 2011-07-27 16:10:02 +01:00