Chromium Code Reviews| 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; |
| } |