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

Unified Diff: mojo/cc/context_provider_mojo.cc

Issue 993253003: Modify build_gles2_cmd_buffer.py to generate a class that implements gpu::GLES2Interace and for eac… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
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_);
}

Powered by Google App Engine
This is Rietveld 408576698