summaryrefslogtreecommitdiffstats
path: root/ui/gfx/gl/gl_context_osmesa.cc
diff options
context:
space:
mode:
authorjoth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-27 18:30:44 +0000
committerjoth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-27 18:30:44 +0000
commit6494823b83620eb43763364d4bb775e36f4d452e (patch)
tree0f620ad317811b22585100818a23a9ed839ac6f0 /ui/gfx/gl/gl_context_osmesa.cc
parent87a8296b236bc96bd87d05f57180a35300159ed1 (diff)
downloadchromium_src-6494823b83620eb43763364d4bb775e36f4d452e.zip
chromium_src-6494823b83620eb43763364d4bb775e36f4d452e.tar.gz
chromium_src-6494823b83620eb43763364d4bb775e36f4d452e.tar.bz2
Split GL binding init into core and extension part
This change splits the GL binding initialization into to phases: core functions and extension functions. This is motivated by two peculiarities of the EGL window binding layer: 1. Pointers to core GL entry points may not be queried through eglGetProcAddress(). 2. The return value of eglGetProcAddress() is not specified to be NULL for unsupported functions. In light of these limitations, the current strategy of blindly querying all GL entry points from eglGetProcAddress() and falling back to dlsym() results in bogus function pointers on some EGL implementations. This patch fixes the problem as follows: 1. Add GetGLCoreProcAddress() that only queries dlsym() and use it to initialize pointers to all entry points. On EGL based platforms pointers to extension functions will most likely be NULL at this point. 2. When a context is first made current, look up the set of supported extensions and use GetGLProcAddress() to populate the remaining extension function pointers. The reworked GL bindings generator uses the standard Khronos headers to recognize the extension functions and produce appropriate initialization code. Note that the patch also updates gl2ext.h to match the upstream Khronos version and corrects some minor errors in the downstream changes. BUG=5427391 TEST= Review URL: http://codereview.chromium.org/8381001 Patch from Sami Kyostila <skyostil@chromium.org>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107602 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/gl/gl_context_osmesa.cc')
-rw-r--r--ui/gfx/gl/gl_context_osmesa.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/gfx/gl/gl_context_osmesa.cc b/ui/gfx/gl/gl_context_osmesa.cc
index df7766d..efa6d16 100644
--- a/ui/gfx/gl/gl_context_osmesa.cc
+++ b/ui/gfx/gl/gl_context_osmesa.cc
@@ -70,6 +70,11 @@ bool GLContextOSMesa::MakeCurrent(GLSurface* surface) {
OSMesaPixelStore(OSMESA_Y_UP, 0);
SetCurrent(this, surface);
+ if (!InitializeExtensionBindings()) {
+ ReleaseCurrent(surface);
+ return false;
+ }
+
if (!surface->OnMakeCurrent(this)) {
LOG(ERROR) << "Could not make current.";
return false;