Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(529)

Unified Diff: ui/gl/generate_bindings.py

Issue 165723010: Move NullDraw GL bindings and allow them to be disabled temporarily. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: glnulldraw: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/gl/gl_bindings.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/generate_bindings.py
diff --git a/ui/gl/generate_bindings.py b/ui/gl/generate_bindings.py
index 88407668090486bb68d07093a7e9587a16d43e0d..c8d0bbd97d7038a399f367036ee9da399ef7f546 100755
--- a/ui/gl/generate_bindings.py
+++ b/ui/gl/generate_bindings.py
@@ -821,19 +821,6 @@ GL_FUNCTIONS = [
'const GLenum* attachments' },
]
-GL_NULLDRAW_FUNCTIONS = [
-{ 'return_type': 'void',
- 'names': ['glClear'],
- 'arguments': 'GLbitfield mask', },
-{ 'return_type': 'void',
- 'names': ['glDrawArrays'],
- 'arguments': 'GLenum mode, GLint first, GLsizei count', },
-{ 'return_type': 'void',
- 'names': ['glDrawElements'],
- 'arguments':
- 'GLenum mode, GLsizei count, GLenum type, const void* indices', },
-]
-
OSMESA_FUNCTIONS = [
{ 'return_type': 'OSMesaContext',
'names': ['OSMesaCreateContext'],
@@ -1264,7 +1251,7 @@ GLX_FUNCTIONS = [
]
FUNCTION_SETS = [
- [GL_FUNCTIONS, GL_NULLDRAW_FUNCTIONS, 'gl', [
+ [GL_FUNCTIONS, 'gl', [
'GL/glext.h',
'GLES2/gl2ext.h',
# Files below are Chromium-specific and shipped with Chromium sources.
@@ -1272,8 +1259,8 @@ FUNCTION_SETS = [
'GLES2/gl2chromium.h',
'GLES2/gl2extchromium.h'
], []],
- [OSMESA_FUNCTIONS, [], 'osmesa', [], []],
- [EGL_FUNCTIONS, [], 'egl', [
+ [OSMESA_FUNCTIONS, 'osmesa', [], []],
+ [EGL_FUNCTIONS, 'egl', [
'EGL/eglext.h',
# Files below are Chromium-specific and shipped with Chromium sources.
'EGL/eglextchromium.h',
@@ -1283,8 +1270,8 @@ FUNCTION_SETS = [
'EGL_ANGLE_surface_d3d_texture_2d_share_handle',
],
],
- [WGL_FUNCTIONS, [], 'wgl', ['GL/wglext.h'], []],
- [GLX_FUNCTIONS, [], 'glx', ['GL/glx.h', 'GL/glxext.h'], []],
+ [WGL_FUNCTIONS, 'wgl', ['GL/wglext.h'], []],
+ [GLX_FUNCTIONS, 'glx', ['GL/glx.h', 'GL/glxext.h'], []],
]
def GenerateHeader(file, functions, set_name, used_extensions):
@@ -1405,8 +1392,7 @@ def GenerateMockHeader(file, functions, set_name):
file.write('\n')
-def GenerateSource(
- file, functions, nulldraw_functions, set_name, used_extensions):
+def GenerateSource(file, functions, set_name, used_extensions):
"""Generates gl_bindings_autogen_x.cc"""
# Write file header.
@@ -1567,17 +1553,6 @@ namespace gfx {
file.write('}\n')
file.write('\n')
- # Write empty stubs for functions that want one.
- file.write('extern "C" {\n')
- for func in nulldraw_functions:
- known_as = func['known_as']
- return_type = func['return_type']
- arguments = func['arguments']
- file.write('\n')
- file.write('static %s GL_BINDING_CALL Stub_%s(%s) {}\n' %
- (return_type, known_as, arguments))
- file.write('} // extern "C"\n')
-
# Write logging wrappers for each function.
file.write('extern "C" {\n')
for func in functions:
@@ -1656,17 +1631,6 @@ namespace gfx {
file.write(' g_debugBindingsInitialized = true;\n')
file.write('}\n')
- # Write function to initialize the nulldraw function pointers.
- if nulldraw_functions:
- file.write('\n')
- file.write('void Driver%s::InitializeNullDrawBindings() {\n' %
- set_name.upper())
-
- for func in nulldraw_functions:
- first_name = func['known_as']
- file.write(' fn.%sFn = Stub_%s;\n' % (first_name, first_name))
- file.write('}\n')
-
# Write function to clear all function pointers.
file.write('\n')
file.write("""void Driver%s::ClearBindings() {
@@ -1979,7 +1943,7 @@ def main(argv):
options, args = parser.parse_args(argv)
if options.inputs:
- for [_, _, _, headers, _] in FUNCTION_SETS:
+ for [_, _, headers, _] in FUNCTION_SETS:
for header in headers:
print ResolveHeader(header, options.header_paths)
return 0
@@ -1988,15 +1952,11 @@ def main(argv):
if len(args) >= 1:
directory = args[0]
- for [functions,
- nulldraw_functions,
- set_name,
- extension_headers,
- extensions] in FUNCTION_SETS:
+ for [functions, set_name, extension_headers, extensions] in FUNCTION_SETS:
# Function names can be specified in two ways (list of unique names or list
# of versions with different binding conditions). Fill in the data to the
# versions list in case it is missing, so that can be used from here on:
- for func in functions + nulldraw_functions:
+ for func in functions:
assert 'versions' in func or 'names' in func, 'Function with no names'
if 'versions' not in func:
func['versions'] = [{'name': n} for n in func['names']]
@@ -2025,11 +1985,7 @@ def main(argv):
source_file = open(
os.path.join(directory, 'gl_bindings_autogen_%s.cc' % set_name), 'wb')
- GenerateSource(source_file,
- functions,
- nulldraw_functions,
- set_name,
- used_extensions)
+ GenerateSource(source_file, functions, set_name, used_extensions)
source_file.close()
header_file = open(
« no previous file with comments | « no previous file | ui/gl/gl_bindings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698