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

Unified Diff: gpu/command_buffer/service/gl_context_virtual.cc

Issue 15841002: gpu: Fix corrupted state due to virtual MakeCurrent race. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 7 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 | « no previous file | ui/gl/gl_gl_api_implementation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/gl_context_virtual.cc
diff --git a/gpu/command_buffer/service/gl_context_virtual.cc b/gpu/command_buffer/service/gl_context_virtual.cc
index d142e01fb13a567d945674d6a5980d97636d8c54..6a3dabe560f9edbd7ecc0dd2dc94fa7ce9b7ebc2 100644
--- a/gpu/command_buffer/service/gl_context_virtual.cc
+++ b/gpu/command_buffer/service/gl_context_virtual.cc
@@ -55,8 +55,15 @@ void GLContextVirtual::Destroy() {
bool GLContextVirtual::MakeCurrent(gfx::GLSurface* surface) {
if (decoder_.get() && decoder_->initialized())
greggman 2013/05/24 00:56:47 nit: if there's braces on one if clause there shou
shared_context_->MakeVirtuallyCurrent(this, surface);
- else
- shared_context_->MakeCurrent(surface);
+ else {
+ // We can't restore our state yet, so unset the current virtual context,
+ // so that the next context (if it isn't this) will still know to restore.
+ shared_context_->MakeVirtuallyCurrent(NULL, NULL);
no sievers 2013/05/23 15:58:36 Hmm I don't understand how current_context_ in the
no sievers 2013/05/23 16:04:43 Actually I don't understand the comment either. We
no sievers 2013/05/23 17:04:34 Ok I think I get it now after reading your log fro
epenner 2013/05/23 18:00:03 If it was added for cleanup calls, those clean up
+
+ // But still make the real context current, if needed.
+ if (!IsCurrent(surface))
+ shared_context_->MakeCurrent(surface);
+ }
return true;
}
« no previous file with comments | « no previous file | ui/gl/gl_gl_api_implementation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698