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

Unified Diff: gpu/command_buffer/build_gles2_cmd_buffer.py

Issue 1534813003: Use C bindings to Mojo GL entry points exclusively. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-6
Patch Set: rebase Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gpu/skia_bindings/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1855b95f53190247eeec60e8b9682c45ffa7e56c..74674ce50fcf81713621005c09e5edfa5c359aea 100755
--- a/gpu/command_buffer/build_gles2_cmd_buffer.py
+++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -4357,36 +4357,6 @@ TEST_P(%(test_name)s, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
- def WriteMojoGLES2ImplHeader(self, func, file):
- """Writes the Mojo GLES2 implementation header."""
- file.Write("%s %s(%s) override;\n" %
- (func.return_type, func.original_name,
- func.MakeTypedOriginalArgString("")))
-
- def WriteMojoGLES2Impl(self, func, file):
- """Writes the Mojo GLES2 implementation."""
- file.Write("%s MojoGLES2Impl::%s(%s) {\n" %
- (func.return_type, func.original_name,
- func.MakeTypedOriginalArgString("")))
-
- is_mojo_extension = func.GetInfo("extension") in _MOJO_EXPOSED_EXTENSIONS
- if func.IsCoreGLFunction() or is_mojo_extension:
- file.Write("MGLMakeCurrent(context_);");
- func_return = "gl" + func.original_name + "(" + \
- func.MakeOriginalArgString("") + ");"
- if func.original_name == "ResizeCHROMIUM":
- file.Write("MGLResizeSurface(width, height);");
- elif func.return_type == "void":
- file.Write(func_return);
- else:
- file.Write("return " + func_return);
- else:
- file.Write("NOTREACHED() << \"Unimplemented %s.\";\n" %
- func.original_name);
- if func.return_type != "void":
- file.Write("return 0;")
- file.Write("}")
-
def WriteGLES2InterfaceStub(self, func, file):
"""Writes the GLES2 Interface stub declaration."""
file.Write("%s %s(%s) override;\n" %
@@ -9097,14 +9067,6 @@ class Function(object):
"""Writes the GLES2 Interface declaration."""
self.type_handler.WriteGLES2InterfaceHeader(self, file)
- def WriteMojoGLES2ImplHeader(self, file):
- """Writes the Mojo GLES2 implementation header declaration."""
- self.type_handler.WriteMojoGLES2ImplHeader(self, file)
-
- def WriteMojoGLES2Impl(self, file):
- """Writes the Mojo GLES2 implementation declaration."""
- self.type_handler.WriteMojoGLES2Impl(self, file)
-
def WriteGLES2InterfaceStub(self, file):
"""Writes the GLES2 Interface Stub declaration."""
self.type_handler.WriteGLES2InterfaceStub(self, file)
@@ -10150,76 +10112,6 @@ extern const NameToFunc g_gles2_function_table[] = {
file.Close()
self.generated_cpp_filenames.append(file.filename)
- def WriteMojoGLES2ImplHeader(self, filename):
- """Writes the Mojo GLES2 implementation header."""
- file = CHeaderWriter(
- filename,
- "// This file is included by gles2_interface.h to declare the\n"
- "// GL api functions.\n")
-
- code = """
-#include <MGL/mgl.h>
-
-#include "gpu/command_buffer/client/gles2_interface.h"
-
-namespace mojo {
-
-class MojoGLES2Impl : public gpu::gles2::GLES2Interface {
- public:
- explicit MojoGLES2Impl(MGLContext context) {
- context_ = context;
- }
- ~MojoGLES2Impl() override {}
- """
- file.Write(code);
- for func in self.original_functions:
- func.WriteMojoGLES2ImplHeader(file)
- code = """
- private:
- MGLContext context_;
-};
-
-} // namespace mojo
- """
- file.Write(code);
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
-
- def WriteMojoGLES2Impl(self, filename):
- """Writes the Mojo GLES2 implementation."""
- file = CWriter(filename)
- file.Write(_LICENSE)
- file.Write(_DO_NOT_EDIT_WARNING)
-
- code = """
-#include "mojo/gpu/mojo_gles2_impl_autogen.h"
-
-#include <MGL/mgl.h>
-#include <MGL/mgl_onscreen.h>
-
-#ifndef GL_GLEXT_PROTOTYPES
-#define GL_GLEXT_PROTOTYPES
-#endif
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-#include <GLES2/gl2extmojo.h>
-
-#include "base/logging.h"
-
-namespace mojo {
-
- """
- file.Write(code);
- for func in self.original_functions:
- func.WriteMojoGLES2Impl(file)
- code = """
-
-} // namespace mojo
- """
- file.Write(code);
- file.Close()
- self.generated_cpp_filenames.append(file.filename)
-
def WriteGLES2InterfaceStub(self, filename):
"""Writes the GLES2 interface stub header."""
file = CHeaderWriter(
@@ -10736,11 +10628,6 @@ def main(argv):
gen.WriteMojoGLThunksImpl(
mojo_gles2_thunks_prefix + extension.lower() + "_thunks.c", extension)
- gen.WriteMojoGLES2ImplHeader(
- "mojo/gpu/mojo_gles2_impl_autogen.h")
- gen.WriteMojoGLES2Impl(
- "mojo/gpu/mojo_gles2_impl_autogen.cc")
-
Format(gen.generated_cpp_filenames)
if gen.errors > 0:
« no previous file with comments | « no previous file | gpu/skia_bindings/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698