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

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
« no previous file with comments | « mojo/cc/context_provider_mojo.h ('k') | mojo/gpu/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..aed1712e80a3f22d90e3990af8946306798dc6db 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 {
@@ -21,14 +22,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 +56,7 @@ bool ContextProviderMojo::IsContextLost() {
bool ContextProviderMojo::DestroyedOnMainThread() { return !context_; }
ContextProviderMojo::~ContextProviderMojo() {
+ context_gl_.reset();
if (context_)
MojoGLES2DestroyContext(context_);
}
« no previous file with comments | « mojo/cc/context_provider_mojo.h ('k') | mojo/gpu/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698