Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(467)

Unified Diff: content/renderer/gpu/webgraphicscontext3d_command_buffer_impl.cc

Issue 7669002: Introduction of parameter to readBackFramebuffer set of APIs to allow reading from the currently ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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(

Powered by Google App Engine
This is Rietveld 408576698