| 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 os | 8 import os |
| 9 import os.path | 9 import os.path |
| 10 import sys | 10 import sys |
| (...skipping 6071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6082 file.Close() | 6082 file.Close() |
| 6083 | 6083 |
| 6084 def WriteGLES2ToPPAPIBridge(self, filename): | 6084 def WriteGLES2ToPPAPIBridge(self, filename): |
| 6085 """Connects GLES2 helper library to PPB_OpenGLES2 interface""" | 6085 """Connects GLES2 helper library to PPB_OpenGLES2 interface""" |
| 6086 | 6086 |
| 6087 file = CWriter(filename) | 6087 file = CWriter(filename) |
| 6088 file.Write(_LICENSE) | 6088 file.Write(_LICENSE) |
| 6089 file.Write(_DO_NOT_EDIT_WARNING) | 6089 file.Write(_DO_NOT_EDIT_WARNING) |
| 6090 | 6090 |
| 6091 file.Write("#include <GLES2/gl2.h>\n") | 6091 file.Write("#include <GLES2/gl2.h>\n") |
| 6092 file.Write("#include <GLES2/gl2ext.h>\n") |
| 6092 file.Write("#include \"ppapi/lib/gl/gles2/gl2ext_ppapi.h\"\n\n") | 6093 file.Write("#include \"ppapi/lib/gl/gles2/gl2ext_ppapi.h\"\n\n") |
| 6093 | 6094 |
| 6094 for func in self.original_functions: | 6095 for func in self.original_functions: |
| 6095 if not func.InAnyPepperExtension(): | 6096 if not func.InAnyPepperExtension(): |
| 6096 continue | 6097 continue |
| 6097 | 6098 |
| 6098 interface = self.interface_info[func.GetInfo('pepper_interface') or ''] | 6099 interface = self.interface_info[func.GetInfo('pepper_interface') or ''] |
| 6099 | 6100 |
| 6100 file.Write("%s GL_APIENTRY gl%s(%s) {\n" % | 6101 file.Write("%s GL_APIENTRY gl%s(%s) {\n" % |
| 6101 (func.return_type, func.name, | 6102 (func.return_type, func.name, |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6245 gen.WriteCommonUtilsImpl("common/gles2_cmd_utils_implementation_autogen.h") | 6246 gen.WriteCommonUtilsImpl("common/gles2_cmd_utils_implementation_autogen.h") |
| 6246 | 6247 |
| 6247 if gen.errors > 0: | 6248 if gen.errors > 0: |
| 6248 print "%d errors" % gen.errors | 6249 print "%d errors" % gen.errors |
| 6249 return 1 | 6250 return 1 |
| 6250 return 0 | 6251 return 0 |
| 6251 | 6252 |
| 6252 | 6253 |
| 6253 if __name__ == '__main__': | 6254 if __name__ == '__main__': |
| 6254 sys.exit(main(sys.argv[1:])) | 6255 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |