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 itertools | 8 import itertools |
9 import os | 9 import os |
10 import os.path | 10 import os.path |
(...skipping 5849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5860 file.Write(" }\n") | 5860 file.Write(" }\n") |
5861 file.Write(" *result = 0;\n") | 5861 file.Write(" *result = 0;\n") |
5862 arg_string = func.MakeOriginalArgString("") | 5862 arg_string = func.MakeOriginalArgString("") |
5863 comma = "" | 5863 comma = "" |
5864 if len(arg_string) > 0: | 5864 if len(arg_string) > 0: |
5865 comma = ", " | 5865 comma = ", " |
5866 file.Write( | 5866 file.Write( |
5867 " helper_->%s(%s%sGetResultShmId(), GetResultShmOffset());\n" % | 5867 " helper_->%s(%s%sGetResultShmId(), GetResultShmOffset());\n" % |
5868 (func.name, arg_string, comma)) | 5868 (func.name, arg_string, comma)) |
5869 file.Write(" WaitForCmd();\n") | 5869 file.Write(" WaitForCmd();\n") |
5870 file.Write(" %s result_value = *result;\n" % func.return_type) | 5870 file.Write(" %s result_value = *result" % func.return_type) |
5871 file.Write(' GPU_CLIENT_LOG("returned " << result_value);\n') | 5871 if func.return_type == "GLboolean": |
| 5872 file.Write(" != 0") |
| 5873 file.Write(';\n GPU_CLIENT_LOG("returned " << result_value);\n') |
5872 file.Write(" CheckGLError();\n") | 5874 file.Write(" CheckGLError();\n") |
5873 file.Write(" return result_value;\n") | 5875 file.Write(" return result_value;\n") |
5874 file.Write("}\n") | 5876 file.Write("}\n") |
5875 file.Write("\n") | 5877 file.Write("\n") |
5876 | 5878 |
5877 def WriteGLES2ImplementationUnitTest(self, func, file): | 5879 def WriteGLES2ImplementationUnitTest(self, func, file): |
5878 """Overrriden from TypeHandler.""" | 5880 """Overrriden from TypeHandler.""" |
5879 client_test = func.GetInfo('client_test') | 5881 client_test = func.GetInfo('client_test') |
5880 if client_test == None or client_test == True: | 5882 if client_test == None or client_test == True: |
5881 code = """ | 5883 code = """ |
(...skipping 2761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8643 Format(gen.generated_cpp_filenames) | 8645 Format(gen.generated_cpp_filenames) |
8644 | 8646 |
8645 if gen.errors > 0: | 8647 if gen.errors > 0: |
8646 print "%d errors" % gen.errors | 8648 print "%d errors" % gen.errors |
8647 return 1 | 8649 return 1 |
8648 return 0 | 8650 return 0 |
8649 | 8651 |
8650 | 8652 |
8651 if __name__ == '__main__': | 8653 if __name__ == '__main__': |
8652 sys.exit(main(sys.argv[1:])) | 8654 sys.exit(main(sys.argv[1:])) |
OLD | NEW |