summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-11 18:45:48 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-11 18:45:48 +0000
commitb86b14989af0959352bf328293f15fb05af9f3f4 (patch)
treefabf3c240bea5c6e290ce7e4ea3c574db80b9483 /gpu/command_buffer
parent898c41da32b377e3abbb9e7464ab71e5f79fa1a2 (diff)
downloadchromium_src-b86b14989af0959352bf328293f15fb05af9f3f4.zip
chromium_src-b86b14989af0959352bf328293f15fb05af9f3f4.tar.gz
chromium_src-b86b14989af0959352bf328293f15fb05af9f3f4.tar.bz2
gpu: Make sure the fbo is always bound while the swap callback runs if an offscreen target is used.
This didn't happen for non-multisampled offscreen targets that didn't have a parent. BUG=58557 TEST=None Review URL: http://codereview.chromium.org/3654002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62164 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer')
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc30
1 files changed, 20 insertions, 10 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 2b60626..99a159f 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -5585,18 +5585,28 @@ error::Error GLES2DecoderImpl::HandleSwapBuffers(
swap_buffers_callback_->Run();
}
return error::kNoError;
- } else if (parent_) {
- // Copy the target frame buffer to the saved offscreen texture.
+ } else {
ScopedFrameBufferBinder binder(this,
offscreen_target_frame_buffer_->id());
- offscreen_saved_color_texture_->Copy(
- offscreen_saved_color_texture_->size());
-
- // Ensure the side effects of the copy are visible to the parent context.
- // There is no need to do this for ANGLE because it uses a single D3D
- // device for all contexts.
- if (!IsAngle())
- glFlush();
+
+ if (parent_) {
+ // Copy the target frame buffer to the saved offscreen texture.
+ offscreen_saved_color_texture_->Copy(
+ offscreen_saved_color_texture_->size());
+
+ // Ensure the side effects of the copy are visible to the parent context.
+ // There is no need to do this for ANGLE because it uses a single D3D
+ // device for all contexts.
+ if (!IsAngle())
+ glFlush();
+ }
+
+ // Run the callback with |binder| in scope, so that the callback can call
+ // ReadPixels or CopyTexImage2D.
+ if (swap_buffers_callback_.get()) {
+ swap_buffers_callback_->Run();
+ }
+ return error::kNoError;
}
} else {
if (!context_->SwapBuffers()) {