| 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 1756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1767 """// Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1767 """// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 1768 // Use of this source code is governed by a BSD-style license that can be | 1768 // Use of this source code is governed by a BSD-style license that can be |
| 1769 // found in the LICENSE file. | 1769 // found in the LICENSE file. |
| 1770 | 1770 |
| 1771 // This file is automatically generated. | 1771 // This file is automatically generated. |
| 1772 | 1772 |
| 1773 """ % {'name': set_name.upper()}) | 1773 """ % {'name': set_name.upper()}) |
| 1774 | 1774 |
| 1775 # Write API declaration. | 1775 # Write API declaration. |
| 1776 for func in functions: | 1776 for func in functions: |
| 1777 file.write(' virtual %s %sFn(%s) override;\n' % | 1777 file.write(' %s %sFn(%s) override;\n' % |
| 1778 (func['return_type'], func['known_as'], func['arguments'])) | 1778 (func['return_type'], func['known_as'], func['arguments'])) |
| 1779 | 1779 |
| 1780 file.write('\n') | 1780 file.write('\n') |
| 1781 | 1781 |
| 1782 | 1782 |
| 1783 def GenerateMockHeader(file, functions, set_name): | 1783 def GenerateMockHeader(file, functions, set_name): |
| 1784 """Generates gl_mock_autogen_x.h""" | 1784 """Generates gl_mock_autogen_x.h""" |
| 1785 | 1785 |
| 1786 # Write file header. | 1786 # Write file header. |
| 1787 file.write( | 1787 file.write( |
| (...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2451 | 2451 |
| 2452 source_file = open(os.path.join(directory, 'gl_bindings_autogen_mock.cc'), | 2452 source_file = open(os.path.join(directory, 'gl_bindings_autogen_mock.cc'), |
| 2453 'wb') | 2453 'wb') |
| 2454 GenerateMockBindingsSource(source_file, GL_FUNCTIONS) | 2454 GenerateMockBindingsSource(source_file, GL_FUNCTIONS) |
| 2455 source_file.close() | 2455 source_file.close() |
| 2456 return 0 | 2456 return 0 |
| 2457 | 2457 |
| 2458 | 2458 |
| 2459 if __name__ == '__main__': | 2459 if __name__ == '__main__': |
| 2460 sys.exit(main(sys.argv[1:])) | 2460 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |