Chromium Code Reviews| 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..cd9e968b122f0a1c9b5829d4f904d3967ee46eb2 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 "mojo/gpu/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), |
|
jamesr
2015/03/23 19:33:01
you don't need this - the default c'tor for scoped
|
| 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_); |
| } |