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

Unified Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 173023005: Adds support for capturing a sub rect of the compositing surface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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/browser/renderer_host/render_widget_host_view_android.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index 44d060a63ead8d96cda20647e83152460a04d979..a5c4bdbf5a957ca88bd96136063cf251917880d7 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -253,6 +253,7 @@ void RenderWidgetHostViewAndroid::SetBounds(const gfx::Rect& rect) {
void RenderWidgetHostViewAndroid::GetScaledContentBitmap(
float scale,
+ gfx::Rect src_subrect,
powei 2014/02/22 02:06:32 Can you add a dcheck to make sure that src_subrect
clholgat 2014/02/24 17:15:56 Done.
gfx::Size* out_size,
const base::Callback<void(bool, const SkBitmap&)>& result_callback) {
if (!IsSurfaceAvailableForCopy()) {
@@ -261,7 +262,8 @@ void RenderWidgetHostViewAndroid::GetScaledContentBitmap(
}
gfx::Size bounds = layer_->bounds();
- gfx::Rect src_subrect(bounds);
+ if (src_subrect.IsEmpty())
+ src_subrect = gfx::Rect(bounds);
const gfx::Display& display =
gfx::Screen::GetNativeScreen()->GetPrimaryDisplay();
float device_scale_factor = display.device_scale_factor();
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_android.h ('k') | content/public/browser/android/content_view_core.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698