diff options
author | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-06 03:32:18 +0000 |
---|---|---|
committer | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-06 03:32:18 +0000 |
commit | 7b804737da08be40c307ca98c57a3595c468ab5a (patch) | |
tree | 36d200d5f1cd305963311ad41a3c861df036c313 /ui/gfx/gl | |
parent | 950fc1eff7bc711dd6a25433b246de30186d277d (diff) | |
download | chromium_src-7b804737da08be40c307ca98c57a3595c468ab5a.zip chromium_src-7b804737da08be40c307ca98c57a3595c468ab5a.tar.gz chromium_src-7b804737da08be40c307ca98c57a3595c468ab5a.tar.bz2 |
Bind to eglCreateImageKHR and eglDestroyImageKHR when KHR_image_base is advertised by EGL.
At the moment we only bind to them if KHR_image (a superset) is advertised.
Because we determine to which extension each entry point belongs by parsing the header files and those entry points are not listed for KHR_image_base, I had to add some code to the autogenerator script to to add extra extensions for each entry point.
Review URL: http://codereview.chromium.org/9111039
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116640 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/gl')
-rwxr-xr-x | ui/gfx/gl/generate_bindings.py | 24 | ||||
-rw-r--r-- | ui/gfx/gl/gl_interface.h | 5 |
2 files changed, 20 insertions, 9 deletions
diff --git a/ui/gfx/gl/generate_bindings.py b/ui/gfx/gl/generate_bindings.py index f255401..20807b2 100755 --- a/ui/gfx/gl/generate_bindings.py +++ b/ui/gfx/gl/generate_bindings.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# Copyright (c) 2011 The Chromium Authors. All rights reserved. +# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -192,6 +192,9 @@ GL_FUNCTIONS = [ 'names': ['glEGLImageTargetTexture2DOES'], 'arguments': 'GLenum target, GLeglImageOES image', }, { 'return_type': 'void', + 'names': ['glEGLImageTargetRenderbufferStorageOES'], + 'arguments': 'GLenum target, GLeglImageOES image', }, +{ 'return_type': 'void', 'names': ['glEnable'], 'arguments': 'GLenum cap', }, { 'return_type': 'void', @@ -708,10 +711,12 @@ EGL_FUNCTIONS = [ 'names': ['eglCreateImageKHR'], 'arguments': 'EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, ' - 'const EGLint* attrib_list', }, + 'const EGLint* attrib_list', + 'other_extensions': ['EGL_KHR_image_base'] }, { 'return_type': 'EGLBoolean', 'names': ['eglDestroyImageKHR'], - 'arguments': 'EGLDisplay dpy, EGLImageKHR image', }, + 'arguments': 'EGLDisplay dpy, EGLImageKHR image', + 'other_extensions': ['EGL_KHR_image_base'] }, { 'return_type': 'EGLSurface', 'names': ['eglCreateWindowSurface'], 'arguments': 'EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, ' @@ -1421,7 +1426,7 @@ def GetUsedExtensionFunctions(functions, extension_headers, extra_extensions): """ # Parse known extensions. extensions = GetExtensionFunctions(extension_headers) - functions_to_extensions = GetFunctionToExtensionMap(extensions) + functions_to_extension = GetFunctionToExtensionMap(extensions) # Collect all used extension functions. used_extension_functions = collections.defaultdict(lambda: []) @@ -1429,12 +1434,15 @@ def GetUsedExtensionFunctions(functions, extension_headers, extra_extensions): for name in func['names']: # Make sure we know about all extension functions. if (LooksLikeExtensionFunction(name) and - not name in functions_to_extensions): + not name in functions_to_extension): raise RuntimeError('%s looks like an extension function but does not ' 'belong to any of the known extensions.' % name) - if name in functions_to_extensions: - extension = functions_to_extensions[name] - used_extension_functions[extension].append((func['names'][0], name)) + if name in functions_to_extension: + extensions = [functions_to_extension[name]] + if 'other_extensions' in func: + extensions.extend(func['other_extensions']) + for extension in extensions: + used_extension_functions[extension].append((func['names'][0], name)) # Add extensions that do not have any functions. used_extension_functions.update(dict( diff --git a/ui/gfx/gl/gl_interface.h b/ui/gfx/gl/gl_interface.h index a6e5aca..bd372fb 100644 --- a/ui/gfx/gl/gl_interface.h +++ b/ui/gfx/gl/gl_interface.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -188,6 +188,9 @@ class GL_EXPORT GLInterface { virtual void EGLImageTargetTexture2DOES( GLenum target, GLeglImageOES image) = 0; + virtual void EGLImageTargetRenderbufferStorageOES( + GLenum target, GLeglImageOES image) = 0; + virtual void Enable(GLenum cap) = 0; virtual void EnableVertexAttribArray(GLuint index) = 0; |