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

Unified Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 15925007: Virtual context MakeCurrent tweaks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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
Index: content/common/gpu/gpu_command_buffer_stub.cc
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index 1e89262cf69d59725c83f582b379bdcc09af2c94..d6e245dc6cb761ff8ebe326c7ac81b4024b51627 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -360,23 +360,16 @@ void GpuCommandBufferStub::Destroy() {
destruction_observers_,
OnWillDestroyStub());
- scoped_refptr<gfx::GLContext> context;
if (decoder_) {
- context = decoder_->GetGLContext();
+ // The surface destructor should be called with a current context.
+ // Therefore release the stub's reference before destroying the decoder,
+ // because the latter will release the context.
+ surface_ = NULL;
epenner 2013/05/28 22:57:21 Are you sure this is the last valid reference to t
no sievers 2013/05/28 23:15:32 Ah good point, I forgot to release the decoder's r
decoder_->Destroy(have_context);
decoder_.reset();
}
command_buffer_.reset();
-
- // Make sure that context_ is current while we destroy surface_, because
- // surface_ may have GL resources that it needs to destroy, and will need
- // context_ to be current in order to not leak these resources.
- if (context)
- context->MakeCurrent(surface_.get());
- surface_ = NULL;
- if (context)
- context->ReleaseCurrent(NULL);
}
void GpuCommandBufferStub::OnInitializeFailed(IPC::Message* reply_message) {
« no previous file with comments | « no previous file | gpu/command_buffer/service/gl_context_virtual.cc » ('j') | gpu/command_buffer/service/gl_context_virtual.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698