Index: content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc |
=================================================================== |
--- content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc (revision 96380) |
+++ content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc (working copy) |
@@ -295,9 +295,10 @@ |
if (mustRestoreFBO) { |
gl_->BindFramebuffer(GL_FRAMEBUFFER, buffer); |
} |
- gl_->ReadPixels(0, 0, width, height, |
- GL_RGBA, GL_UNSIGNED_BYTE, pixels); |
+ gl_->ReadPixels(0, 0, width, height, |
+ GL_RGBA, GL_UNSIGNED_BYTE, pixels); |
+ |
// Swizzle red and blue channels |
// TODO(kbr): expose GL_BGRA as extension |
for (size_t i = 0; i < buffer_size; i += 4) { |
@@ -319,8 +320,11 @@ |
bool WebGraphicsContext3DCommandBufferImpl::readBackFramebuffer( |
unsigned char* pixels, |
- size_t buffer_size) { |
- return readBackFramebuffer(pixels, buffer_size, 0, width(), height()); |
+ size_t buffer_size, bool bindDefaultFramebuffer) { |
+ if (bindDefaultFramebuffer) |
+ return readBackFramebuffer(pixels, buffer_size, 0, width(), height()); |
+ |
+ return readBackFramebuffer(pixels, buffer_size, bound_fbo_, width(), height()); |
} |
void WebGraphicsContext3DCommandBufferImpl::synthesizeGLError( |