diff options
author | epenner@chromium.org <epenner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-08 20:33:57 +0000 |
---|---|---|
committer | epenner@chromium.org <epenner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-08 20:33:57 +0000 |
commit | 75c43f25a0c667a119f531d6e9362049d300139f (patch) | |
tree | 3ae2f9d9b5d9831432856f8be96a91ce8289b6e7 /gpu/command_buffer/service/gl_context_virtual.cc | |
parent | b5a8a77686b6a725495bb82fceaa152b6e045205 (diff) | |
download | chromium_src-75c43f25a0c667a119f531d6e9362049d300139f.zip chromium_src-75c43f25a0c667a119f531d6e9362049d300139f.tar.gz chromium_src-75c43f25a0c667a119f531d6e9362049d300139f.tar.bz2 |
gpu: Remove redundant MakeCurrent in GLContextVirtual::MakeCurrent
Previously I misunderstood why we check if the decoder_ exists.
Only if it exists can we restore the state. If the decoder
doesn't exist and the context is already current,
we can just do nothing.
BUG=179250, 229643, 230896
Review URL: https://chromiumcodereview.appspot.com/14611013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198983 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/service/gl_context_virtual.cc')
-rw-r--r-- | gpu/command_buffer/service/gl_context_virtual.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gpu/command_buffer/service/gl_context_virtual.cc b/gpu/command_buffer/service/gl_context_virtual.cc index d0602b2..793bfa6 100644 --- a/gpu/command_buffer/service/gl_context_virtual.cc +++ b/gpu/command_buffer/service/gl_context_virtual.cc @@ -52,9 +52,12 @@ void GLContextVirtual::Destroy() { } bool GLContextVirtual::MakeCurrent(gfx::GLSurface* surface) { + // If we have the decoder, we should restore state in + // MakeVirtuallyCurrent(). Otherwise just make the + // context/surface current (if needed). if (decoder_.get() && decoder_->initialized()) shared_context_->MakeVirtuallyCurrent(this, surface); - else + else if (!IsCurrent(surface)) shared_context_->MakeCurrent(surface); return true; } |