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

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

Issue 8676042: Remove Context3D/Surface3D (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: style 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/api/dev/ppb_video_decoder_dev.idl » ('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 1417 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 'type': 'Custom', 1428 'type': 'Custom',
1429 'cmd_args': 'GLenumStringType name, uint32 bucket_id', 1429 'cmd_args': 'GLenumStringType name, uint32 bucket_id',
1430 }, 1430 },
1431 'GetTexParameterfv': {'type': 'GETn', 'result': ['SizedResult<GLfloat>']}, 1431 'GetTexParameterfv': {'type': 'GETn', 'result': ['SizedResult<GLfloat>']},
1432 'GetTexParameteriv': {'type': 'GETn', 'result': ['SizedResult<GLint>']}, 1432 'GetTexParameteriv': {'type': 'GETn', 'result': ['SizedResult<GLint>']},
1433 'GetTranslatedShaderSourceANGLE': { 1433 'GetTranslatedShaderSourceANGLE': {
1434 'type': 'STRn', 1434 'type': 'STRn',
1435 'get_len_func': 'DoGetShaderiv', 1435 'get_len_func': 'DoGetShaderiv',
1436 'get_len_enum': 'GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE', 1436 'get_len_enum': 'GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE',
1437 'unit_test': False, 1437 'unit_test': False,
1438 'extension': True,
1438 }, 1439 },
1439 'GetUniformfv': { 1440 'GetUniformfv': {
1440 'type': 'Custom', 1441 'type': 'Custom',
1441 'immediate': False, 1442 'immediate': False,
1442 'result': ['SizedResult<GLfloat>'], 1443 'result': ['SizedResult<GLfloat>'],
1443 }, 1444 },
1444 'GetUniformiv': { 1445 'GetUniformiv': {
1445 'type': 'Custom', 1446 'type': 'Custom',
1446 'immediate': False, 1447 'immediate': False,
1447 'result': ['SizedResult<GLint>'], 1448 'result': ['SizedResult<GLint>'],
(...skipping 4233 matching lines...) Expand 10 before | Expand all | Expand 10 after
5681 for enum in enums: 5682 for enum in enums:
5682 if _ENUM_LISTS[enum]['type'] == 'GLenum': 5683 if _ENUM_LISTS[enum]['type'] == 'GLenum':
5683 file.Write("static std::string GetString%s(uint32 value);\n" % enum) 5684 file.Write("static std::string GetString%s(uint32 value);\n" % enum)
5684 file.Write("\n") 5685 file.Write("\n")
5685 file.Close() 5686 file.Close()
5686 5687
5687 def WriteCommonUtilsImpl(self, filename): 5688 def WriteCommonUtilsImpl(self, filename):
5688 """Writes the gles2 common utility header.""" 5689 """Writes the gles2 common utility header."""
5689 enum_re = re.compile(r'\#define\s+(GL_[a-zA-Z0-9_]+)\s+([0-9A-Fa-fx]+)') 5690 enum_re = re.compile(r'\#define\s+(GL_[a-zA-Z0-9_]+)\s+([0-9A-Fa-fx]+)')
5690 dict = {} 5691 dict = {}
5691 for fname in ['../GLES2/gl2.h', '../GLES2/gl2ext.h']: 5692 for fname in ['../../third_party/khronos/GLES2/gl2.h',
5693 '../../third_party/khronos/GLES2/gl2ext.h']:
5692 lines = open(fname).readlines() 5694 lines = open(fname).readlines()
5693 for line in lines: 5695 for line in lines:
5694 m = enum_re.match(line) 5696 m = enum_re.match(line)
5695 if m: 5697 if m:
5696 name = m.group(1) 5698 name = m.group(1)
5697 value = m.group(2) 5699 value = m.group(2)
5698 if not value in dict: 5700 if not value in dict:
5699 dict[value] = name 5701 dict[value] = name
5700 5702
5701 file = CHeaderWriter(filename) 5703 file = CHeaderWriter(filename)
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
5771 """Writes the Pepper OpenGLES interface implementation.""" 5773 """Writes the Pepper OpenGLES interface implementation."""
5772 5774
5773 file = CWriter(filename) 5775 file = CWriter(filename)
5774 file.Write(_LICENSE) 5776 file.Write(_LICENSE)
5775 file.Write(_DO_NOT_EDIT_WARNING) 5777 file.Write(_DO_NOT_EDIT_WARNING)
5776 5778
5777 file.Write("#include \"ppapi/shared_impl/opengles2_impl.h\"\n\n") 5779 file.Write("#include \"ppapi/shared_impl/opengles2_impl.h\"\n\n")
5778 file.Write("#include \"base/logging.h\"\n") 5780 file.Write("#include \"base/logging.h\"\n")
5779 file.Write("#include \"gpu/command_buffer/client/gles2_implementation.h\"\n" ) 5781 file.Write("#include \"gpu/command_buffer/client/gles2_implementation.h\"\n" )
5780 file.Write("#include \"ppapi/shared_impl/graphics_3d_impl.h\"\n") 5782 file.Write("#include \"ppapi/shared_impl/graphics_3d_impl.h\"\n")
5781 file.Write("#include \"ppapi/thunk/enter.h\"\n") 5783 file.Write("#include \"ppapi/thunk/enter.h\"\n\n")
5782 file.Write("#include \"ppapi/thunk/ppb_context_3d_api.h\"\n\n")
5783 5784
5784 file.Write("namespace ppapi {\n\n") 5785 file.Write("namespace ppapi {\n\n")
5785 file.Write("namespace {\n\n") 5786 file.Write("namespace {\n\n")
5786 5787
5787 file.Write("gpu::gles2::GLES2Implementation* GetGLES(PP_Resource context) {\ n") 5788 file.Write("gpu::gles2::GLES2Implementation*"
5788 file.Write(" thunk::EnterResource<thunk::PPB_Graphics3D_API> enter_g3d(cont ext, false);\n") 5789 " GetGLES(PP_Resource context) {\n")
5789 file.Write(" if (enter_g3d.succeeded()) {\n") 5790 file.Write(" thunk::EnterResource<thunk::PPB_Graphics3D_API>"
5790 file.Write(" return static_cast<Graphics3DImpl*>(enter_g3d.object())->gle s2_impl();\n") 5791 " enter_g3d(context, false);\n")
5791 file.Write(" } else {\n") 5792 file.Write(" DCHECK(enter_g3d.succeeded());\n")
5792 file.Write(" thunk::EnterResource<thunk::PPB_Context3D_API> enter_c3d(con text, true);\n") 5793 file.Write(" return static_cast<Graphics3DImpl*>"
5793 file.Write(" DCHECK(enter_c3d.succeeded());\n") 5794 "(enter_g3d.object())->gles2_impl();\n")
5794 file.Write(" return enter_c3d.object()->GetGLES2Impl();\n")
5795 file.Write(" }\n")
5796 file.Write("}\n\n") 5795 file.Write("}\n\n")
5797 5796
5798 for func in self.original_functions: 5797 for func in self.original_functions:
5799 if not func.IsCoreGLFunction(): 5798 if not func.IsCoreGLFunction():
5800 continue 5799 continue
5801 5800
5802 original_arg = func.MakeTypedOriginalArgString("") 5801 original_arg = func.MakeTypedOriginalArgString("")
5803 context_arg = "PP_Resource context_id" 5802 context_arg = "PP_Resource context_id"
5804 if len(original_arg): 5803 if len(original_arg):
5805 arg = context_arg + ", " + original_arg 5804 arg = context_arg + ", " + original_arg
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
5990 gen.WriteDocs("docs/gles2_cmd_format_docs_autogen.h") 5989 gen.WriteDocs("docs/gles2_cmd_format_docs_autogen.h")
5991 5990
5992 if gen.errors > 0: 5991 if gen.errors > 0:
5993 print "%d errors" % gen.errors 5992 print "%d errors" % gen.errors
5994 return 1 5993 return 1
5995 return 0 5994 return 0
5996 5995
5997 5996
5998 if __name__ == '__main__': 5997 if __name__ == '__main__':
5999 sys.exit(main(sys.argv[1:])) 5998 sys.exit(main(sys.argv[1:]))
OLDNEW
« no previous file with comments | « no previous file | ppapi/api/dev/ppb_video_decoder_dev.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698