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

Unified Diff: mojo/gpu/gl_context.cc

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 | « mojo/gpu/gl_context.h ('k') | mojo/gpu/mojo_context_support.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/gpu/gl_context.cc
diff --git a/mojo/gpu/gl_context.cc b/mojo/gpu/gl_context.cc
index e69ca1579d746b434aa93b674bea1877ffbdfa11..f12a32355ed9d38828286d121683e732b4188024 100644
--- a/mojo/gpu/gl_context.cc
+++ b/mojo/gpu/gl_context.cc
@@ -4,7 +4,6 @@
#include "mojo/gpu/gl_context.h"
-#include "mojo/gpu/mojo_gles2_impl_autogen.h"
#include "mojo/public/cpp/application/connect.h"
#include "mojo/public/interfaces/application/shell.mojom.h"
#include "mojo/services/gpu/interfaces/gpu.mojom.h"
@@ -19,7 +18,7 @@ GLContext::GLContext(CommandBufferPtr command_buffer) : weak_factory_(this) {
command_buffer.PassInterface().PassHandle().release().value(),
MGL_NO_CONTEXT, &ContextLostThunk, this,
Environment::GetDefaultAsyncWaiter());
- gl_impl_.reset(new MojoGLES2Impl(context_));
+ DCHECK(context_ != MGL_NO_CONTEXT);
}
GLContext::~GLContext() {
@@ -46,12 +45,12 @@ void GLContext::MakeCurrent() {
MGLMakeCurrent(context_);
}
-void GLContext::Destroy() {
- delete this;
+bool GLContext::IsCurrent() {
+ return context_ == MGLGetCurrentContext();
}
-gpu::gles2::GLES2Interface* GLContext::gl() const {
- return gl_impl_.get();
+void GLContext::Destroy() {
+ delete this;
}
void GLContext::AddObserver(Observer* observer) {
« no previous file with comments | « mojo/gpu/gl_context.h ('k') | mojo/gpu/mojo_context_support.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698