| Index: gpu/command_buffer/build_gles2_cmd_buffer.py
|
| diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py
|
| index 09099d55ba5056ffb70a3ccd7a8c768a7f739d4c..24ffa2678cd7fd71f85974332acd1e81e094b737 100755
|
| --- a/gpu/command_buffer/build_gles2_cmd_buffer.py
|
| +++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
|
| @@ -7370,6 +7370,7 @@ class GLGenerator(object):
|
| self.errors = 0
|
| self.pepper_interfaces = []
|
| self.interface_info = {}
|
| + self.generated_cpp_filenames = []
|
|
|
| for interface in _PEPPER_INTERFACES:
|
| interface = PepperInterface(interface)
|
| @@ -7494,6 +7495,7 @@ class GLGenerator(object):
|
| file.Write("};\n")
|
| file.Write("\n")
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteFormat(self, filename):
|
| """Writes the command buffer format"""
|
| @@ -7505,6 +7507,7 @@ class GLGenerator(object):
|
| func.WriteStruct(file)
|
| file.Write("\n")
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteDocs(self, filename):
|
| """Writes the command buffer doc version of the commands"""
|
| @@ -7516,6 +7519,7 @@ class GLGenerator(object):
|
| func.WriteDocs(file)
|
| file.Write("\n")
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteFormatTest(self, filename):
|
| """Writes the command buffer format test."""
|
| @@ -7532,6 +7536,7 @@ class GLGenerator(object):
|
| func.WriteFormatTest(file)
|
|
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteCmdHelperHeader(self, filename):
|
| """Writes the gles2 command helper."""
|
| @@ -7544,6 +7549,7 @@ class GLGenerator(object):
|
| func.WriteCmdHelper(file)
|
|
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteServiceContextStateHeader(self, filename):
|
| """Writes the service context state header."""
|
| @@ -7604,6 +7610,7 @@ class GLGenerator(object):
|
| """)
|
|
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteClientContextStateHeader(self, filename):
|
| """Writes the client context state header."""
|
| @@ -7617,6 +7624,7 @@ class GLGenerator(object):
|
| file.Write("};\n\n")
|
|
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteContextStateGetters(self, file, class_name):
|
| """Writes the state getters."""
|
| @@ -7825,6 +7833,7 @@ void ContextState::InitState(const ContextState *prev_state) const {
|
|
|
| self.WriteContextStateGetters(file, "ContextState")
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteClientContextStateImpl(self, filename):
|
| """Writes the context state client side implementation."""
|
| @@ -7874,6 +7883,7 @@ bool ClientContextState::SetCapabilityState(
|
| }
|
| """)
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteServiceImplementation(self, filename):
|
| """Writes the service decorder implementation."""
|
| @@ -7920,6 +7930,7 @@ bool GLES2DecoderImpl::SetCapabilityState(GLenum cap, bool enabled) {
|
| }
|
| """)
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteServiceUnitTests(self, filename):
|
| """Writes the service decorder unit tests."""
|
| @@ -7954,8 +7965,8 @@ bool GLES2DecoderImpl::SetCapabilityState(GLenum cap, bool enabled) {
|
| func.WriteServiceUnitTest(file, {
|
| 'test_name': test_name
|
| })
|
| -
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
| file = CHeaderWriter(
|
| filename % 0,
|
| "// It is included by gles2_cmd_decoder_unittest_base.cc\n")
|
| @@ -8031,6 +8042,7 @@ void GLES2DecoderTestBase::SetupInitStateExpectations() {
|
| file.Write("""}
|
| """)
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteServiceUnitTestsForExtensions(self, filename):
|
| """Writes the service decorder unit tests for functions with extension_flag.
|
| @@ -8054,6 +8066,7 @@ void GLES2DecoderTestBase::SetupInitStateExpectations() {
|
| })
|
|
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteGLES2Header(self, filename):
|
| """Writes the GLES2 header."""
|
| @@ -8066,6 +8079,7 @@ void GLES2DecoderTestBase::SetupInitStateExpectations() {
|
|
|
| file.Write("\n")
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteGLES2CLibImplementation(self, filename):
|
| """Writes the GLES2 c lib implementation."""
|
| @@ -8091,6 +8105,7 @@ extern const NameToFunc g_gles2_function_table[] = {
|
| } // namespace gles2
|
| """)
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteGLES2InterfaceHeader(self, filename):
|
| """Writes the GLES2 interface header."""
|
| @@ -8101,6 +8116,7 @@ extern const NameToFunc g_gles2_function_table[] = {
|
| for func in self.original_functions:
|
| func.WriteGLES2InterfaceHeader(file)
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteGLES2InterfaceStub(self, filename):
|
| """Writes the GLES2 interface stub header."""
|
| @@ -8110,6 +8126,7 @@ extern const NameToFunc g_gles2_function_table[] = {
|
| for func in self.original_functions:
|
| func.WriteGLES2InterfaceStub(file)
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteGLES2InterfaceStubImpl(self, filename):
|
| """Writes the GLES2 interface header."""
|
| @@ -8119,6 +8136,7 @@ extern const NameToFunc g_gles2_function_table[] = {
|
| for func in self.original_functions:
|
| func.WriteGLES2InterfaceStubImpl(file)
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteGLES2ImplementationHeader(self, filename):
|
| """Writes the GLES2 Implementation header."""
|
| @@ -8129,6 +8147,7 @@ extern const NameToFunc g_gles2_function_table[] = {
|
| for func in self.original_functions:
|
| func.WriteGLES2ImplementationHeader(file)
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteGLES2Implementation(self, filename):
|
| """Writes the GLES2 Implementation."""
|
| @@ -8139,6 +8158,7 @@ extern const NameToFunc g_gles2_function_table[] = {
|
| for func in self.original_functions:
|
| func.WriteGLES2Implementation(file)
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteGLES2TraceImplementationHeader(self, filename):
|
| """Writes the GLES2 Trace Implementation header."""
|
| @@ -8148,6 +8168,7 @@ extern const NameToFunc g_gles2_function_table[] = {
|
| for func in self.original_functions:
|
| func.WriteGLES2TraceImplementationHeader(file)
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteGLES2TraceImplementation(self, filename):
|
| """Writes the GLES2 Trace Implementation."""
|
| @@ -8157,6 +8178,7 @@ extern const NameToFunc g_gles2_function_table[] = {
|
| for func in self.original_functions:
|
| func.WriteGLES2TraceImplementation(file)
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteGLES2ImplementationUnitTests(self, filename):
|
| """Writes the GLES2 helper header."""
|
| @@ -8167,6 +8189,7 @@ extern const NameToFunc g_gles2_function_table[] = {
|
| for func in self.original_functions:
|
| func.WriteGLES2ImplementationUnitTest(file)
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteServiceUtilsHeader(self, filename):
|
| """Writes the gles2 auto generated utility header."""
|
| @@ -8179,6 +8202,7 @@ extern const NameToFunc g_gles2_function_table[] = {
|
| (named_type.GetType(), ToUnderscore(name)))
|
| file.Write("\n")
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteServiceUtilsImplementation(self, filename):
|
| """Writes the gles2 auto generated utility implementation."""
|
| @@ -8214,6 +8238,7 @@ extern const NameToFunc g_gles2_function_table[] = {
|
| file.Write(" {\n");
|
| file.Write("}\n\n");
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteCommonUtilsHeader(self, filename):
|
| """Writes the gles2 common utility header."""
|
| @@ -8225,15 +8250,16 @@ extern const NameToFunc g_gles2_function_table[] = {
|
| type_info)
|
| file.Write("\n")
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteCommonUtilsImpl(self, filename):
|
| """Writes the gles2 common utility header."""
|
| enum_re = re.compile(r'\#define\s+(GL_[a-zA-Z0-9_]+)\s+([0-9A-Fa-fx]+)')
|
| dict = {}
|
| - for fname in ['../../third_party/khronos/GLES2/gl2.h',
|
| - '../../third_party/khronos/GLES2/gl2ext.h',
|
| - '../../gpu/GLES2/gl2chromium.h',
|
| - '../../gpu/GLES2/gl2extchromium.h']:
|
| + for fname in ['third_party/khronos/GLES2/gl2.h',
|
| + 'third_party/khronos/GLES2/gl2ext.h',
|
| + 'gpu/GLES2/gl2chromium.h',
|
| + 'gpu/GLES2/gl2extchromium.h']:
|
| lines = open(fname).readlines()
|
| for line in lines:
|
| m = enum_re.match(line)
|
| @@ -8279,6 +8305,7 @@ const size_t GLES2Util::enum_to_string_table_len_ =
|
|
|
| """)
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WritePepperGLES2Interface(self, filename, dev):
|
| """Writes the Pepper OpenGLES interface definition."""
|
| @@ -8421,6 +8448,7 @@ const size_t GLES2Util::enum_to_string_table_len_ =
|
|
|
| file.Write("} // namespace ppapi\n")
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteGLES2ToPPAPIBridge(self, filename):
|
| """Connects GLES2 helper library to PPB_OpenGLES2 interface"""
|
| @@ -8466,6 +8494,7 @@ const size_t GLES2Util::enum_to_string_table_len_ =
|
| (return_str, interface_str, func.GetPepperName(), arg))
|
| file.Write("}\n\n")
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteMojoGLCallVisitor(self, filename):
|
| """Provides the GL implementation for mojo"""
|
| @@ -8482,6 +8511,7 @@ const size_t GLES2Util::enum_to_string_table_len_ =
|
| func.MakeOriginalArgString("")))
|
|
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def WriteMojoGLCallVisitorForExtension(self, filename, extension):
|
| """Provides the GL implementation for mojo for a particular extension"""
|
| @@ -8498,6 +8528,7 @@ const size_t GLES2Util::enum_to_string_table_len_ =
|
| func.MakeOriginalArgString("")))
|
|
|
| file.Close()
|
| + self.generated_cpp_filenames.append(file.filename)
|
|
|
| def Format(generated_files):
|
| for filename in generated_files:
|
| @@ -8538,7 +8569,7 @@ def main(argv):
|
|
|
| # This script lives under gpu/command_buffer, cd to base directory.
|
| os.chdir(os.path.dirname(__file__) + "/../..")
|
| -
|
| + base_dir = os.getcwd()
|
| gen = GLGenerator(options.verbose)
|
| gen.ParseGLH("gpu/command_buffer/cmd_buffer_functions.txt")
|
|
|
| @@ -8551,40 +8582,57 @@ def main(argv):
|
| gen.WriteGLES2ToPPAPIBridge("ppapi/lib/gl/gles2/gles2.c")
|
| gen.WritePepperGLES2Implementation(
|
| "ppapi/shared_impl/ppb_opengles2_shared.cc")
|
| - os.chdir("gpu/command_buffer")
|
| - gen.WriteCommandIds("common/gles2_cmd_ids_autogen.h")
|
| - gen.WriteFormat("common/gles2_cmd_format_autogen.h")
|
| - gen.WriteFormatTest("common/gles2_cmd_format_test_autogen.h")
|
| - gen.WriteGLES2InterfaceHeader("client/gles2_interface_autogen.h")
|
| - gen.WriteGLES2InterfaceStub("client/gles2_interface_stub_autogen.h")
|
| + os.chdir(base_dir)
|
| + gen.WriteCommandIds("gpu/command_buffer/common/gles2_cmd_ids_autogen.h")
|
| + gen.WriteFormat("gpu/command_buffer/common/gles2_cmd_format_autogen.h")
|
| + gen.WriteFormatTest(
|
| + "gpu/command_buffer/common/gles2_cmd_format_test_autogen.h")
|
| + gen.WriteGLES2InterfaceHeader(
|
| + "gpu/command_buffer/client/gles2_interface_autogen.h")
|
| + gen.WriteGLES2InterfaceStub(
|
| + "gpu/command_buffer/client/gles2_interface_stub_autogen.h")
|
| gen.WriteGLES2InterfaceStubImpl(
|
| - "client/gles2_interface_stub_impl_autogen.h")
|
| - gen.WriteGLES2ImplementationHeader("client/gles2_implementation_autogen.h")
|
| - gen.WriteGLES2Implementation("client/gles2_implementation_impl_autogen.h")
|
| + "gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h")
|
| + gen.WriteGLES2ImplementationHeader(
|
| + "gpu/command_buffer/client/gles2_implementation_autogen.h")
|
| + gen.WriteGLES2Implementation(
|
| + "gpu/command_buffer/client/gles2_implementation_impl_autogen.h")
|
| gen.WriteGLES2ImplementationUnitTests(
|
| - "client/gles2_implementation_unittest_autogen.h")
|
| + "gpu/command_buffer/client/gles2_implementation_unittest_autogen.h")
|
| gen.WriteGLES2TraceImplementationHeader(
|
| - "client/gles2_trace_implementation_autogen.h")
|
| + "gpu/command_buffer/client/gles2_trace_implementation_autogen.h")
|
| gen.WriteGLES2TraceImplementation(
|
| - "client/gles2_trace_implementation_impl_autogen.h")
|
| - gen.WriteGLES2CLibImplementation("client/gles2_c_lib_autogen.h")
|
| - gen.WriteCmdHelperHeader("client/gles2_cmd_helper_autogen.h")
|
| - gen.WriteServiceImplementation("service/gles2_cmd_decoder_autogen.h")
|
| - gen.WriteServiceContextStateHeader("service/context_state_autogen.h")
|
| - gen.WriteServiceContextStateImpl("service/context_state_impl_autogen.h")
|
| - gen.WriteClientContextStateHeader("client/client_context_state_autogen.h")
|
| + "gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h")
|
| + gen.WriteGLES2CLibImplementation(
|
| + "gpu/command_buffer/client/gles2_c_lib_autogen.h")
|
| + gen.WriteCmdHelperHeader(
|
| + "gpu/command_buffer/client/gles2_cmd_helper_autogen.h")
|
| + gen.WriteServiceImplementation(
|
| + "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h")
|
| + gen.WriteServiceContextStateHeader(
|
| + "gpu/command_buffer/service/context_state_autogen.h")
|
| + gen.WriteServiceContextStateImpl(
|
| + "gpu/command_buffer/service/context_state_impl_autogen.h")
|
| + gen.WriteClientContextStateHeader(
|
| + "gpu/command_buffer/client/client_context_state_autogen.h")
|
| gen.WriteClientContextStateImpl(
|
| - "client/client_context_state_impl_autogen.h")
|
| - gen.WriteServiceUnitTests("service/gles2_cmd_decoder_unittest_%d_autogen.h")
|
| + "gpu/command_buffer/client/client_context_state_impl_autogen.h")
|
| + gen.WriteServiceUnitTests(
|
| + "gpu/command_buffer/service/gles2_cmd_decoder_unittest_%d_autogen.h")
|
| gen.WriteServiceUnitTestsForExtensions(
|
| - "service/gles2_cmd_decoder_unittest_extensions_autogen.h")
|
| - gen.WriteServiceUtilsHeader("service/gles2_cmd_validation_autogen.h")
|
| + "gpu/command_buffer/service/"
|
| + "gles2_cmd_decoder_unittest_extensions_autogen.h")
|
| + gen.WriteServiceUtilsHeader(
|
| + "gpu/command_buffer/service/gles2_cmd_validation_autogen.h")
|
| gen.WriteServiceUtilsImplementation(
|
| - "service/gles2_cmd_validation_implementation_autogen.h")
|
| - gen.WriteCommonUtilsHeader("common/gles2_cmd_utils_autogen.h")
|
| - gen.WriteCommonUtilsImpl("common/gles2_cmd_utils_implementation_autogen.h")
|
| - gen.WriteGLES2Header("../GLES2/gl2chromium_autogen.h")
|
| - mojo_gles2_prefix = "../../mojo/public/c/gles2/gles2_call_visitor"
|
| + "gpu/command_buffer/service/"
|
| + "gles2_cmd_validation_implementation_autogen.h")
|
| + gen.WriteCommonUtilsHeader(
|
| + "gpu/command_buffer/common/gles2_cmd_utils_autogen.h")
|
| + gen.WriteCommonUtilsImpl(
|
| + "gpu/command_buffer/common/gles2_cmd_utils_implementation_autogen.h")
|
| + gen.WriteGLES2Header("gpu/GLES2/gl2chromium_autogen.h")
|
| + mojo_gles2_prefix = "mojo/public/c/gles2/gles2_call_visitor"
|
| gen.WriteMojoGLCallVisitor(mojo_gles2_prefix + "_autogen.h")
|
| gen.WriteMojoGLCallVisitorForExtension(
|
| mojo_gles2_prefix + "_chromium_texture_mailbox_autogen.h",
|
| @@ -8593,42 +8641,7 @@ def main(argv):
|
| mojo_gles2_prefix + "_chromium_sync_point_autogen.h",
|
| "CHROMIUM_sync_point")
|
|
|
| - Format([
|
| - "common/gles2_cmd_format_autogen.h",
|
| - "common/gles2_cmd_format_test_autogen.h",
|
| - "common/gles2_cmd_ids_autogen.h",
|
| - "common/gles2_cmd_utils_autogen.h",
|
| - "common/gles2_cmd_utils_implementation_autogen.h",
|
| - "client/client_context_state_autogen.h",
|
| - "client/client_context_state_impl_autogen.h",
|
| - "client/gles2_cmd_helper_autogen.h",
|
| - "client/gles2_c_lib_autogen.h",
|
| - "client/gles2_implementation_autogen.h",
|
| - "client/gles2_implementation_impl_autogen.h",
|
| - "client/gles2_implementation_unittest_autogen.h",
|
| - "client/gles2_interface_autogen.h",
|
| - "client/gles2_interface_stub_autogen.h",
|
| - "client/gles2_interface_stub_impl_autogen.h",
|
| - "client/gles2_trace_implementation_autogen.h",
|
| - "client/gles2_trace_implementation_impl_autogen.h",
|
| - "service/context_state_autogen.h",
|
| - "service/context_state_impl_autogen.h",
|
| - "service/gles2_cmd_decoder_autogen.h",
|
| - "service/gles2_cmd_decoder_unittest_0_autogen.h",
|
| - "service/gles2_cmd_decoder_unittest_1_autogen.h",
|
| - "service/gles2_cmd_decoder_unittest_2_autogen.h",
|
| - "service/gles2_cmd_decoder_unittest_3_autogen.h",
|
| - "service/gles2_cmd_validation_autogen.h",
|
| - "service/gles2_cmd_validation_implementation_autogen.h"])
|
| - os.chdir("../..")
|
| - mojo_gles2_prefix = "mojo/public/c/gles2/gles2_call_visitor"
|
| - Format([
|
| - "gpu/GLES2/gl2chromium_autogen.h",
|
| - mojo_gles2_prefix + "_autogen.h",
|
| - mojo_gles2_prefix + "_chromium_texture_mailbox_autogen.h",
|
| - mojo_gles2_prefix + "_chromium_sync_point_autogen.h",
|
| - "ppapi/lib/gl/gles2/gles2.c",
|
| - "ppapi/shared_impl/ppb_opengles2_shared.cc"])
|
| + Format(gen.generated_cpp_filenames)
|
|
|
| if gen.errors > 0:
|
| print "%d errors" % gen.errors
|
|
|