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

Unified Diff: ui/gl/generate_bindings.py

Issue 12207003: Add TRACE calls for all gpu driver calls (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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 | « gpu/command_buffer/common/unittest_main.cc ('k') | ui/gl/gl_egl_api_implementation.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 d8e6866d9be8cefa2f5936fe2d54bf9d88122f84..8818c87fa32721e35fbb74b5c02d88271aa0272d 100755
--- a/ui/gl/generate_bindings.py
+++ b/ui/gl/generate_bindings.py
@@ -1347,6 +1347,7 @@ def GenerateSource(file, functions, set_name, used_extension_functions):
// This file is automatically generated.
#include <string>
+#include "base/debug/trace_event.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_context.h"
@@ -1510,7 +1511,7 @@ namespace gfx {
}
""" % set_name.upper())
- # Write RealGLApi functions
+ # Write GLApiBase functions
for func in functions:
names = func['names']
return_type = func['return_type']
@@ -1533,6 +1534,30 @@ namespace gfx {
(function_name, argument_names))
file.write('}\n')
+ # Write TraceGLApi functions
+ for func in functions:
+ names = func['names']
+ return_type = func['return_type']
+ arguments = func['arguments']
+ file.write('\n')
+ file.write('%s Trace%sApi::%sFn(%s) {\n' %
+ (return_type, set_name.upper(), 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)
+ if argument_names == 'void' or argument_names == '':
+ argument_names = ''
+ function_name = names[0]
+ file.write(' TRACE_EVENT0("gpu", "TraceGLAPI::%s")\n' % function_name)
+ if return_type == 'void':
+ file.write(' %s_api_->%sFn(%s);\n' %
+ (set_name.lower(), function_name, argument_names))
+ else:
+ file.write(' return %s_api_->%sFn(%s);\n' %
+ (set_name.lower(), function_name, argument_names))
+ file.write('}\n')
+
file.write('\n')
file.write('} // namespace gfx\n')
« no previous file with comments | « gpu/command_buffer/common/unittest_main.cc ('k') | ui/gl/gl_egl_api_implementation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698