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 7352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7363 | 7363 |
7364 _function_re = re.compile(r'GL_APICALL(.*?)GL_APIENTRY (.*?) \((.*?)\);') | 7364 _function_re = re.compile(r'GL_APICALL(.*?)GL_APIENTRY (.*?) \((.*?)\);') |
7365 | 7365 |
7366 def __init__(self, verbose): | 7366 def __init__(self, verbose): |
7367 self.original_functions = [] | 7367 self.original_functions = [] |
7368 self.functions = [] | 7368 self.functions = [] |
7369 self.verbose = verbose | 7369 self.verbose = verbose |
7370 self.errors = 0 | 7370 self.errors = 0 |
7371 self.pepper_interfaces = [] | 7371 self.pepper_interfaces = [] |
7372 self.interface_info = {} | 7372 self.interface_info = {} |
| 7373 self.generated_cpp_filenames = [] |
7373 | 7374 |
7374 for interface in _PEPPER_INTERFACES: | 7375 for interface in _PEPPER_INTERFACES: |
7375 interface = PepperInterface(interface) | 7376 interface = PepperInterface(interface) |
7376 self.pepper_interfaces.append(interface) | 7377 self.pepper_interfaces.append(interface) |
7377 self.interface_info[interface.GetName()] = interface | 7378 self.interface_info[interface.GetName()] = interface |
7378 | 7379 |
7379 def AddFunction(self, func): | 7380 def AddFunction(self, func): |
7380 """Adds a function.""" | 7381 """Adds a function.""" |
7381 self.functions.append(func) | 7382 self.functions.append(func) |
7382 | 7383 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7487 file.Write("enum CommandId {\n") | 7488 file.Write("enum CommandId {\n") |
7488 file.Write(" kStartPoint = cmd::kLastCommonId, " | 7489 file.Write(" kStartPoint = cmd::kLastCommonId, " |
7489 "// All GLES2 commands start after this.\n") | 7490 "// All GLES2 commands start after this.\n") |
7490 file.Write("#define GLES2_CMD_OP(name) k ## name,\n") | 7491 file.Write("#define GLES2_CMD_OP(name) k ## name,\n") |
7491 file.Write(" GLES2_COMMAND_LIST(GLES2_CMD_OP)\n") | 7492 file.Write(" GLES2_COMMAND_LIST(GLES2_CMD_OP)\n") |
7492 file.Write("#undef GLES2_CMD_OP\n") | 7493 file.Write("#undef GLES2_CMD_OP\n") |
7493 file.Write(" kNumCommands\n") | 7494 file.Write(" kNumCommands\n") |
7494 file.Write("};\n") | 7495 file.Write("};\n") |
7495 file.Write("\n") | 7496 file.Write("\n") |
7496 file.Close() | 7497 file.Close() |
| 7498 self.generated_cpp_filenames.append(file.filename) |
7497 | 7499 |
7498 def WriteFormat(self, filename): | 7500 def WriteFormat(self, filename): |
7499 """Writes the command buffer format""" | 7501 """Writes the command buffer format""" |
7500 file = CHeaderWriter(filename) | 7502 file = CHeaderWriter(filename) |
7501 for func in self.functions: | 7503 for func in self.functions: |
7502 if True: | 7504 if True: |
7503 #gen_cmd = func.GetInfo('gen_cmd') | 7505 #gen_cmd = func.GetInfo('gen_cmd') |
7504 #if gen_cmd == True or gen_cmd == None: | 7506 #if gen_cmd == True or gen_cmd == None: |
7505 func.WriteStruct(file) | 7507 func.WriteStruct(file) |
7506 file.Write("\n") | 7508 file.Write("\n") |
7507 file.Close() | 7509 file.Close() |
| 7510 self.generated_cpp_filenames.append(file.filename) |
7508 | 7511 |
7509 def WriteDocs(self, filename): | 7512 def WriteDocs(self, filename): |
7510 """Writes the command buffer doc version of the commands""" | 7513 """Writes the command buffer doc version of the commands""" |
7511 file = CWriter(filename) | 7514 file = CWriter(filename) |
7512 for func in self.functions: | 7515 for func in self.functions: |
7513 if True: | 7516 if True: |
7514 #gen_cmd = func.GetInfo('gen_cmd') | 7517 #gen_cmd = func.GetInfo('gen_cmd') |
7515 #if gen_cmd == True or gen_cmd == None: | 7518 #if gen_cmd == True or gen_cmd == None: |
7516 func.WriteDocs(file) | 7519 func.WriteDocs(file) |
7517 file.Write("\n") | 7520 file.Write("\n") |
7518 file.Close() | 7521 file.Close() |
| 7522 self.generated_cpp_filenames.append(file.filename) |
7519 | 7523 |
7520 def WriteFormatTest(self, filename): | 7524 def WriteFormatTest(self, filename): |
7521 """Writes the command buffer format test.""" | 7525 """Writes the command buffer format test.""" |
7522 file = CHeaderWriter( | 7526 file = CHeaderWriter( |
7523 filename, | 7527 filename, |
7524 "// This file contains unit tests for gles2 commmands\n" | 7528 "// This file contains unit tests for gles2 commmands\n" |
7525 "// It is included by gles2_cmd_format_test.cc\n" | 7529 "// It is included by gles2_cmd_format_test.cc\n" |
7526 "\n") | 7530 "\n") |
7527 | 7531 |
7528 for func in self.functions: | 7532 for func in self.functions: |
7529 if True: | 7533 if True: |
7530 #gen_cmd = func.GetInfo('gen_cmd') | 7534 #gen_cmd = func.GetInfo('gen_cmd') |
7531 #if gen_cmd == True or gen_cmd == None: | 7535 #if gen_cmd == True or gen_cmd == None: |
7532 func.WriteFormatTest(file) | 7536 func.WriteFormatTest(file) |
7533 | 7537 |
7534 file.Close() | 7538 file.Close() |
| 7539 self.generated_cpp_filenames.append(file.filename) |
7535 | 7540 |
7536 def WriteCmdHelperHeader(self, filename): | 7541 def WriteCmdHelperHeader(self, filename): |
7537 """Writes the gles2 command helper.""" | 7542 """Writes the gles2 command helper.""" |
7538 file = CHeaderWriter(filename) | 7543 file = CHeaderWriter(filename) |
7539 | 7544 |
7540 for func in self.functions: | 7545 for func in self.functions: |
7541 if True: | 7546 if True: |
7542 #gen_cmd = func.GetInfo('gen_cmd') | 7547 #gen_cmd = func.GetInfo('gen_cmd') |
7543 #if gen_cmd == True or gen_cmd == None: | 7548 #if gen_cmd == True or gen_cmd == None: |
7544 func.WriteCmdHelper(file) | 7549 func.WriteCmdHelper(file) |
7545 | 7550 |
7546 file.Close() | 7551 file.Close() |
| 7552 self.generated_cpp_filenames.append(file.filename) |
7547 | 7553 |
7548 def WriteServiceContextStateHeader(self, filename): | 7554 def WriteServiceContextStateHeader(self, filename): |
7549 """Writes the service context state header.""" | 7555 """Writes the service context state header.""" |
7550 file = CHeaderWriter( | 7556 file = CHeaderWriter( |
7551 filename, | 7557 filename, |
7552 "// It is included by context_state.h\n") | 7558 "// It is included by context_state.h\n") |
7553 file.Write("struct EnableFlags {\n") | 7559 file.Write("struct EnableFlags {\n") |
7554 file.Write(" EnableFlags();\n") | 7560 file.Write(" EnableFlags();\n") |
7555 for capability in _CAPABILITY_FLAGS: | 7561 for capability in _CAPABILITY_FLAGS: |
7556 file.Write(" bool %s;\n" % capability['name']) | 7562 file.Write(" bool %s;\n" % capability['name']) |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7597 return; | 7603 return; |
7598 } | 7604 } |
7599 if (enable) | 7605 if (enable) |
7600 glEnable(cap); | 7606 glEnable(cap); |
7601 else | 7607 else |
7602 glDisable(cap); | 7608 glDisable(cap); |
7603 } | 7609 } |
7604 """) | 7610 """) |
7605 | 7611 |
7606 file.Close() | 7612 file.Close() |
| 7613 self.generated_cpp_filenames.append(file.filename) |
7607 | 7614 |
7608 def WriteClientContextStateHeader(self, filename): | 7615 def WriteClientContextStateHeader(self, filename): |
7609 """Writes the client context state header.""" | 7616 """Writes the client context state header.""" |
7610 file = CHeaderWriter( | 7617 file = CHeaderWriter( |
7611 filename, | 7618 filename, |
7612 "// It is included by client_context_state.h\n") | 7619 "// It is included by client_context_state.h\n") |
7613 file.Write("struct EnableFlags {\n") | 7620 file.Write("struct EnableFlags {\n") |
7614 file.Write(" EnableFlags();\n") | 7621 file.Write(" EnableFlags();\n") |
7615 for capability in _CAPABILITY_FLAGS: | 7622 for capability in _CAPABILITY_FLAGS: |
7616 file.Write(" bool %s;\n" % capability['name']) | 7623 file.Write(" bool %s;\n" % capability['name']) |
7617 file.Write("};\n\n") | 7624 file.Write("};\n\n") |
7618 | 7625 |
7619 file.Close() | 7626 file.Close() |
| 7627 self.generated_cpp_filenames.append(file.filename) |
7620 | 7628 |
7621 def WriteContextStateGetters(self, file, class_name): | 7629 def WriteContextStateGetters(self, file, class_name): |
7622 """Writes the state getters.""" | 7630 """Writes the state getters.""" |
7623 for gl_type in ["GLint", "GLfloat"]: | 7631 for gl_type in ["GLint", "GLfloat"]: |
7624 file.Write(""" | 7632 file.Write(""" |
7625 bool %s::GetStateAs%s( | 7633 bool %s::GetStateAs%s( |
7626 GLenum pname, %s* params, GLsizei* num_written) const { | 7634 GLenum pname, %s* params, GLsizei* num_written) const { |
7627 switch (pname) { | 7635 switch (pname) { |
7628 """ % (class_name, gl_type, gl_type)) | 7636 """ % (class_name, gl_type, gl_type)) |
7629 for state_name in sorted(_STATES.keys()): | 7637 for state_name in sorted(_STATES.keys()): |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7818 file.Write(" return enable_flags.%s;\n" % capability['name']) | 7826 file.Write(" return enable_flags.%s;\n" % capability['name']) |
7819 file.Write(""" default: | 7827 file.Write(""" default: |
7820 NOTREACHED(); | 7828 NOTREACHED(); |
7821 return false; | 7829 return false; |
7822 } | 7830 } |
7823 } | 7831 } |
7824 """) | 7832 """) |
7825 | 7833 |
7826 self.WriteContextStateGetters(file, "ContextState") | 7834 self.WriteContextStateGetters(file, "ContextState") |
7827 file.Close() | 7835 file.Close() |
| 7836 self.generated_cpp_filenames.append(file.filename) |
7828 | 7837 |
7829 def WriteClientContextStateImpl(self, filename): | 7838 def WriteClientContextStateImpl(self, filename): |
7830 """Writes the context state client side implementation.""" | 7839 """Writes the context state client side implementation.""" |
7831 file = CHeaderWriter( | 7840 file = CHeaderWriter( |
7832 filename, | 7841 filename, |
7833 "// It is included by client_context_state.cc\n") | 7842 "// It is included by client_context_state.cc\n") |
7834 code = [] | 7843 code = [] |
7835 for capability in _CAPABILITY_FLAGS: | 7844 for capability in _CAPABILITY_FLAGS: |
7836 code.append("%s(%s)" % | 7845 code.append("%s(%s)" % |
7837 (capability['name'], | 7846 (capability['name'], |
(...skipping 29 matching lines...) Expand all Loading... |
7867 for capability in _CAPABILITY_FLAGS: | 7876 for capability in _CAPABILITY_FLAGS: |
7868 file.Write(" case GL_%s:\n" % capability['name'].upper()) | 7877 file.Write(" case GL_%s:\n" % capability['name'].upper()) |
7869 file.Write(" *enabled = enable_flags.%s;\n" % capability['name']) | 7878 file.Write(" *enabled = enable_flags.%s;\n" % capability['name']) |
7870 file.Write(" return true;\n") | 7879 file.Write(" return true;\n") |
7871 file.Write(""" default: | 7880 file.Write(""" default: |
7872 return false; | 7881 return false; |
7873 } | 7882 } |
7874 } | 7883 } |
7875 """) | 7884 """) |
7876 file.Close() | 7885 file.Close() |
| 7886 self.generated_cpp_filenames.append(file.filename) |
7877 | 7887 |
7878 def WriteServiceImplementation(self, filename): | 7888 def WriteServiceImplementation(self, filename): |
7879 """Writes the service decorder implementation.""" | 7889 """Writes the service decorder implementation.""" |
7880 file = CHeaderWriter( | 7890 file = CHeaderWriter( |
7881 filename, | 7891 filename, |
7882 "// It is included by gles2_cmd_decoder.cc\n") | 7892 "// It is included by gles2_cmd_decoder.cc\n") |
7883 | 7893 |
7884 for func in self.functions: | 7894 for func in self.functions: |
7885 if True: | 7895 if True: |
7886 #gen_cmd = func.GetInfo('gen_cmd') | 7896 #gen_cmd = func.GetInfo('gen_cmd') |
(...skipping 26 matching lines...) Expand all Loading... |
7913 } | 7923 } |
7914 return false; | 7924 return false; |
7915 """ % capability) | 7925 """ % capability) |
7916 file.Write(""" default: | 7926 file.Write(""" default: |
7917 NOTREACHED(); | 7927 NOTREACHED(); |
7918 return false; | 7928 return false; |
7919 } | 7929 } |
7920 } | 7930 } |
7921 """) | 7931 """) |
7922 file.Close() | 7932 file.Close() |
| 7933 self.generated_cpp_filenames.append(file.filename) |
7923 | 7934 |
7924 def WriteServiceUnitTests(self, filename): | 7935 def WriteServiceUnitTests(self, filename): |
7925 """Writes the service decorder unit tests.""" | 7936 """Writes the service decorder unit tests.""" |
7926 num_tests = len(self.functions) | 7937 num_tests = len(self.functions) |
7927 FUNCTIONS_PER_FILE = 98 # hard code this so it doesn't change. | 7938 FUNCTIONS_PER_FILE = 98 # hard code this so it doesn't change. |
7928 count = 0 | 7939 count = 0 |
7929 for test_num in range(0, num_tests, FUNCTIONS_PER_FILE): | 7940 for test_num in range(0, num_tests, FUNCTIONS_PER_FILE): |
7930 count += 1 | 7941 count += 1 |
7931 name = filename % count | 7942 name = filename % count |
7932 file = CHeaderWriter( | 7943 file = CHeaderWriter( |
(...skipping 14 matching lines...) Expand all Loading... |
7947 | 7958 |
7948 if True: | 7959 if True: |
7949 #gen_cmd = func.GetInfo('gen_cmd') | 7960 #gen_cmd = func.GetInfo('gen_cmd') |
7950 #if gen_cmd == True or gen_cmd == None: | 7961 #if gen_cmd == True or gen_cmd == None: |
7951 if func.GetInfo('unit_test') == False: | 7962 if func.GetInfo('unit_test') == False: |
7952 file.Write("// TODO(gman): %s\n" % func.name) | 7963 file.Write("// TODO(gman): %s\n" % func.name) |
7953 else: | 7964 else: |
7954 func.WriteServiceUnitTest(file, { | 7965 func.WriteServiceUnitTest(file, { |
7955 'test_name': test_name | 7966 'test_name': test_name |
7956 }) | 7967 }) |
7957 | |
7958 file.Close() | 7968 file.Close() |
| 7969 self.generated_cpp_filenames.append(file.filename) |
7959 file = CHeaderWriter( | 7970 file = CHeaderWriter( |
7960 filename % 0, | 7971 filename % 0, |
7961 "// It is included by gles2_cmd_decoder_unittest_base.cc\n") | 7972 "// It is included by gles2_cmd_decoder_unittest_base.cc\n") |
7962 file.Write( | 7973 file.Write( |
7963 """void GLES2DecoderTestBase::SetupInitCapabilitiesExpectations() { | 7974 """void GLES2DecoderTestBase::SetupInitCapabilitiesExpectations() { |
7964 """) | 7975 """) |
7965 for capability in _CAPABILITY_FLAGS: | 7976 for capability in _CAPABILITY_FLAGS: |
7966 file.Write(" ExpectEnableDisable(GL_%s, %s);\n" % | 7977 file.Write(" ExpectEnableDisable(GL_%s, %s);\n" % |
7967 (capability['name'].upper(), | 7978 (capability['name'].upper(), |
7968 ('false', 'true')['default' in capability])) | 7979 ('false', 'true')['default' in capability])) |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8024 args = ["_" if isinstance(arg, list) else arg for arg in args] | 8035 args = ["_" if isinstance(arg, list) else arg for arg in args] |
8025 file.Write(" EXPECT_CALL(*gl_, %s(%s))\n" % | 8036 file.Write(" EXPECT_CALL(*gl_, %s(%s))\n" % |
8026 (state['func'], ", ".join(args))) | 8037 (state['func'], ", ".join(args))) |
8027 file.Write(" .Times(1)\n") | 8038 file.Write(" .Times(1)\n") |
8028 file.Write(" .RetiresOnSaturation();\n") | 8039 file.Write(" .RetiresOnSaturation();\n") |
8029 if 'extension_flag' in state: | 8040 if 'extension_flag' in state: |
8030 file.Write(" }\n") | 8041 file.Write(" }\n") |
8031 file.Write("""} | 8042 file.Write("""} |
8032 """) | 8043 """) |
8033 file.Close() | 8044 file.Close() |
| 8045 self.generated_cpp_filenames.append(file.filename) |
8034 | 8046 |
8035 def WriteServiceUnitTestsForExtensions(self, filename): | 8047 def WriteServiceUnitTestsForExtensions(self, filename): |
8036 """Writes the service decorder unit tests for functions with extension_flag. | 8048 """Writes the service decorder unit tests for functions with extension_flag. |
8037 | 8049 |
8038 The functions are special in that they need a specific unit test | 8050 The functions are special in that they need a specific unit test |
8039 baseclass to turn on the extension. | 8051 baseclass to turn on the extension. |
8040 """ | 8052 """ |
8041 functions = [f for f in self.functions if f.GetInfo('extension_flag')] | 8053 functions = [f for f in self.functions if f.GetInfo('extension_flag')] |
8042 file = CHeaderWriter( | 8054 file = CHeaderWriter( |
8043 filename, | 8055 filename, |
8044 "// It is included by gles2_cmd_decoder_unittest_extensions.cc\n") | 8056 "// It is included by gles2_cmd_decoder_unittest_extensions.cc\n") |
8045 for func in functions: | 8057 for func in functions: |
8046 if True: | 8058 if True: |
8047 if func.GetInfo('unit_test') == False: | 8059 if func.GetInfo('unit_test') == False: |
8048 file.Write("// TODO(gman): %s\n" % func.name) | 8060 file.Write("// TODO(gman): %s\n" % func.name) |
8049 else: | 8061 else: |
8050 extension = ToCamelCase( | 8062 extension = ToCamelCase( |
8051 ToGLExtensionString(func.GetInfo('extension_flag'))) | 8063 ToGLExtensionString(func.GetInfo('extension_flag'))) |
8052 func.WriteServiceUnitTest(file, { | 8064 func.WriteServiceUnitTest(file, { |
8053 'test_name': 'GLES2DecoderTestWith%s' % extension | 8065 'test_name': 'GLES2DecoderTestWith%s' % extension |
8054 }) | 8066 }) |
8055 | 8067 |
8056 file.Close() | 8068 file.Close() |
| 8069 self.generated_cpp_filenames.append(file.filename) |
8057 | 8070 |
8058 def WriteGLES2Header(self, filename): | 8071 def WriteGLES2Header(self, filename): |
8059 """Writes the GLES2 header.""" | 8072 """Writes the GLES2 header.""" |
8060 file = CHeaderWriter( | 8073 file = CHeaderWriter( |
8061 filename, | 8074 filename, |
8062 "// This file contains Chromium-specific GLES2 declarations.\n\n") | 8075 "// This file contains Chromium-specific GLES2 declarations.\n\n") |
8063 | 8076 |
8064 for func in self.original_functions: | 8077 for func in self.original_functions: |
8065 func.WriteGLES2Header(file) | 8078 func.WriteGLES2Header(file) |
8066 | 8079 |
8067 file.Write("\n") | 8080 file.Write("\n") |
8068 file.Close() | 8081 file.Close() |
| 8082 self.generated_cpp_filenames.append(file.filename) |
8069 | 8083 |
8070 def WriteGLES2CLibImplementation(self, filename): | 8084 def WriteGLES2CLibImplementation(self, filename): |
8071 """Writes the GLES2 c lib implementation.""" | 8085 """Writes the GLES2 c lib implementation.""" |
8072 file = CHeaderWriter( | 8086 file = CHeaderWriter( |
8073 filename, | 8087 filename, |
8074 "// These functions emulate GLES2 over command buffers.\n") | 8088 "// These functions emulate GLES2 over command buffers.\n") |
8075 | 8089 |
8076 for func in self.original_functions: | 8090 for func in self.original_functions: |
8077 func.WriteGLES2CLibImplementation(file) | 8091 func.WriteGLES2CLibImplementation(file) |
8078 | 8092 |
8079 file.Write(""" | 8093 file.Write(""" |
8080 namespace gles2 { | 8094 namespace gles2 { |
8081 | 8095 |
8082 extern const NameToFunc g_gles2_function_table[] = { | 8096 extern const NameToFunc g_gles2_function_table[] = { |
8083 """) | 8097 """) |
8084 for func in self.original_functions: | 8098 for func in self.original_functions: |
8085 file.Write( | 8099 file.Write( |
8086 ' { "gl%s", reinterpret_cast<GLES2FunctionPointer>(gl%s), },\n' % | 8100 ' { "gl%s", reinterpret_cast<GLES2FunctionPointer>(gl%s), },\n' % |
8087 (func.name, func.name)) | 8101 (func.name, func.name)) |
8088 file.Write(""" { NULL, NULL, }, | 8102 file.Write(""" { NULL, NULL, }, |
8089 }; | 8103 }; |
8090 | 8104 |
8091 } // namespace gles2 | 8105 } // namespace gles2 |
8092 """) | 8106 """) |
8093 file.Close() | 8107 file.Close() |
| 8108 self.generated_cpp_filenames.append(file.filename) |
8094 | 8109 |
8095 def WriteGLES2InterfaceHeader(self, filename): | 8110 def WriteGLES2InterfaceHeader(self, filename): |
8096 """Writes the GLES2 interface header.""" | 8111 """Writes the GLES2 interface header.""" |
8097 file = CHeaderWriter( | 8112 file = CHeaderWriter( |
8098 filename, | 8113 filename, |
8099 "// This file is included by gles2_interface.h to declare the\n" | 8114 "// This file is included by gles2_interface.h to declare the\n" |
8100 "// GL api functions.\n") | 8115 "// GL api functions.\n") |
8101 for func in self.original_functions: | 8116 for func in self.original_functions: |
8102 func.WriteGLES2InterfaceHeader(file) | 8117 func.WriteGLES2InterfaceHeader(file) |
8103 file.Close() | 8118 file.Close() |
| 8119 self.generated_cpp_filenames.append(file.filename) |
8104 | 8120 |
8105 def WriteGLES2InterfaceStub(self, filename): | 8121 def WriteGLES2InterfaceStub(self, filename): |
8106 """Writes the GLES2 interface stub header.""" | 8122 """Writes the GLES2 interface stub header.""" |
8107 file = CHeaderWriter( | 8123 file = CHeaderWriter( |
8108 filename, | 8124 filename, |
8109 "// This file is included by gles2_interface_stub.h.\n") | 8125 "// This file is included by gles2_interface_stub.h.\n") |
8110 for func in self.original_functions: | 8126 for func in self.original_functions: |
8111 func.WriteGLES2InterfaceStub(file) | 8127 func.WriteGLES2InterfaceStub(file) |
8112 file.Close() | 8128 file.Close() |
| 8129 self.generated_cpp_filenames.append(file.filename) |
8113 | 8130 |
8114 def WriteGLES2InterfaceStubImpl(self, filename): | 8131 def WriteGLES2InterfaceStubImpl(self, filename): |
8115 """Writes the GLES2 interface header.""" | 8132 """Writes the GLES2 interface header.""" |
8116 file = CHeaderWriter( | 8133 file = CHeaderWriter( |
8117 filename, | 8134 filename, |
8118 "// This file is included by gles2_interface_stub.cc.\n") | 8135 "// This file is included by gles2_interface_stub.cc.\n") |
8119 for func in self.original_functions: | 8136 for func in self.original_functions: |
8120 func.WriteGLES2InterfaceStubImpl(file) | 8137 func.WriteGLES2InterfaceStubImpl(file) |
8121 file.Close() | 8138 file.Close() |
| 8139 self.generated_cpp_filenames.append(file.filename) |
8122 | 8140 |
8123 def WriteGLES2ImplementationHeader(self, filename): | 8141 def WriteGLES2ImplementationHeader(self, filename): |
8124 """Writes the GLES2 Implementation header.""" | 8142 """Writes the GLES2 Implementation header.""" |
8125 file = CHeaderWriter( | 8143 file = CHeaderWriter( |
8126 filename, | 8144 filename, |
8127 "// This file is included by gles2_implementation.h to declare the\n" | 8145 "// This file is included by gles2_implementation.h to declare the\n" |
8128 "// GL api functions.\n") | 8146 "// GL api functions.\n") |
8129 for func in self.original_functions: | 8147 for func in self.original_functions: |
8130 func.WriteGLES2ImplementationHeader(file) | 8148 func.WriteGLES2ImplementationHeader(file) |
8131 file.Close() | 8149 file.Close() |
| 8150 self.generated_cpp_filenames.append(file.filename) |
8132 | 8151 |
8133 def WriteGLES2Implementation(self, filename): | 8152 def WriteGLES2Implementation(self, filename): |
8134 """Writes the GLES2 Implementation.""" | 8153 """Writes the GLES2 Implementation.""" |
8135 file = CHeaderWriter( | 8154 file = CHeaderWriter( |
8136 filename, | 8155 filename, |
8137 "// This file is included by gles2_implementation.cc to define the\n" | 8156 "// This file is included by gles2_implementation.cc to define the\n" |
8138 "// GL api functions.\n") | 8157 "// GL api functions.\n") |
8139 for func in self.original_functions: | 8158 for func in self.original_functions: |
8140 func.WriteGLES2Implementation(file) | 8159 func.WriteGLES2Implementation(file) |
8141 file.Close() | 8160 file.Close() |
| 8161 self.generated_cpp_filenames.append(file.filename) |
8142 | 8162 |
8143 def WriteGLES2TraceImplementationHeader(self, filename): | 8163 def WriteGLES2TraceImplementationHeader(self, filename): |
8144 """Writes the GLES2 Trace Implementation header.""" | 8164 """Writes the GLES2 Trace Implementation header.""" |
8145 file = CHeaderWriter( | 8165 file = CHeaderWriter( |
8146 filename, | 8166 filename, |
8147 "// This file is included by gles2_trace_implementation.h\n") | 8167 "// This file is included by gles2_trace_implementation.h\n") |
8148 for func in self.original_functions: | 8168 for func in self.original_functions: |
8149 func.WriteGLES2TraceImplementationHeader(file) | 8169 func.WriteGLES2TraceImplementationHeader(file) |
8150 file.Close() | 8170 file.Close() |
| 8171 self.generated_cpp_filenames.append(file.filename) |
8151 | 8172 |
8152 def WriteGLES2TraceImplementation(self, filename): | 8173 def WriteGLES2TraceImplementation(self, filename): |
8153 """Writes the GLES2 Trace Implementation.""" | 8174 """Writes the GLES2 Trace Implementation.""" |
8154 file = CHeaderWriter( | 8175 file = CHeaderWriter( |
8155 filename, | 8176 filename, |
8156 "// This file is included by gles2_trace_implementation.cc\n") | 8177 "// This file is included by gles2_trace_implementation.cc\n") |
8157 for func in self.original_functions: | 8178 for func in self.original_functions: |
8158 func.WriteGLES2TraceImplementation(file) | 8179 func.WriteGLES2TraceImplementation(file) |
8159 file.Close() | 8180 file.Close() |
| 8181 self.generated_cpp_filenames.append(file.filename) |
8160 | 8182 |
8161 def WriteGLES2ImplementationUnitTests(self, filename): | 8183 def WriteGLES2ImplementationUnitTests(self, filename): |
8162 """Writes the GLES2 helper header.""" | 8184 """Writes the GLES2 helper header.""" |
8163 file = CHeaderWriter( | 8185 file = CHeaderWriter( |
8164 filename, | 8186 filename, |
8165 "// This file is included by gles2_implementation.h to declare the\n" | 8187 "// This file is included by gles2_implementation.h to declare the\n" |
8166 "// GL api functions.\n") | 8188 "// GL api functions.\n") |
8167 for func in self.original_functions: | 8189 for func in self.original_functions: |
8168 func.WriteGLES2ImplementationUnitTest(file) | 8190 func.WriteGLES2ImplementationUnitTest(file) |
8169 file.Close() | 8191 file.Close() |
| 8192 self.generated_cpp_filenames.append(file.filename) |
8170 | 8193 |
8171 def WriteServiceUtilsHeader(self, filename): | 8194 def WriteServiceUtilsHeader(self, filename): |
8172 """Writes the gles2 auto generated utility header.""" | 8195 """Writes the gles2 auto generated utility header.""" |
8173 file = CHeaderWriter(filename) | 8196 file = CHeaderWriter(filename) |
8174 for name in sorted(_NAMED_TYPE_INFO.keys()): | 8197 for name in sorted(_NAMED_TYPE_INFO.keys()): |
8175 named_type = NamedType(_NAMED_TYPE_INFO[name]) | 8198 named_type = NamedType(_NAMED_TYPE_INFO[name]) |
8176 if named_type.IsConstant(): | 8199 if named_type.IsConstant(): |
8177 continue | 8200 continue |
8178 file.Write("ValueValidator<%s> %s;\n" % | 8201 file.Write("ValueValidator<%s> %s;\n" % |
8179 (named_type.GetType(), ToUnderscore(name))) | 8202 (named_type.GetType(), ToUnderscore(name))) |
8180 file.Write("\n") | 8203 file.Write("\n") |
8181 file.Close() | 8204 file.Close() |
| 8205 self.generated_cpp_filenames.append(file.filename) |
8182 | 8206 |
8183 def WriteServiceUtilsImplementation(self, filename): | 8207 def WriteServiceUtilsImplementation(self, filename): |
8184 """Writes the gles2 auto generated utility implementation.""" | 8208 """Writes the gles2 auto generated utility implementation.""" |
8185 file = CHeaderWriter(filename) | 8209 file = CHeaderWriter(filename) |
8186 names = sorted(_NAMED_TYPE_INFO.keys()) | 8210 names = sorted(_NAMED_TYPE_INFO.keys()) |
8187 for name in names: | 8211 for name in names: |
8188 named_type = NamedType(_NAMED_TYPE_INFO[name]) | 8212 named_type = NamedType(_NAMED_TYPE_INFO[name]) |
8189 if named_type.IsConstant(): | 8213 if named_type.IsConstant(): |
8190 continue | 8214 continue |
8191 if named_type.GetValidValues(): | 8215 if named_type.GetValidValues(): |
(...skipping 15 matching lines...) Expand all Loading... |
8207 else: | 8231 else: |
8208 code = "%(pre)s%(name)s()" | 8232 code = "%(pre)s%(name)s()" |
8209 file.Write(code % { | 8233 file.Write(code % { |
8210 'name': ToUnderscore(name), | 8234 'name': ToUnderscore(name), |
8211 'pre': pre, | 8235 'pre': pre, |
8212 }) | 8236 }) |
8213 pre = ',\n ' | 8237 pre = ',\n ' |
8214 file.Write(" {\n"); | 8238 file.Write(" {\n"); |
8215 file.Write("}\n\n"); | 8239 file.Write("}\n\n"); |
8216 file.Close() | 8240 file.Close() |
| 8241 self.generated_cpp_filenames.append(file.filename) |
8217 | 8242 |
8218 def WriteCommonUtilsHeader(self, filename): | 8243 def WriteCommonUtilsHeader(self, filename): |
8219 """Writes the gles2 common utility header.""" | 8244 """Writes the gles2 common utility header.""" |
8220 file = CHeaderWriter(filename) | 8245 file = CHeaderWriter(filename) |
8221 type_infos = sorted(_NAMED_TYPE_INFO.keys()) | 8246 type_infos = sorted(_NAMED_TYPE_INFO.keys()) |
8222 for type_info in type_infos: | 8247 for type_info in type_infos: |
8223 if _NAMED_TYPE_INFO[type_info]['type'] == 'GLenum': | 8248 if _NAMED_TYPE_INFO[type_info]['type'] == 'GLenum': |
8224 file.Write("static std::string GetString%s(uint32_t value);\n" % | 8249 file.Write("static std::string GetString%s(uint32_t value);\n" % |
8225 type_info) | 8250 type_info) |
8226 file.Write("\n") | 8251 file.Write("\n") |
8227 file.Close() | 8252 file.Close() |
| 8253 self.generated_cpp_filenames.append(file.filename) |
8228 | 8254 |
8229 def WriteCommonUtilsImpl(self, filename): | 8255 def WriteCommonUtilsImpl(self, filename): |
8230 """Writes the gles2 common utility header.""" | 8256 """Writes the gles2 common utility header.""" |
8231 enum_re = re.compile(r'\#define\s+(GL_[a-zA-Z0-9_]+)\s+([0-9A-Fa-fx]+)') | 8257 enum_re = re.compile(r'\#define\s+(GL_[a-zA-Z0-9_]+)\s+([0-9A-Fa-fx]+)') |
8232 dict = {} | 8258 dict = {} |
8233 for fname in ['../../third_party/khronos/GLES2/gl2.h', | 8259 for fname in ['third_party/khronos/GLES2/gl2.h', |
8234 '../../third_party/khronos/GLES2/gl2ext.h', | 8260 'third_party/khronos/GLES2/gl2ext.h', |
8235 '../../gpu/GLES2/gl2chromium.h', | 8261 'gpu/GLES2/gl2chromium.h', |
8236 '../../gpu/GLES2/gl2extchromium.h']: | 8262 'gpu/GLES2/gl2extchromium.h']: |
8237 lines = open(fname).readlines() | 8263 lines = open(fname).readlines() |
8238 for line in lines: | 8264 for line in lines: |
8239 m = enum_re.match(line) | 8265 m = enum_re.match(line) |
8240 if m: | 8266 if m: |
8241 name = m.group(1) | 8267 name = m.group(1) |
8242 value = m.group(2) | 8268 value = m.group(2) |
8243 if len(value) <= 10 and not value in dict: | 8269 if len(value) <= 10 and not value in dict: |
8244 dict[value] = name | 8270 dict[value] = name |
8245 | 8271 |
8246 file = CHeaderWriter(filename) | 8272 file = CHeaderWriter(filename) |
(...skipping 25 matching lines...) Expand all Loading... |
8272 } | 8298 } |
8273 | 8299 |
8274 """) | 8300 """) |
8275 else: | 8301 else: |
8276 file.Write(""" return GLES2Util::GetQualifiedEnumString( | 8302 file.Write(""" return GLES2Util::GetQualifiedEnumString( |
8277 NULL, 0, value); | 8303 NULL, 0, value); |
8278 } | 8304 } |
8279 | 8305 |
8280 """) | 8306 """) |
8281 file.Close() | 8307 file.Close() |
| 8308 self.generated_cpp_filenames.append(file.filename) |
8282 | 8309 |
8283 def WritePepperGLES2Interface(self, filename, dev): | 8310 def WritePepperGLES2Interface(self, filename, dev): |
8284 """Writes the Pepper OpenGLES interface definition.""" | 8311 """Writes the Pepper OpenGLES interface definition.""" |
8285 file = CWriter(filename) | 8312 file = CWriter(filename) |
8286 file.Write(_LICENSE) | 8313 file.Write(_LICENSE) |
8287 file.Write(_DO_NOT_EDIT_WARNING) | 8314 file.Write(_DO_NOT_EDIT_WARNING) |
8288 | 8315 |
8289 file.Write("label Chrome {\n") | 8316 file.Write("label Chrome {\n") |
8290 file.Write(" M39 = 1.0\n") | 8317 file.Write(" M39 = 1.0\n") |
8291 file.Write("};\n\n") | 8318 file.Write("};\n\n") |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8414 f.GetPepperName() for f in self.original_functions | 8441 f.GetPepperName() for f in self.original_functions |
8415 if f.InPepperInterface(interface))) | 8442 if f.InPepperInterface(interface))) |
8416 file.Write("\n") | 8443 file.Write("\n") |
8417 | 8444 |
8418 file.Write(" };\n") | 8445 file.Write(" };\n") |
8419 file.Write(" return &ppb_opengles2;\n") | 8446 file.Write(" return &ppb_opengles2;\n") |
8420 file.Write("}\n") | 8447 file.Write("}\n") |
8421 | 8448 |
8422 file.Write("} // namespace ppapi\n") | 8449 file.Write("} // namespace ppapi\n") |
8423 file.Close() | 8450 file.Close() |
| 8451 self.generated_cpp_filenames.append(file.filename) |
8424 | 8452 |
8425 def WriteGLES2ToPPAPIBridge(self, filename): | 8453 def WriteGLES2ToPPAPIBridge(self, filename): |
8426 """Connects GLES2 helper library to PPB_OpenGLES2 interface""" | 8454 """Connects GLES2 helper library to PPB_OpenGLES2 interface""" |
8427 | 8455 |
8428 file = CWriter(filename) | 8456 file = CWriter(filename) |
8429 file.Write(_LICENSE) | 8457 file.Write(_LICENSE) |
8430 file.Write(_DO_NOT_EDIT_WARNING) | 8458 file.Write(_DO_NOT_EDIT_WARNING) |
8431 | 8459 |
8432 file.Write("#ifndef GL_GLEXT_PROTOTYPES\n") | 8460 file.Write("#ifndef GL_GLEXT_PROTOTYPES\n") |
8433 file.Write("#define GL_GLEXT_PROTOTYPES\n") | 8461 file.Write("#define GL_GLEXT_PROTOTYPES\n") |
(...skipping 25 matching lines...) Expand all Loading... |
8459 file.Write(" if (ext)\n") | 8487 file.Write(" if (ext)\n") |
8460 file.Write(" %sext->%s(%s);\n" % | 8488 file.Write(" %sext->%s(%s);\n" % |
8461 (return_str, func.GetPepperName(), arg)) | 8489 (return_str, func.GetPepperName(), arg)) |
8462 if return_str: | 8490 if return_str: |
8463 file.Write(" %s0;\n" % return_str) | 8491 file.Write(" %s0;\n" % return_str) |
8464 else: | 8492 else: |
8465 file.Write(" %s%s->%s(%s);\n" % | 8493 file.Write(" %s%s->%s(%s);\n" % |
8466 (return_str, interface_str, func.GetPepperName(), arg)) | 8494 (return_str, interface_str, func.GetPepperName(), arg)) |
8467 file.Write("}\n\n") | 8495 file.Write("}\n\n") |
8468 file.Close() | 8496 file.Close() |
| 8497 self.generated_cpp_filenames.append(file.filename) |
8469 | 8498 |
8470 def WriteMojoGLCallVisitor(self, filename): | 8499 def WriteMojoGLCallVisitor(self, filename): |
8471 """Provides the GL implementation for mojo""" | 8500 """Provides the GL implementation for mojo""" |
8472 file = CWriter(filename) | 8501 file = CWriter(filename) |
8473 file.Write(_LICENSE) | 8502 file.Write(_LICENSE) |
8474 file.Write(_DO_NOT_EDIT_WARNING) | 8503 file.Write(_DO_NOT_EDIT_WARNING) |
8475 | 8504 |
8476 for func in self.original_functions: | 8505 for func in self.original_functions: |
8477 if not func.IsCoreGLFunction(): | 8506 if not func.IsCoreGLFunction(): |
8478 continue | 8507 continue |
8479 file.Write("VISIT_GL_CALL(%s, %s, (%s), (%s))\n" % | 8508 file.Write("VISIT_GL_CALL(%s, %s, (%s), (%s))\n" % |
8480 (func.name, func.return_type, | 8509 (func.name, func.return_type, |
8481 func.MakeTypedOriginalArgString(""), | 8510 func.MakeTypedOriginalArgString(""), |
8482 func.MakeOriginalArgString(""))) | 8511 func.MakeOriginalArgString(""))) |
8483 | 8512 |
8484 file.Close() | 8513 file.Close() |
| 8514 self.generated_cpp_filenames.append(file.filename) |
8485 | 8515 |
8486 def WriteMojoGLCallVisitorForExtension(self, filename, extension): | 8516 def WriteMojoGLCallVisitorForExtension(self, filename, extension): |
8487 """Provides the GL implementation for mojo for a particular extension""" | 8517 """Provides the GL implementation for mojo for a particular extension""" |
8488 file = CWriter(filename) | 8518 file = CWriter(filename) |
8489 file.Write(_LICENSE) | 8519 file.Write(_LICENSE) |
8490 file.Write(_DO_NOT_EDIT_WARNING) | 8520 file.Write(_DO_NOT_EDIT_WARNING) |
8491 | 8521 |
8492 for func in self.original_functions: | 8522 for func in self.original_functions: |
8493 if func.GetInfo("extension") != extension: | 8523 if func.GetInfo("extension") != extension: |
8494 continue | 8524 continue |
8495 file.Write("VISIT_GL_CALL(%s, %s, (%s), (%s))\n" % | 8525 file.Write("VISIT_GL_CALL(%s, %s, (%s), (%s))\n" % |
8496 (func.name, func.return_type, | 8526 (func.name, func.return_type, |
8497 func.MakeTypedOriginalArgString(""), | 8527 func.MakeTypedOriginalArgString(""), |
8498 func.MakeOriginalArgString(""))) | 8528 func.MakeOriginalArgString(""))) |
8499 | 8529 |
8500 file.Close() | 8530 file.Close() |
| 8531 self.generated_cpp_filenames.append(file.filename) |
8501 | 8532 |
8502 def Format(generated_files): | 8533 def Format(generated_files): |
8503 for filename in generated_files: | 8534 for filename in generated_files: |
8504 call(["clang-format", "-i", "-style=chromium", filename]) | 8535 call(["clang-format", "-i", "-style=chromium", filename]) |
8505 | 8536 |
8506 def main(argv): | 8537 def main(argv): |
8507 """This is the main function.""" | 8538 """This is the main function.""" |
8508 parser = OptionParser() | 8539 parser = OptionParser() |
8509 parser.add_option( | 8540 parser.add_option( |
8510 "--output-dir", | 8541 "--output-dir", |
(...skipping 20 matching lines...) Expand all Loading... |
8531 continue | 8562 continue |
8532 if not item['enum'] in gl_state_valid: | 8563 if not item['enum'] in gl_state_valid: |
8533 gl_state_valid.append(item['enum']) | 8564 gl_state_valid.append(item['enum']) |
8534 for capability in _CAPABILITY_FLAGS: | 8565 for capability in _CAPABILITY_FLAGS: |
8535 valid_value = "GL_%s" % capability['name'].upper() | 8566 valid_value = "GL_%s" % capability['name'].upper() |
8536 if not valid_value in gl_state_valid: | 8567 if not valid_value in gl_state_valid: |
8537 gl_state_valid.append(valid_value) | 8568 gl_state_valid.append(valid_value) |
8538 | 8569 |
8539 # This script lives under gpu/command_buffer, cd to base directory. | 8570 # This script lives under gpu/command_buffer, cd to base directory. |
8540 os.chdir(os.path.dirname(__file__) + "/../..") | 8571 os.chdir(os.path.dirname(__file__) + "/../..") |
8541 | 8572 base_dir = os.getcwd() |
8542 gen = GLGenerator(options.verbose) | 8573 gen = GLGenerator(options.verbose) |
8543 gen.ParseGLH("gpu/command_buffer/cmd_buffer_functions.txt") | 8574 gen.ParseGLH("gpu/command_buffer/cmd_buffer_functions.txt") |
8544 | 8575 |
8545 # Support generating files under gen/ | 8576 # Support generating files under gen/ |
8546 if options.output_dir != None: | 8577 if options.output_dir != None: |
8547 os.chdir(options.output_dir) | 8578 os.chdir(options.output_dir) |
8548 | 8579 |
8549 gen.WritePepperGLES2Interface("ppapi/api/ppb_opengles2.idl", False) | 8580 gen.WritePepperGLES2Interface("ppapi/api/ppb_opengles2.idl", False) |
8550 gen.WritePepperGLES2Interface("ppapi/api/dev/ppb_opengles2ext_dev.idl", True) | 8581 gen.WritePepperGLES2Interface("ppapi/api/dev/ppb_opengles2ext_dev.idl", True) |
8551 gen.WriteGLES2ToPPAPIBridge("ppapi/lib/gl/gles2/gles2.c") | 8582 gen.WriteGLES2ToPPAPIBridge("ppapi/lib/gl/gles2/gles2.c") |
8552 gen.WritePepperGLES2Implementation( | 8583 gen.WritePepperGLES2Implementation( |
8553 "ppapi/shared_impl/ppb_opengles2_shared.cc") | 8584 "ppapi/shared_impl/ppb_opengles2_shared.cc") |
8554 os.chdir("gpu/command_buffer") | 8585 os.chdir(base_dir) |
8555 gen.WriteCommandIds("common/gles2_cmd_ids_autogen.h") | 8586 gen.WriteCommandIds("gpu/command_buffer/common/gles2_cmd_ids_autogen.h") |
8556 gen.WriteFormat("common/gles2_cmd_format_autogen.h") | 8587 gen.WriteFormat("gpu/command_buffer/common/gles2_cmd_format_autogen.h") |
8557 gen.WriteFormatTest("common/gles2_cmd_format_test_autogen.h") | 8588 gen.WriteFormatTest( |
8558 gen.WriteGLES2InterfaceHeader("client/gles2_interface_autogen.h") | 8589 "gpu/command_buffer/common/gles2_cmd_format_test_autogen.h") |
8559 gen.WriteGLES2InterfaceStub("client/gles2_interface_stub_autogen.h") | 8590 gen.WriteGLES2InterfaceHeader( |
| 8591 "gpu/command_buffer/client/gles2_interface_autogen.h") |
| 8592 gen.WriteGLES2InterfaceStub( |
| 8593 "gpu/command_buffer/client/gles2_interface_stub_autogen.h") |
8560 gen.WriteGLES2InterfaceStubImpl( | 8594 gen.WriteGLES2InterfaceStubImpl( |
8561 "client/gles2_interface_stub_impl_autogen.h") | 8595 "gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h") |
8562 gen.WriteGLES2ImplementationHeader("client/gles2_implementation_autogen.h") | 8596 gen.WriteGLES2ImplementationHeader( |
8563 gen.WriteGLES2Implementation("client/gles2_implementation_impl_autogen.h") | 8597 "gpu/command_buffer/client/gles2_implementation_autogen.h") |
| 8598 gen.WriteGLES2Implementation( |
| 8599 "gpu/command_buffer/client/gles2_implementation_impl_autogen.h") |
8564 gen.WriteGLES2ImplementationUnitTests( | 8600 gen.WriteGLES2ImplementationUnitTests( |
8565 "client/gles2_implementation_unittest_autogen.h") | 8601 "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h") |
8566 gen.WriteGLES2TraceImplementationHeader( | 8602 gen.WriteGLES2TraceImplementationHeader( |
8567 "client/gles2_trace_implementation_autogen.h") | 8603 "gpu/command_buffer/client/gles2_trace_implementation_autogen.h") |
8568 gen.WriteGLES2TraceImplementation( | 8604 gen.WriteGLES2TraceImplementation( |
8569 "client/gles2_trace_implementation_impl_autogen.h") | 8605 "gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h") |
8570 gen.WriteGLES2CLibImplementation("client/gles2_c_lib_autogen.h") | 8606 gen.WriteGLES2CLibImplementation( |
8571 gen.WriteCmdHelperHeader("client/gles2_cmd_helper_autogen.h") | 8607 "gpu/command_buffer/client/gles2_c_lib_autogen.h") |
8572 gen.WriteServiceImplementation("service/gles2_cmd_decoder_autogen.h") | 8608 gen.WriteCmdHelperHeader( |
8573 gen.WriteServiceContextStateHeader("service/context_state_autogen.h") | 8609 "gpu/command_buffer/client/gles2_cmd_helper_autogen.h") |
8574 gen.WriteServiceContextStateImpl("service/context_state_impl_autogen.h") | 8610 gen.WriteServiceImplementation( |
8575 gen.WriteClientContextStateHeader("client/client_context_state_autogen.h") | 8611 "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h") |
| 8612 gen.WriteServiceContextStateHeader( |
| 8613 "gpu/command_buffer/service/context_state_autogen.h") |
| 8614 gen.WriteServiceContextStateImpl( |
| 8615 "gpu/command_buffer/service/context_state_impl_autogen.h") |
| 8616 gen.WriteClientContextStateHeader( |
| 8617 "gpu/command_buffer/client/client_context_state_autogen.h") |
8576 gen.WriteClientContextStateImpl( | 8618 gen.WriteClientContextStateImpl( |
8577 "client/client_context_state_impl_autogen.h") | 8619 "gpu/command_buffer/client/client_context_state_impl_autogen.h") |
8578 gen.WriteServiceUnitTests("service/gles2_cmd_decoder_unittest_%d_autogen.h") | 8620 gen.WriteServiceUnitTests( |
| 8621 "gpu/command_buffer/service/gles2_cmd_decoder_unittest_%d_autogen.h") |
8579 gen.WriteServiceUnitTestsForExtensions( | 8622 gen.WriteServiceUnitTestsForExtensions( |
8580 "service/gles2_cmd_decoder_unittest_extensions_autogen.h") | 8623 "gpu/command_buffer/service/" |
8581 gen.WriteServiceUtilsHeader("service/gles2_cmd_validation_autogen.h") | 8624 "gles2_cmd_decoder_unittest_extensions_autogen.h") |
| 8625 gen.WriteServiceUtilsHeader( |
| 8626 "gpu/command_buffer/service/gles2_cmd_validation_autogen.h") |
8582 gen.WriteServiceUtilsImplementation( | 8627 gen.WriteServiceUtilsImplementation( |
8583 "service/gles2_cmd_validation_implementation_autogen.h") | 8628 "gpu/command_buffer/service/" |
8584 gen.WriteCommonUtilsHeader("common/gles2_cmd_utils_autogen.h") | 8629 "gles2_cmd_validation_implementation_autogen.h") |
8585 gen.WriteCommonUtilsImpl("common/gles2_cmd_utils_implementation_autogen.h") | 8630 gen.WriteCommonUtilsHeader( |
8586 gen.WriteGLES2Header("../GLES2/gl2chromium_autogen.h") | 8631 "gpu/command_buffer/common/gles2_cmd_utils_autogen.h") |
8587 mojo_gles2_prefix = "../../mojo/public/c/gles2/gles2_call_visitor" | 8632 gen.WriteCommonUtilsImpl( |
| 8633 "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h") |
| 8634 gen.WriteGLES2Header("gpu/GLES2/gl2chromium_autogen.h") |
| 8635 mojo_gles2_prefix = "mojo/public/c/gles2/gles2_call_visitor" |
8588 gen.WriteMojoGLCallVisitor(mojo_gles2_prefix + "_autogen.h") | 8636 gen.WriteMojoGLCallVisitor(mojo_gles2_prefix + "_autogen.h") |
8589 gen.WriteMojoGLCallVisitorForExtension( | 8637 gen.WriteMojoGLCallVisitorForExtension( |
8590 mojo_gles2_prefix + "_chromium_texture_mailbox_autogen.h", | 8638 mojo_gles2_prefix + "_chromium_texture_mailbox_autogen.h", |
8591 "CHROMIUM_texture_mailbox") | 8639 "CHROMIUM_texture_mailbox") |
8592 gen.WriteMojoGLCallVisitorForExtension( | 8640 gen.WriteMojoGLCallVisitorForExtension( |
8593 mojo_gles2_prefix + "_chromium_sync_point_autogen.h", | 8641 mojo_gles2_prefix + "_chromium_sync_point_autogen.h", |
8594 "CHROMIUM_sync_point") | 8642 "CHROMIUM_sync_point") |
8595 | 8643 |
8596 Format([ | 8644 Format(gen.generated_cpp_filenames) |
8597 "common/gles2_cmd_format_autogen.h", | |
8598 "common/gles2_cmd_format_test_autogen.h", | |
8599 "common/gles2_cmd_ids_autogen.h", | |
8600 "common/gles2_cmd_utils_autogen.h", | |
8601 "common/gles2_cmd_utils_implementation_autogen.h", | |
8602 "client/client_context_state_autogen.h", | |
8603 "client/client_context_state_impl_autogen.h", | |
8604 "client/gles2_cmd_helper_autogen.h", | |
8605 "client/gles2_c_lib_autogen.h", | |
8606 "client/gles2_implementation_autogen.h", | |
8607 "client/gles2_implementation_impl_autogen.h", | |
8608 "client/gles2_implementation_unittest_autogen.h", | |
8609 "client/gles2_interface_autogen.h", | |
8610 "client/gles2_interface_stub_autogen.h", | |
8611 "client/gles2_interface_stub_impl_autogen.h", | |
8612 "client/gles2_trace_implementation_autogen.h", | |
8613 "client/gles2_trace_implementation_impl_autogen.h", | |
8614 "service/context_state_autogen.h", | |
8615 "service/context_state_impl_autogen.h", | |
8616 "service/gles2_cmd_decoder_autogen.h", | |
8617 "service/gles2_cmd_decoder_unittest_0_autogen.h", | |
8618 "service/gles2_cmd_decoder_unittest_1_autogen.h", | |
8619 "service/gles2_cmd_decoder_unittest_2_autogen.h", | |
8620 "service/gles2_cmd_decoder_unittest_3_autogen.h", | |
8621 "service/gles2_cmd_validation_autogen.h", | |
8622 "service/gles2_cmd_validation_implementation_autogen.h"]) | |
8623 os.chdir("../..") | |
8624 mojo_gles2_prefix = "mojo/public/c/gles2/gles2_call_visitor" | |
8625 Format([ | |
8626 "gpu/GLES2/gl2chromium_autogen.h", | |
8627 mojo_gles2_prefix + "_autogen.h", | |
8628 mojo_gles2_prefix + "_chromium_texture_mailbox_autogen.h", | |
8629 mojo_gles2_prefix + "_chromium_sync_point_autogen.h", | |
8630 "ppapi/lib/gl/gles2/gles2.c", | |
8631 "ppapi/shared_impl/ppb_opengles2_shared.cc"]) | |
8632 | 8645 |
8633 if gen.errors > 0: | 8646 if gen.errors > 0: |
8634 print "%d errors" % gen.errors | 8647 print "%d errors" % gen.errors |
8635 return 1 | 8648 return 1 |
8636 return 0 | 8649 return 0 |
8637 | 8650 |
8638 | 8651 |
8639 if __name__ == '__main__': | 8652 if __name__ == '__main__': |
8640 sys.exit(main(sys.argv[1:])) | 8653 sys.exit(main(sys.argv[1:])) |
OLD | NEW |