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

Unified Diff: cc/output/gl_renderer.cc

Issue 17335011: cc: Allow output readback/copy requests to specify a sub-rect to copy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: copy-subrect: 3 patches in one Created 7 years, 6 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
« no previous file with comments | « cc/output/copy_output_request.cc ('k') | cc/output/software_renderer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/gl_renderer.cc
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index 2a27ff7810416861d3d38af9db571d95038265bf..3527ed1138a215662797decb54b99b96b4d36320 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -1914,8 +1914,13 @@ void GLRenderer::EnsureScissorTestDisabled() {
void GLRenderer::CopyCurrentRenderPassToBitmap(
DrawingFrame* frame,
scoped_ptr<CopyOutputRequest> request) {
- GetFramebufferPixelsAsync(frame->current_render_pass->output_rect,
- request.Pass());
+ gfx::Rect copy_rect = frame->current_render_pass->output_rect;
+ if (request->has_area()) {
+ // Intersect with the request's area, positioned with its origin at the
+ // origin of the full copy_rect.
+ copy_rect.Intersect(request->area() - copy_rect.OffsetFromOrigin());
+ }
+ GetFramebufferPixelsAsync(copy_rect, request.Pass());
}
void GLRenderer::ToGLMatrix(float* gl_matrix, const gfx::Transform& transform) {
« no previous file with comments | « cc/output/copy_output_request.cc ('k') | cc/output/software_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698