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

Unified Diff: ui/gl/generate_bindings.py

Issue 90333003: Remove --enable-gpu-service-logging and --enable-gpu-client-logging (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 1 month 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 | « gpu/command_buffer/service/program_manager.cc ('k') | 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 98c75028bb515f4da108c0d18b603c0e7d85dfcc..ef1937eeeee5e580a5466b2c61c31f076083aea2 100755
--- a/ui/gl/generate_bindings.py
+++ b/ui/gl/generate_bindings.py
@@ -86,10 +86,7 @@ GL_FUNCTIONS = [
{ 'return_type': 'GLenum',
'names': ['glCheckFramebufferStatusEXT',
'glCheckFramebufferStatus'],
- 'arguments': 'GLenum target',
- 'logging_code': """
- GL_SERVICE_LOG("GL_RESULT: " << GLES2Util::GetStringEnum(result));
-""", },
+ 'arguments': 'GLenum target', },
{ 'return_type': 'void',
'names': ['glClear'],
'arguments': 'GLbitfield mask', },
@@ -293,10 +290,7 @@ GL_FUNCTIONS = [
'arguments': 'GLenum target, GLenum pname, GLint* params', },
{ 'return_type': 'GLenum',
'names': ['glGetError'],
- 'arguments': 'void',
- 'logging_code': """
- GL_SERVICE_LOG("GL_RESULT: " << GLES2Util::GetStringError(result));
-""", },
+ 'arguments': 'void', },
{ 'return_type': 'void',
'names': ['glGetFloatv'],
'arguments': 'GLenum pname, GLfloat* params', },
@@ -512,23 +506,8 @@ GL_FUNCTIONS = [
{ 'return_type': 'void',
'names': ['glShaderSource'],
'arguments':
- 'GLuint shader, GLsizei count, const char* const* str, const GLint* length',
- 'logging_code': """
- GL_SERVICE_LOG_CODE_BLOCK({
- for (GLsizei ii = 0; ii < count; ++ii) {
- if (str[ii]) {
- if (length && length[ii] >= 0) {
- std::string source(str[ii], length[ii]);
- GL_SERVICE_LOG(" " << ii << ": ---\\n" << source << "\\n---");
- } else {
- GL_SERVICE_LOG(" " << ii << ": ---\\n" << str[ii] << "\\n---");
- }
- } else {
- GL_SERVICE_LOG(" " << ii << ": NULL");
- }
- }
- });
-""", },
+ 'GLuint shader, GLsizei count, const char* const* str, '
+ 'const GLint* length', },
{ 'return_type': 'void',
'names': ['glStencilFunc'],
'arguments': 'GLenum func, GLint ref, GLuint mask', },
@@ -1223,7 +1202,7 @@ def GenerateHeader(file, functions, set_name, used_extension_functions):
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// This file is automatically generated.
+// This file is automatically generated by %(script)s.
#ifndef UI_GFX_GL_GL_BINDINGS_AUTOGEN_%(name)s_H_
#define UI_GFX_GL_GL_BINDINGS_AUTOGEN_%(name)s_H_
@@ -1232,7 +1211,7 @@ namespace gfx {
class GLContext;
-""" % {'name': set_name.upper()})
+""" % {'name': set_name.upper(), 'script': sys.argv[0]})
# Write typedefs for function pointer types. Always use the GL name for the
# typedef.
@@ -1383,7 +1362,6 @@ namespace gfx {
# Write definitions of function pointers.
file.write('\n')
- file.write('static bool g_debugBindingsInitialized;\n')
file.write('Driver%s g_driver_%s;\n' % (set_name.upper(), set_name.lower()))
file.write('\n')
@@ -1428,103 +1406,8 @@ namespace gfx {
(entry_point_name, entry_point_name, function_name))
queried_entry_points.add(entry_point_name)
file.write(' }\n')
- file.write(' if (g_debugBindingsInitialized)\n')
- file.write(' UpdateDebugExtensionBindings();\n')
- file.write('}\n')
- file.write('\n')
-
- # Write logging wrappers for each function.
- file.write('extern "C" {\n')
- for func in functions:
- names = func['names']
- return_type = func['return_type']
- arguments = func['arguments']
- file.write('\n')
- file.write('static %s GL_BINDING_CALL Debug_%s(%s) {\n' %
- (return_type, names[0], arguments))
- argument_names = re.sub(
- r'(const )?[a-zA-Z0-9_]+\** ([a-zA-Z0-9_]+)', r'\2', arguments)
- argument_names = re.sub(
- r'(const )?[a-zA-Z0-9_]+\** ([a-zA-Z0-9_]+)', r'\2', argument_names)
- log_argument_names = re.sub(
- r'const char\* ([a-zA-Z0-9_]+)', r'CONSTCHAR_\1', arguments)
- log_argument_names = re.sub(
- r'(const )?[a-zA-Z0-9_]+\* ([a-zA-Z0-9_]+)',
- r'CONSTVOID_\2', log_argument_names)
- log_argument_names = re.sub(
- r'(?<!E)GLenum ([a-zA-Z0-9_]+)', r'GLenum_\1', log_argument_names)
- log_argument_names = re.sub(
- r'(?<!E)GLboolean ([a-zA-Z0-9_]+)', r'GLboolean_\1', log_argument_names)
- log_argument_names = re.sub(
- r'(const )?[a-zA-Z0-9_]+\** ([a-zA-Z0-9_]+)', r'\2',
- log_argument_names)
- log_argument_names = re.sub(
- r'(const )?[a-zA-Z0-9_]+\** ([a-zA-Z0-9_]+)', r'\2',
- log_argument_names)
- log_argument_names = re.sub(
- r'CONSTVOID_([a-zA-Z0-9_]+)',
- r'static_cast<const void*>(\1)', log_argument_names);
- log_argument_names = re.sub(
- r'CONSTCHAR_([a-zA-Z0-9_]+)', r'\1', log_argument_names);
- log_argument_names = re.sub(
- r'GLenum_([a-zA-Z0-9_]+)', r'GLES2Util::GetStringEnum(\1)',
- log_argument_names)
- log_argument_names = re.sub(
- r'GLboolean_([a-zA-Z0-9_]+)', r'GLES2Util::GetStringBool(\1)',
- log_argument_names)
- log_argument_names = log_argument_names.replace(',', ' << ", " <<')
- if argument_names == 'void' or argument_names == '':
- argument_names = ''
- log_argument_names = ''
- else:
- log_argument_names = " << " + log_argument_names
- function_name = names[0]
- if return_type == 'void':
- file.write(' GL_SERVICE_LOG("%s" << "(" %s << ")");\n' %
- (function_name, log_argument_names))
- file.write(' g_driver_%s.debug_fn.%sFn(%s);\n' %
- (set_name.lower(), function_name, argument_names))
- if 'logging_code' in func:
- file.write("%s\n" % func['logging_code'])
- else:
- file.write(' GL_SERVICE_LOG("%s" << "(" %s << ")");\n' %
- (function_name, log_argument_names))
- file.write(' %s result = g_driver_%s.debug_fn.%sFn(%s);\n' %
- (return_type, set_name.lower(), function_name, argument_names))
- if 'logging_code' in func:
- file.write("%s\n" % func['logging_code'])
- else:
- file.write(' GL_SERVICE_LOG("GL_RESULT: " << result);\n');
- file.write(' return result;\n')
- file.write('}\n')
- file.write('} // extern "C"\n')
-
- # Write function to initialize the debug function pointers.
- file.write('\n')
- file.write('void Driver%s::InitializeDebugBindings() {\n' %
- set_name.upper())
- for func in functions:
- first_name = func['names'][0]
- file.write(' if (!debug_fn.%sFn) {\n' % first_name)
- file.write(' debug_fn.%sFn = fn.%sFn;\n' % (first_name, first_name))
- file.write(' fn.%sFn = Debug_%s;\n' % (first_name, first_name))
- file.write(' }\n')
- file.write(' g_debugBindingsInitialized = true;\n')
file.write('}\n')
-
- # Write function to update the debug function pointers to extension functions
- # after the extensions have been initialized.
file.write('\n')
- file.write('void Driver%s::UpdateDebugExtensionBindings() {\n' %
- set_name.upper())
- for extension, ext_functions in used_extension_functions:
- for name, _ in ext_functions:
- file.write(' if (debug_fn.%sFn != fn.%sFn &&\n' % (name, name))
- file.write(' fn.%sFn != Debug_%s) {\n' % (name, name))
- file.write(' debug_fn.%sFn = fn.%sFn;\n' % (name, name))
- file.write(' fn.%sFn = Debug_%s;\n' % (name, name))
- file.write(' }\n')
- file.write('}\n')
# Write function to clear all function pointers.
file.write('\n')
« no previous file with comments | « gpu/command_buffer/service/program_manager.cc ('k') | ui/gl/gl_bindings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698