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 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1514 file.write(' fn.%sFn = reinterpret_cast<%sProc>(%sNotBound);\n' % | 1514 file.write(' fn.%sFn = reinterpret_cast<%sProc>(%sNotBound);\n' % |
1515 (func['known_as'], func['known_as'], func['known_as'])) | 1515 (func['known_as'], func['known_as'], func['known_as'])) |
1516 | 1516 |
1517 file.write('}\n') | 1517 file.write('}\n') |
1518 file.write('\n') | 1518 file.write('\n') |
1519 | 1519 |
1520 # Write function to initialize bindings where choice of the function depends | 1520 # Write function to initialize bindings where choice of the function depends |
1521 # on the extension string or the GL version. | 1521 # on the extension string or the GL version. |
1522 file.write("""void Driver%s::InitializeDynamicBindings(GLContext* context) { | 1522 file.write("""void Driver%s::InitializeDynamicBindings(GLContext* context) { |
1523 DCHECK(context && context->IsCurrent(NULL)); | 1523 DCHECK(context && context->IsCurrent(NULL)); |
1524 const GLVersionInfo* ver ALLOW_UNUSED = context->GetVersionInfo(); | 1524 const GLVersionInfo* ver = context->GetVersionInfo(); |
1525 std::string extensions ALLOW_UNUSED = context->GetExtensions(); | 1525 ALLOW_UNUSED_LOCAL(ver); |
1526 extensions += " "; | 1526 std::string extensions = context->GetExtensions() + " "; |
| 1527 ALLOW_UNUSED_LOCAL(extensions); |
1527 | 1528 |
1528 """ % set_name.upper()) | 1529 """ % set_name.upper()) |
1529 for extension in sorted(used_extensions): | 1530 for extension in sorted(used_extensions): |
1530 # Extra space at the end of the extension name is intentional, it is used | 1531 # Extra space at the end of the extension name is intentional, it is used |
1531 # as a separator | 1532 # as a separator |
1532 file.write(' ext.b_%s = extensions.find("%s ") != std::string::npos;\n' % | 1533 file.write(' ext.b_%s = extensions.find("%s ") != std::string::npos;\n' % |
1533 (extension, extension)) | 1534 (extension, extension)) |
1534 | 1535 |
1535 def WrapOr(cond): | 1536 def WrapOr(cond): |
1536 if ' || ' in cond: | 1537 if ' || ' in cond: |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2079 | 2080 |
2080 source_file = open(os.path.join(directory, 'gl_bindings_autogen_mock.cc'), | 2081 source_file = open(os.path.join(directory, 'gl_bindings_autogen_mock.cc'), |
2081 'wb') | 2082 'wb') |
2082 GenerateMockBindingsSource(source_file, GL_FUNCTIONS) | 2083 GenerateMockBindingsSource(source_file, GL_FUNCTIONS) |
2083 source_file.close() | 2084 source_file.close() |
2084 return 0 | 2085 return 0 |
2085 | 2086 |
2086 | 2087 |
2087 if __name__ == '__main__': | 2088 if __name__ == '__main__': |
2088 sys.exit(main(sys.argv[1:])) | 2089 sys.exit(main(sys.argv[1:])) |
OLD | NEW |