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

Unified Diff: content/browser/compositor/delegated_frame_host.cc

Issue 802343002: Add ability to copy unscaled output pixels. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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/browser/compositor/delegated_frame_host.cc
diff --git a/content/browser/compositor/delegated_frame_host.cc b/content/browser/compositor/delegated_frame_host.cc
index 1f9a6caa62286688017d99eb203de456317af6f5..40b30c92952d63553e172e9ee37878a25be840d3 100644
--- a/content/browser/compositor/delegated_frame_host.cc
+++ b/content/browser/compositor/delegated_frame_host.cc
@@ -180,7 +180,8 @@ void DelegatedFrameHost::CopyFromCompositingSurface(
output_size,
color_type,
callback));
- request->set_area(src_subrect);
+ if (!src_subrect.IsEmpty())
+ request->set_area(src_subrect);
client_->RequestCopyOfOutput(request.Pass());
}
@@ -564,9 +565,15 @@ void DelegatedFrameHost::CopyFromCompositingSurfaceHasResult(
return;
}
+ gfx::Size output_size_in_pixel;
+ if (dst_size_in_pixel.IsEmpty())
+ output_size_in_pixel = result->size();
+ else
+ output_size_in_pixel = dst_size_in_pixel;
+
if (result->HasTexture()) {
// GPU-accelerated path
- PrepareTextureCopyOutputResult(dst_size_in_pixel, color_type,
+ PrepareTextureCopyOutputResult(output_size_in_pixel, color_type,
callback,
result.Pass());
return;
@@ -574,7 +581,7 @@ void DelegatedFrameHost::CopyFromCompositingSurfaceHasResult(
DCHECK(result->HasBitmap());
// Software path
- PrepareBitmapCopyOutputResult(dst_size_in_pixel, color_type, callback,
+ PrepareBitmapCopyOutputResult(output_size_in_pixel, color_type, callback,
result.Pass());
}

Powered by Google App Engine
This is Rietveld 408576698