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

Unified Diff: ui/snapshot/snapshot_android.cc

Issue 2249243002: Remove dip scale dependency from ui::WindowAndroid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase only Created 4 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: ui/snapshot/snapshot_android.cc
diff --git a/ui/snapshot/snapshot_android.cc b/ui/snapshot/snapshot_android.cc
index e56ab7399f61f9981393bbdf91306a7ee7bfda1d..e16cdd734e6a25100144434d1451cef58f33d5c6 100644
--- a/ui/snapshot/snapshot_android.cc
+++ b/ui/snapshot/snapshot_android.cc
@@ -49,10 +49,12 @@ static void MakeAsyncCopyRequest(
gfx::ScaleToEnclosingRect(source_rect, device_scale_factor);
// Account for the toolbar offset.
- gfx::Vector2dF offset = window->content_offset();
- gfx::Rect adjusted_source_rect(gfx::ToRoundedPoint(
- gfx::PointF(source_rect_in_pixel.x() + offset.x(),
- source_rect_in_pixel.y() + offset.y())),
+ gfx::Vector2dF offset_in_pixel =
+ gfx::ScaleVector2d(window->content_offset(), device_scale_factor);
+ gfx::Rect adjusted_source_rect(
+ gfx::ToRoundedPoint(
+ gfx::PointF(source_rect_in_pixel.x() + offset_in_pixel.x(),
+ source_rect_in_pixel.y() + offset_in_pixel.y())),
source_rect_in_pixel.size());
request->set_area(adjusted_source_rect);
« content/browser/android/content_view_core_impl.cc ('K') | « ui/android/window_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698