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

Unified Diff: gpu/command_buffer/build_gles2_cmd_buffer.py

Issue 867333002: Use enum string instead of value in code generator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | gpu/command_buffer/client/gles2_implementation_impl_autogen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/build_gles2_cmd_buffer.py
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py
index a5ee8a1f985b410db65d5a1586f950b6c83c2787..70dc76d46260444f9139a64ca8ccf60496d8f9f3 100755
--- a/gpu/command_buffer/build_gles2_cmd_buffer.py
+++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -1372,8 +1372,7 @@ _NAMED_TYPE_INFO = {
'type': 'GLenum',
'is_complete': True,
'valid': [
- #TODO(zmo): avoid using the direct number.
- '0x9117', # GL_SYNC_GPU_COMMANDS_COMPLETE
+ 'GL_SYNC_GPU_COMMANDS_COMPLETE',
],
'invalid': [
'0',
@@ -8889,6 +8888,15 @@ class GLGenerator(object):
def WriteFormat(self, filename):
"""Writes the command buffer format"""
file = CHeaderWriter(filename)
+ # Forward declaration of a few enums used in constant argument
+ # to avoid including GL header files.
+ enum_defines = {
+ 'GL_SYNC_GPU_COMMANDS_COMPLETE': 0x9117,
+ }
+ file.Write('\n')
+ for enum in enum_defines:
+ file.Write("#define %s 0x%x\n" % (enum, enum_defines[enum]))
+ file.Write('\n')
for func in self.functions:
if True:
#gen_cmd = func.GetInfo('gen_cmd')
« no previous file with comments | « no previous file | gpu/command_buffer/client/gles2_implementation_impl_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698