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 1397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1408 """// Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1408 """// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
1409 // Use of this source code is governed by a BSD-style license that can be | 1409 // Use of this source code is governed by a BSD-style license that can be |
1410 // found in the LICENSE file. | 1410 // found in the LICENSE file. |
1411 | 1411 |
1412 // This file is automatically generated. | 1412 // This file is automatically generated. |
1413 | 1413 |
1414 """ % {'name': set_name.upper()}) | 1414 """ % {'name': set_name.upper()}) |
1415 | 1415 |
1416 # Write API declaration. | 1416 # Write API declaration. |
1417 for func in functions: | 1417 for func in functions: |
1418 file.write(' virtual %s %sFn(%s) OVERRIDE;\n' % | 1418 file.write(' virtual %s %sFn(%s) override;\n' % |
1419 (func['return_type'], func['known_as'], func['arguments'])) | 1419 (func['return_type'], func['known_as'], func['arguments'])) |
1420 | 1420 |
1421 file.write('\n') | 1421 file.write('\n') |
1422 | 1422 |
1423 | 1423 |
1424 def GenerateMockHeader(file, functions, set_name): | 1424 def GenerateMockHeader(file, functions, set_name): |
1425 """Generates gl_mock_autogen_x.h""" | 1425 """Generates gl_mock_autogen_x.h""" |
1426 | 1426 |
1427 # Write file header. | 1427 # Write file header. |
1428 file.write( | 1428 file.write( |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2079 | 2079 |
2080 source_file = open(os.path.join(directory, 'gl_bindings_autogen_mock.cc'), | 2080 source_file = open(os.path.join(directory, 'gl_bindings_autogen_mock.cc'), |
2081 'wb') | 2081 'wb') |
2082 GenerateMockBindingsSource(source_file, GL_FUNCTIONS) | 2082 GenerateMockBindingsSource(source_file, GL_FUNCTIONS) |
2083 source_file.close() | 2083 source_file.close() |
2084 return 0 | 2084 return 0 |
2085 | 2085 |
2086 | 2086 |
2087 if __name__ == '__main__': | 2087 if __name__ == '__main__': |
2088 sys.exit(main(sys.argv[1:])) | 2088 sys.exit(main(sys.argv[1:])) |
OLD | NEW |