| Index: mojo/cc/context_provider_mojo.cc
|
| diff --git a/mojo/cc/context_provider_mojo.cc b/mojo/cc/context_provider_mojo.cc
|
| index 02a5c6cd0d184168a1ec32d87852a4eda26db050..92939073c62cd6448295d362c1ae371e066f98ae 100644
|
| --- a/mojo/cc/context_provider_mojo.cc
|
| +++ b/mojo/cc/context_provider_mojo.cc
|
| @@ -5,6 +5,7 @@
|
| #include "mojo/cc/context_provider_mojo.h"
|
|
|
| #include "base/logging.h"
|
| +#include "gpu/command_buffer/client/mojo_gles2_impl_autogen.h"
|
| #include "third_party/mojo/src/mojo/public/cpp/environment/environment.h"
|
|
|
| namespace mojo {
|
| @@ -12,6 +13,7 @@ namespace mojo {
|
| ContextProviderMojo::ContextProviderMojo(
|
| ScopedMessagePipeHandle command_buffer_handle)
|
| : command_buffer_handle_(command_buffer_handle.Pass()),
|
| + context_gl_(nullptr),
|
| context_lost_(false) {
|
| }
|
|
|
| @@ -21,14 +23,12 @@ bool ContextProviderMojo::BindToCurrentThread() {
|
| &ContextLostThunk,
|
| this,
|
| Environment::GetDefaultAsyncWaiter());
|
| + context_gl_.reset(new MojoGLES2Impl(context_));
|
| return !!context_;
|
| }
|
|
|
| gpu::gles2::GLES2Interface* ContextProviderMojo::ContextGL() {
|
| - if (!context_)
|
| - return NULL;
|
| - return static_cast<gpu::gles2::GLES2Interface*>(
|
| - MojoGLES2GetGLES2Interface(context_));
|
| + return context_gl_.get();
|
| }
|
|
|
| gpu::ContextSupport* ContextProviderMojo::ContextSupport() {
|
| @@ -57,6 +57,7 @@ bool ContextProviderMojo::IsContextLost() {
|
| bool ContextProviderMojo::DestroyedOnMainThread() { return !context_; }
|
|
|
| ContextProviderMojo::~ContextProviderMojo() {
|
| + context_gl_.reset();
|
| if (context_)
|
| MojoGLES2DestroyContext(context_);
|
| }
|
|
|