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

Unified Diff: mojo/gpu/gl_context.cc

Issue 1307883004: Use C OpenGL interface in mojo::GLContext (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 4 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_gles2_impl_autogen.cc » ('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 73941d64488c8393f1f8f54f7cefd293fbcf1766..3b4830a779915afb1fd96cdf1492c5e0b180b3db 100644
--- a/mojo/gpu/gl_context.cc
+++ b/mojo/gpu/gl_context.cc
@@ -7,6 +7,7 @@
#include "mojo/public/cpp/application/connect.h"
#include "mojo/public/interfaces/application/shell.mojom.h"
#include "mojo/services/gpu/public/interfaces/gpu.mojom.h"
+#include "mojo/gpu/mojo_gles2_impl_autogen.h"
namespace mojo {
@@ -24,8 +25,7 @@ GLContext::GLContext(Shell* shell) : weak_factory_(this) {
context_ = MojoGLES2CreateContext(
command_buffer.PassInterface().PassHandle().release().value(),
&ContextLostThunk, this, Environment::GetDefaultAsyncWaiter());
- gl_ = static_cast<gpu::gles2::GLES2Interface*>(
- MojoGLES2GetGLES2Interface(context_));
+ gl_impl_.reset(new MojoGLES2Impl(context_));
}
GLContext::~GLContext() {
@@ -44,6 +44,10 @@ void GLContext::Destroy() {
delete this;
}
+gpu::gles2::GLES2Interface* GLContext::gl() const {
+ return gl_impl_.get();
viettrungluu 2015/08/24 17:51:06 It should be OK to inline this.
+}
+
void GLContext::AddObserver(Observer* observer) {
observers_.AddObserver(observer);
}
« no previous file with comments | « mojo/gpu/gl_context.h ('k') | mojo/gpu/mojo_gles2_impl_autogen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698