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

Unified Diff: mojo/public/bindings/gles2_client/gles2_client_impl.cc

Issue 99323005: [Mojo] Fix race condition in sample_app's SwapBuffers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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/public/bindings/gles2_client/gles2_client_impl.h ('k') | mojo/services/gles2/gles2.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/bindings/gles2_client/gles2_client_impl.cc
diff --git a/mojo/public/bindings/gles2_client/gles2_client_impl.cc b/mojo/public/bindings/gles2_client/gles2_client_impl.cc
index 1985fea59f483ab984689a8c51148083578573cd..2fea93ce6772d0caea04b9d7a7876063bda3a3e9 100644
--- a/mojo/public/bindings/gles2_client/gles2_client_impl.cc
+++ b/mojo/public/bindings/gles2_client/gles2_client_impl.cc
@@ -19,10 +19,10 @@ GLES2Delegate::~GLES2Delegate() {
}
void GLES2Delegate::DidCreateContext(
- GLES2* gl, uint32_t width, uint32_t height) {
+ GLES2ClientImpl* gl, uint32_t width, uint32_t height) {
}
-void GLES2Delegate::ContextLost(GLES2* gl) {
+void GLES2Delegate::ContextLost(GLES2ClientImpl* gl) {
}
GLES2ClientImpl::GLES2ClientImpl(GLES2Delegate* delegate,
@@ -34,6 +34,7 @@ GLES2ClientImpl::GLES2ClientImpl(GLES2Delegate* delegate,
}
GLES2ClientImpl::~GLES2ClientImpl() {
+ gl_->Destroy();
}
void GLES2ClientImpl::Initialize() {
@@ -48,6 +49,10 @@ void GLES2ClientImpl::Terminate() {
g_gles2_initialized = false;
}
+void GLES2ClientImpl::SwapBuffers() {
+ gles2::GetGLContext()->SwapBuffers();
+}
+
void GLES2ClientImpl::DidCreateContext(
uint64_t encoded, uint32_t width, uint32_t height) {
// Ack, Hans! It's the giant hack.
@@ -60,11 +65,11 @@ void GLES2ClientImpl::DidCreateContext(
static_cast<uintptr_t>(encoded));
gles2::SetGLContext(gl_interface);
- delegate_->DidCreateContext(gl(), width, height);
+ delegate_->DidCreateContext(this, width, height);
}
void GLES2ClientImpl::ContextLost() {
- delegate_->ContextLost(gl());
+ delegate_->ContextLost(this);
}
} // mojo
« no previous file with comments | « mojo/public/bindings/gles2_client/gles2_client_impl.h ('k') | mojo/services/gles2/gles2.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698