Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(381)

Side by Side Diff: gpu/command_buffer/build_gles2_cmd_buffer.py

Issue 650303003: Avoid type truncation warnings when converting GLenum to GLboolean by inserting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | gpu/command_buffer/client/gles2_implementation.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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:]))
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/client/gles2_implementation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698