diff options
Diffstat (limited to 'gpu/command_buffer/service/gl_context_virtual.cc')
-rw-r--r-- | gpu/command_buffer/service/gl_context_virtual.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gpu/command_buffer/service/gl_context_virtual.cc b/gpu/command_buffer/service/gl_context_virtual.cc index e7a4c04..dd32495 100644 --- a/gpu/command_buffer/service/gl_context_virtual.cc +++ b/gpu/command_buffer/service/gl_context_virtual.cc @@ -54,11 +54,14 @@ void GLContextVirtual::Destroy() { } bool GLContextVirtual::MakeCurrent(gfx::GLSurface* surface) { + // TODO(epenner): We should avoid bypassing MakeVirtuallyCurrent() below + // (return false or DCHECK when !decoder). To do this we must reorder + // tear-down in GpuCommandBufferStub::Destroy(). if (decoder_.get()) - return shared_context_->MakeVirtuallyCurrent(this, surface); - - LOG(ERROR) << "Trying to make virtual context current without decoder."; - return false; + shared_context_->MakeVirtuallyCurrent(this, surface); + else if (!IsCurrent(surface)) + shared_context_->MakeCurrent(surface); + return true; } void GLContextVirtual::ReleaseCurrent(gfx::GLSurface* surface) { |