summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-09 23:08:56 +0000
committerkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-09 23:08:56 +0000
commitc777de5b0773fad970c88b748c237120e5d6d563 (patch)
tree9eac25d954ce3d7b8ac39b2de428546d3350da94 /gpu
parentc257d0561bfaf52c37fcbc3cc2f9b457836b8db5 (diff)
downloadchromium_src-c777de5b0773fad970c88b748c237120e5d6d563.zip
chromium_src-c777de5b0773fad970c88b748c237120e5d6d563.tar.gz
chromium_src-c777de5b0773fad970c88b748c237120e5d6d563.tar.bz2
Keep track of the current per-thread context and surface. Add
ScopedMakeCurrent to make it easier to briefly make another context current. Use it in AcceleratedSurface implementation and verify in the caller that it is working. This infrastructure would have made it possible to catch http://crbug.com/95492 and similar bugs where the wrong context was current. BUG=95962 TEST=ran CSS 3D example poster-circle; no assertion failures Review URL: http://codereview.chromium.org/7787022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100528 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 10e2a44..eef54c3 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -2555,13 +2555,9 @@ error::Error GLES2DecoderImpl::HandleResizeCHROMIUM(
if (resize_callback_.get()) {
resize_callback_->Run(gfx::Size(width, height));
-#if defined(OS_MACOSX)
- // On OSX, the resize callback clobbers the currently-active GL context.
- // TODO(kbr): remove this MakeCurrent once the AcceleratedSurface code
- // becomes able to restore its context.
- if (!context_->MakeCurrent(surface_.get()))
+ DCHECK(context_->IsCurrent(surface_.get()));
+ if (!context_->IsCurrent(surface_.get()))
return error::kLostContext;
-#endif
}
return error::kNoError;