| 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 2852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2863 'impl_func': False, | 2863 'impl_func': False, |
| 2864 'client_test': False, | 2864 'client_test': False, |
| 2865 }, | 2865 }, |
| 2866 'EnableVertexAttribArray': { | 2866 'EnableVertexAttribArray': { |
| 2867 'decoder_func': 'DoEnableVertexAttribArray', | 2867 'decoder_func': 'DoEnableVertexAttribArray', |
| 2868 'impl_decl': False, | 2868 'impl_decl': False, |
| 2869 }, | 2869 }, |
| 2870 'FenceSync': { | 2870 'FenceSync': { |
| 2871 'type': 'Create', | 2871 'type': 'Create', |
| 2872 'client_test': False, | 2872 'client_test': False, |
| 2873 'decoder_func': 'DoFenceSync', |
| 2873 'unsafe': True, | 2874 'unsafe': True, |
| 2874 'trace_level': 1, | 2875 'trace_level': 1, |
| 2875 }, | 2876 }, |
| 2876 'Finish': { | 2877 'Finish': { |
| 2877 'impl_func': False, | 2878 'impl_func': False, |
| 2878 'client_test': False, | 2879 'client_test': False, |
| 2879 'decoder_func': 'DoFinish', | 2880 'decoder_func': 'DoFinish', |
| 2880 'defer_reads': True, | 2881 'defer_reads': True, |
| 2881 'trace_level': 1, | 2882 'trace_level': 1, |
| 2882 }, | 2883 }, |
| (...skipping 1964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4847 'offset': offset, | 4848 'offset': offset, |
| 4848 }) | 4849 }) |
| 4849 offset += _SIZE_OF_UINT32 | 4850 offset += _SIZE_OF_UINT32 |
| 4850 f.write("\n") | 4851 f.write("\n") |
| 4851 | 4852 |
| 4852 def WriteHandlerImplementation(self, func, f): | 4853 def WriteHandlerImplementation(self, func, f): |
| 4853 """Writes the handler implementation for this command.""" | 4854 """Writes the handler implementation for this command.""" |
| 4854 if func.IsUnsafe() and func.GetInfo('id_mapping'): | 4855 if func.IsUnsafe() and func.GetInfo('id_mapping'): |
| 4855 code_no_gen = """ if (!group_->Get%(type)sServiceId( | 4856 code_no_gen = """ if (!group_->Get%(type)sServiceId( |
| 4856 %(var)s, &%(service_var)s)) { | 4857 %(var)s, &%(service_var)s)) { |
| 4857 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "%(func)s", "invalid %(var)s id"); | 4858 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "%(func)s", "invalid %(var)s id"); |
| 4858 return error::kNoError; | 4859 return error::kNoError; |
| 4859 } | 4860 } |
| 4860 """ | 4861 """ |
| 4861 code_gen = """ if (!group_->Get%(type)sServiceId( | 4862 code_gen = """ if (!group_->Get%(type)sServiceId( |
| 4862 %(var)s, &%(service_var)s)) { | 4863 %(var)s, &%(service_var)s)) { |
| 4863 if (!group_->bind_generates_resource()) { | 4864 if (!group_->bind_generates_resource()) { |
| 4864 LOCAL_SET_GL_ERROR( | 4865 LOCAL_SET_GL_ERROR( |
| 4865 GL_INVALID_OPERATION, "%(func)s", "invalid %(var)s id"); | 4866 GL_INVALID_OPERATION, "%(func)s", "invalid %(var)s id"); |
| 4866 return error::kNoError; | 4867 return error::kNoError; |
| 4867 } | 4868 } |
| (...skipping 6655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11523 Format(gen.generated_cpp_filenames) | 11524 Format(gen.generated_cpp_filenames) |
| 11524 | 11525 |
| 11525 if gen.errors > 0: | 11526 if gen.errors > 0: |
| 11526 print "%d errors" % gen.errors | 11527 print "%d errors" % gen.errors |
| 11527 return 1 | 11528 return 1 |
| 11528 return 0 | 11529 return 0 |
| 11529 | 11530 |
| 11530 | 11531 |
| 11531 if __name__ == '__main__': | 11532 if __name__ == '__main__': |
| 11532 sys.exit(main(sys.argv[1:])) | 11533 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |