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

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

Issue 8790004: Rename the shared impl files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ppapi/ppapi_shared.gypi » ('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) 2011 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2011 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 5759 matching lines...) Expand 10 before | Expand all | Expand 10 after
5770 5770
5771 file.Close() 5771 file.Close()
5772 5772
5773 def WritePepperGLES2Implementation(self, filename): 5773 def WritePepperGLES2Implementation(self, filename):
5774 """Writes the Pepper OpenGLES interface implementation.""" 5774 """Writes the Pepper OpenGLES interface implementation."""
5775 5775
5776 file = CWriter(filename) 5776 file = CWriter(filename)
5777 file.Write(_LICENSE) 5777 file.Write(_LICENSE)
5778 file.Write(_DO_NOT_EDIT_WARNING) 5778 file.Write(_DO_NOT_EDIT_WARNING)
5779 5779
5780 file.Write("#include \"ppapi/shared_impl/opengles2_impl.h\"\n\n") 5780 file.Write("#include \"ppapi/shared_impl/ppb_opengles2_shared.h\"\n\n")
5781 file.Write("#include \"base/logging.h\"\n") 5781 file.Write("#include \"base/logging.h\"\n")
5782 file.Write("#include \"gpu/command_buffer/client/gles2_implementation.h\"\n" ) 5782 file.Write("#include \"gpu/command_buffer/client/gles2_implementation.h\"\n" )
5783 file.Write("#include \"ppapi/shared_impl/graphics_3d_impl.h\"\n") 5783 file.Write("#include \"ppapi/shared_impl/ppb_graphics_3d_shared.h\"\n")
5784 file.Write("#include \"ppapi/thunk/enter.h\"\n\n") 5784 file.Write("#include \"ppapi/thunk/enter.h\"\n\n")
5785 5785
5786 file.Write("namespace ppapi {\n\n") 5786 file.Write("namespace ppapi {\n\n")
5787 file.Write("namespace {\n\n") 5787 file.Write("namespace {\n\n")
5788 5788
5789 file.Write("gpu::gles2::GLES2Implementation*" 5789 file.Write("gpu::gles2::GLES2Implementation*"
5790 " GetGLES(PP_Resource context) {\n") 5790 " GetGLES(PP_Resource context) {\n")
5791 file.Write(" thunk::EnterResource<thunk::PPB_Graphics3D_API>" 5791 file.Write(" thunk::EnterResource<thunk::PPB_Graphics3D_API>"
5792 " enter_g3d(context, false);\n") 5792 " enter_g3d(context, false);\n")
5793 file.Write(" DCHECK(enter_g3d.succeeded());\n") 5793 file.Write(" DCHECK(enter_g3d.succeeded());\n")
5794 file.Write(" return static_cast<Graphics3DImpl*>" 5794 file.Write(" return static_cast<PPB_Graphics3D_Shared*>"
5795 "(enter_g3d.object())->gles2_impl();\n") 5795 "(enter_g3d.object())->gles2_impl();\n")
5796 file.Write("}\n\n") 5796 file.Write("}\n\n")
5797 5797
5798 for func in self.original_functions: 5798 for func in self.original_functions:
5799 if not func.IsCoreGLFunction(): 5799 if not func.IsCoreGLFunction():
5800 continue 5800 continue
5801 5801
5802 original_arg = func.MakeTypedOriginalArgString("") 5802 original_arg = func.MakeTypedOriginalArgString("")
5803 context_arg = "PP_Resource context_id" 5803 context_arg = "PP_Resource context_id"
5804 if len(original_arg): 5804 if len(original_arg):
(...skipping 11 matching lines...) Expand all
5816 file.Write("\nconst struct PPB_OpenGLES2 ppb_opengles2 = {\n") 5816 file.Write("\nconst struct PPB_OpenGLES2 ppb_opengles2 = {\n")
5817 file.Write(" &") 5817 file.Write(" &")
5818 file.Write(",\n &".join( 5818 file.Write(",\n &".join(
5819 f.name for f in self.original_functions if f.IsCoreGLFunction())) 5819 f.name for f in self.original_functions if f.IsCoreGLFunction()))
5820 file.Write("\n") 5820 file.Write("\n")
5821 file.Write("};\n\n") 5821 file.Write("};\n\n")
5822 5822
5823 file.Write("} // namespace\n") 5823 file.Write("} // namespace\n")
5824 5824
5825 file.Write(""" 5825 file.Write("""
5826 const PPB_OpenGLES2* OpenGLES2Impl::GetInterface() { 5826 const PPB_OpenGLES2* PPB_OpenGLES2_Shared::GetInterface() {
5827 return &ppb_opengles2; 5827 return &ppb_opengles2;
5828 } 5828 }
5829 5829
5830 """) 5830 """)
5831 file.Write("} // namespace ppapi\n") 5831 file.Write("} // namespace ppapi\n")
5832 file.Close() 5832 file.Close()
5833 5833
5834 def WriteGLES2ToPPAPIBridge(self, filename): 5834 def WriteGLES2ToPPAPIBridge(self, filename):
5835 """Connects GLES2 helper library to PPB_OpenGLES2 interface""" 5835 """Connects GLES2 helper library to PPB_OpenGLES2 interface"""
5836 5836
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
5954 os.chdir(options.output_dir) 5954 os.chdir(options.output_dir)
5955 5955
5956 if options.alternate_mode == "ppapi": 5956 if options.alternate_mode == "ppapi":
5957 # To trigger this action, do "make ppapi_gles_bindings" 5957 # To trigger this action, do "make ppapi_gles_bindings"
5958 os.chdir("ppapi"); 5958 os.chdir("ppapi");
5959 gen.WritePepperGLES2Interface("c/ppb_opengles2.h") 5959 gen.WritePepperGLES2Interface("c/ppb_opengles2.h")
5960 gen.WriteGLES2ToPPAPIBridge("lib/gl/gles2/gles2.c") 5960 gen.WriteGLES2ToPPAPIBridge("lib/gl/gles2/gles2.c")
5961 5961
5962 elif options.alternate_mode == "chrome_ppapi": 5962 elif options.alternate_mode == "chrome_ppapi":
5963 # To trigger this action, do "make ppapi_gles_implementation" 5963 # To trigger this action, do "make ppapi_gles_implementation"
5964 gen.WritePepperGLES2Implementation("ppapi/shared_impl/opengles2_impl.cc") 5964 gen.WritePepperGLES2Implementation(
5965 "ppapi/shared_impl/ppb_opengles2_shared.cc")
5965 5966
5966 elif options.alternate_mode == "nacl_ppapi": 5967 elif options.alternate_mode == "nacl_ppapi":
5967 gen.WritePepperGLES2NaClProxy( 5968 gen.WritePepperGLES2NaClProxy(
5968 "native_client/src/shared/ppapi_proxy/plugin_opengles.cc") 5969 "native_client/src/shared/ppapi_proxy/plugin_opengles.cc")
5969 5970
5970 else: 5971 else:
5971 os.chdir("gpu/command_buffer") 5972 os.chdir("gpu/command_buffer")
5972 gen.WriteCommandIds("common/gles2_cmd_ids_autogen.h") 5973 gen.WriteCommandIds("common/gles2_cmd_ids_autogen.h")
5973 gen.WriteFormat("common/gles2_cmd_format_autogen.h") 5974 gen.WriteFormat("common/gles2_cmd_format_autogen.h")
5974 gen.WriteFormatTest("common/gles2_cmd_format_test_autogen.h") 5975 gen.WriteFormatTest("common/gles2_cmd_format_test_autogen.h")
(...skipping 15 matching lines...) Expand all
5990 gen.WriteDocs("docs/gles2_cmd_format_docs_autogen.h") 5991 gen.WriteDocs("docs/gles2_cmd_format_docs_autogen.h")
5991 5992
5992 if gen.errors > 0: 5993 if gen.errors > 0:
5993 print "%d errors" % gen.errors 5994 print "%d errors" % gen.errors
5994 return 1 5995 return 1
5995 return 0 5996 return 0
5996 5997
5997 5998
5998 if __name__ == '__main__': 5999 if __name__ == '__main__':
5999 sys.exit(main(sys.argv[1:])) 6000 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | ppapi/ppapi_shared.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698