OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # | 2 # |
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """code generator for GLES2 command buffers.""" | 7 """code generator for GLES2 command buffers.""" |
8 | 8 |
9 import os | 9 import os |
10 import os.path | 10 import os.path |
(...skipping 4543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4554 def __init__(self, name, gl_type, type, gl_error): | 4554 def __init__(self, name, gl_type, type, gl_error): |
4555 Argument.__init__(self, name, gl_type) | 4555 Argument.__init__(self, name, gl_type) |
4556 | 4556 |
4557 self.local_type = type | 4557 self.local_type = type |
4558 self.gl_error = gl_error | 4558 self.gl_error = gl_error |
4559 name = type[len(gl_type):] | 4559 name = type[len(gl_type):] |
4560 self.type_name = name | 4560 self.type_name = name |
4561 self.enum_info = _ENUM_LISTS[name] | 4561 self.enum_info = _ENUM_LISTS[name] |
4562 | 4562 |
4563 def WriteValidationCode(self, file, func): | 4563 def WriteValidationCode(self, file, func): |
4564 file.Write(" if (!validators_->%s.IsValid(%s)) {\n" % | 4564 file.Write(" if (!validators()->%s.IsValid(%s)) {\n" % |
4565 (ToUnderscore(self.type_name), self.name)) | 4565 (ToUnderscore(self.type_name), self.name)) |
4566 file.Write(" SetGLError(%s, \"gl%s: %s %s\");\n" % | 4566 file.Write(" SetGLError(%s, \"gl%s: %s %s\");\n" % |
4567 (self.gl_error, func.original_name, self.name, self.gl_error)) | 4567 (self.gl_error, func.original_name, self.name, self.gl_error)) |
4568 file.Write(" return error::kNoError;\n") | 4568 file.Write(" return error::kNoError;\n") |
4569 file.Write(" }\n") | 4569 file.Write(" }\n") |
4570 | 4570 |
4571 def GetValidArg(self, func, offset, index): | 4571 def GetValidArg(self, func, offset, index): |
4572 valid_arg = func.GetValidArg(offset) | 4572 valid_arg = func.GetValidArg(offset) |
4573 if valid_arg != None: | 4573 if valid_arg != None: |
4574 return valid_arg | 4574 return valid_arg |
(...skipping 1418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5993 | 5993 |
5994 if options.generate_docs: | 5994 if options.generate_docs: |
5995 gen.WriteDocs("docs/gles2_cmd_format_docs_autogen.h") | 5995 gen.WriteDocs("docs/gles2_cmd_format_docs_autogen.h") |
5996 | 5996 |
5997 if gen.errors > 0: | 5997 if gen.errors > 0: |
5998 print "%d errors" % gen.errors | 5998 print "%d errors" % gen.errors |
5999 sys.exit(1) | 5999 sys.exit(1) |
6000 | 6000 |
6001 if __name__ == '__main__': | 6001 if __name__ == '__main__': |
6002 main(sys.argv[1:]) | 6002 main(sys.argv[1:]) |
OLD | NEW |