| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """code generator for GLES2 command buffers.""" | 6 """code generator for GLES2 command buffers.""" |
| 7 | 7 |
| 8 import itertools | 8 import itertools |
| 9 import os | 9 import os |
| 10 import os.path | 10 import os.path |
| (...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1107 }, | 1107 }, |
| 1108 'FalseOnly': { | 1108 'FalseOnly': { |
| 1109 'type': 'GLboolean', | 1109 'type': 'GLboolean', |
| 1110 'valid': [ | 1110 'valid': [ |
| 1111 'false', | 1111 'false', |
| 1112 ], | 1112 ], |
| 1113 'invalid': [ | 1113 'invalid': [ |
| 1114 'true', | 1114 'true', |
| 1115 ], | 1115 ], |
| 1116 }, | 1116 }, |
| 1117 'ResetStatus': { |
| 1118 'type': 'GLenum', |
| 1119 'valid': [ |
| 1120 'GL_GUILTY_CONTEXT_RESET_ARB', |
| 1121 'GL_INNOCENT_CONTEXT_RESET_ARB', |
| 1122 'GL_UNKNOWN_CONTEXT_RESET_ARB', |
| 1123 ], |
| 1124 }, |
| 1117 } | 1125 } |
| 1118 | 1126 |
| 1119 # This table specifies the different pepper interfaces that are supported for | 1127 # This table specifies the different pepper interfaces that are supported for |
| 1120 # GL commands. 'dev' is true if it's a dev interface. | 1128 # GL commands. 'dev' is true if it's a dev interface. |
| 1121 _PEPPER_INTERFACES = [ | 1129 _PEPPER_INTERFACES = [ |
| 1122 {'name': '', 'dev': False}, | 1130 {'name': '', 'dev': False}, |
| 1123 {'name': 'InstancedArrays', 'dev': False}, | 1131 {'name': 'InstancedArrays', 'dev': False}, |
| 1124 {'name': 'FramebufferBlit', 'dev': False}, | 1132 {'name': 'FramebufferBlit', 'dev': False}, |
| 1125 {'name': 'FramebufferMultisample', 'dev': False}, | 1133 {'name': 'FramebufferMultisample', 'dev': False}, |
| 1126 {'name': 'ChromiumEnableFeature', 'dev': False}, | 1134 {'name': 'ChromiumEnableFeature', 'dev': False}, |
| (...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2289 'type': 'PUTn', | 2297 'type': 'PUTn', |
| 2290 'count': 1, | 2298 'count': 1, |
| 2291 'data_type': 'GLenum', | 2299 'data_type': 'GLenum', |
| 2292 'cmd_args': 'GLenum target, GLsizei count, ' | 2300 'cmd_args': 'GLenum target, GLsizei count, ' |
| 2293 'const GLenum* attachments', | 2301 'const GLenum* attachments', |
| 2294 'decoder_func': 'DoDiscardFramebufferEXT', | 2302 'decoder_func': 'DoDiscardFramebufferEXT', |
| 2295 'unit_test': False, | 2303 'unit_test': False, |
| 2296 'client_test': False, | 2304 'client_test': False, |
| 2297 'extension': True, | 2305 'extension': True, |
| 2298 }, | 2306 }, |
| 2307 'LoseContextCHROMIUM': { |
| 2308 'type': 'Manual', |
| 2309 'impl_func': True, |
| 2310 'extension': True, |
| 2311 'chromium': True, |
| 2312 }, |
| 2299 } | 2313 } |
| 2300 | 2314 |
| 2301 | 2315 |
| 2302 def Grouper(n, iterable, fillvalue=None): | 2316 def Grouper(n, iterable, fillvalue=None): |
| 2303 """Collect data into fixed-length chunks or blocks""" | 2317 """Collect data into fixed-length chunks or blocks""" |
| 2304 args = [iter(iterable)] * n | 2318 args = [iter(iterable)] * n |
| 2305 return itertools.izip_longest(fillvalue=fillvalue, *args) | 2319 return itertools.izip_longest(fillvalue=fillvalue, *args) |
| 2306 | 2320 |
| 2307 | 2321 |
| 2308 def SplitWords(input_string): | 2322 def SplitWords(input_string): |
| (...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3347 def WriteImmediateServiceImplementation(self, func, file): | 3361 def WriteImmediateServiceImplementation(self, func, file): |
| 3348 """Overrriden from TypeHandler.""" | 3362 """Overrriden from TypeHandler.""" |
| 3349 pass | 3363 pass |
| 3350 | 3364 |
| 3351 def WriteImmediateFormatTest(self, func, file): | 3365 def WriteImmediateFormatTest(self, func, file): |
| 3352 """Overrriden from TypeHandler.""" | 3366 """Overrriden from TypeHandler.""" |
| 3353 file.Write("// TODO(gman): Implement test for %s\n" % func.name) | 3367 file.Write("// TODO(gman): Implement test for %s\n" % func.name) |
| 3354 | 3368 |
| 3355 def WriteGLES2Implementation(self, func, file): | 3369 def WriteGLES2Implementation(self, func, file): |
| 3356 """Overrriden from TypeHandler.""" | 3370 """Overrriden from TypeHandler.""" |
| 3357 pass | 3371 if func.GetInfo('impl_func'): |
| 3372 super(ManualHandler, self).WriteGLES2Implementation(func, file) |
| 3358 | 3373 |
| 3359 def WriteGLES2ImplementationHeader(self, func, file): | 3374 def WriteGLES2ImplementationHeader(self, func, file): |
| 3360 """Overrriden from TypeHandler.""" | 3375 """Overrriden from TypeHandler.""" |
| 3361 file.Write("virtual %s %s(%s) OVERRIDE;\n" % | 3376 file.Write("virtual %s %s(%s) OVERRIDE;\n" % |
| 3362 (func.return_type, func.original_name, | 3377 (func.return_type, func.original_name, |
| 3363 func.MakeTypedOriginalArgString(""))) | 3378 func.MakeTypedOriginalArgString(""))) |
| 3364 file.Write("\n") | 3379 file.Write("\n") |
| 3365 | 3380 |
| 3366 def WriteImmediateCmdGetTotalSize(self, func, file): | 3381 def WriteImmediateCmdGetTotalSize(self, func, file): |
| 3367 """Overrriden from TypeHandler.""" | 3382 """Overrriden from TypeHandler.""" |
| (...skipping 4197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7565 gen.WriteGLES2Header("../GLES2/gl2chromium.h") | 7580 gen.WriteGLES2Header("../GLES2/gl2chromium.h") |
| 7566 | 7581 |
| 7567 if gen.errors > 0: | 7582 if gen.errors > 0: |
| 7568 print "%d errors" % gen.errors | 7583 print "%d errors" % gen.errors |
| 7569 return 1 | 7584 return 1 |
| 7570 return 0 | 7585 return 0 |
| 7571 | 7586 |
| 7572 | 7587 |
| 7573 if __name__ == '__main__': | 7588 if __name__ == '__main__': |
| 7574 sys.exit(main(sys.argv[1:])) | 7589 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |