Chromium Code Reviews| 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); |
| } |