| 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 GL/GLES extension wrangler.""" | 6 """code generator for GL/GLES extension wrangler.""" |
| 7 | 7 |
| 8 import optparse | 8 import optparse |
| 9 import os | 9 import os |
| 10 import collections | 10 import collections |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 { 'return_type': 'void', | 182 { 'return_type': 'void', |
| 183 'names': ['glDisableVertexAttribArray'], | 183 'names': ['glDisableVertexAttribArray'], |
| 184 'arguments': 'GLuint index', }, | 184 'arguments': 'GLuint index', }, |
| 185 { 'return_type': 'void', | 185 { 'return_type': 'void', |
| 186 'names': ['glDrawArrays'], | 186 'names': ['glDrawArrays'], |
| 187 'arguments': 'GLenum mode, GLint first, GLsizei count', }, | 187 'arguments': 'GLenum mode, GLint first, GLsizei count', }, |
| 188 { 'return_type': 'void', | 188 { 'return_type': 'void', |
| 189 'names': ['glDrawBuffer'], | 189 'names': ['glDrawBuffer'], |
| 190 'arguments': 'GLenum mode', }, | 190 'arguments': 'GLenum mode', }, |
| 191 { 'return_type': 'void', | 191 { 'return_type': 'void', |
| 192 'names': ['glDrawBuffersARB'], | 192 'names': ['glDrawBuffersARB', 'glDrawBuffersEXT'], |
| 193 'arguments': 'GLsizei n, const GLenum* bufs', }, | 193 'arguments': 'GLsizei n, const GLenum* bufs', }, |
| 194 { 'return_type': 'void', | 194 { 'return_type': 'void', |
| 195 'names': ['glDrawElements'], | 195 'names': ['glDrawElements'], |
| 196 'arguments': | 196 'arguments': |
| 197 'GLenum mode, GLsizei count, GLenum type, const void* indices', }, | 197 'GLenum mode, GLsizei count, GLenum type, const void* indices', }, |
| 198 { 'return_type': 'void', | 198 { 'return_type': 'void', |
| 199 'names': ['glEGLImageTargetTexture2DOES'], | 199 'names': ['glEGLImageTargetTexture2DOES'], |
| 200 'arguments': 'GLenum target, GLeglImageOES image', }, | 200 'arguments': 'GLenum target, GLeglImageOES image', }, |
| 201 { 'return_type': 'void', | 201 { 'return_type': 'void', |
| 202 'names': ['glEGLImageTargetRenderbufferStorageOES'], | 202 'names': ['glEGLImageTargetRenderbufferStorageOES'], |
| (...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1646 macro_depth -= 1 | 1646 macro_depth -= 1 |
| 1647 if macro_depth < current_extension_depth: | 1647 if macro_depth < current_extension_depth: |
| 1648 current_extension = None | 1648 current_extension = None |
| 1649 match = extension_start.match(line) | 1649 match = extension_start.match(line) |
| 1650 if match: | 1650 if match: |
| 1651 current_extension = match.group(1) | 1651 current_extension = match.group(1) |
| 1652 current_extension_depth = macro_depth | 1652 current_extension_depth = macro_depth |
| 1653 assert current_extension not in extensions, \ | 1653 assert current_extension not in extensions, \ |
| 1654 "Duplicate extension: " + current_extension | 1654 "Duplicate extension: " + current_extension |
| 1655 match = extension_function.match(line) | 1655 match = extension_function.match(line) |
| 1656 if match: |
| 1657 print match.group(1) |
| 1658 if current_extension: |
| 1659 print current_extension |
| 1656 if match and current_extension and not typedef.match(line): | 1660 if match and current_extension and not typedef.match(line): |
| 1657 extensions[current_extension].append(match.group(1)) | 1661 extensions[current_extension].append(match.group(1)) |
| 1658 return extensions | 1662 return extensions |
| 1659 | 1663 |
| 1660 | 1664 |
| 1661 def GetExtensionFunctions(extension_headers): | 1665 def GetExtensionFunctions(extension_headers): |
| 1662 """Parse extension functions from a list of header files. | 1666 """Parse extension functions from a list of header files. |
| 1663 | 1667 |
| 1664 Args: | 1668 Args: |
| 1665 extension_headers: List of header file names. | 1669 extension_headers: List of header file names. |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1819 header_file.close() | 1823 header_file.close() |
| 1820 | 1824 |
| 1821 source_file = open(os.path.join(dir, 'gl_bindings_autogen_mock.cc'), 'wb') | 1825 source_file = open(os.path.join(dir, 'gl_bindings_autogen_mock.cc'), 'wb') |
| 1822 GenerateMockSource(source_file, GL_FUNCTIONS) | 1826 GenerateMockSource(source_file, GL_FUNCTIONS) |
| 1823 source_file.close() | 1827 source_file.close() |
| 1824 return 0 | 1828 return 0 |
| 1825 | 1829 |
| 1826 | 1830 |
| 1827 if __name__ == '__main__': | 1831 if __name__ == '__main__': |
| 1828 sys.exit(main(sys.argv[1:])) | 1832 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |