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

Unified Diff: ui/snapshot/snapshot_android.cc

Issue 1409833004: Add DeviceDisplayInfo getter in WindowAndroid. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix failing bot, revert RWHVA changes, add NOTIMPLEMENTED to some functions in screen_android Created 4 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
« no previous file with comments | « ui/gfx/screen_android.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/snapshot/snapshot_android.cc
diff --git a/ui/snapshot/snapshot_android.cc b/ui/snapshot/snapshot_android.cc
index fb7d40d47a6d1c22c71e6abbda1cdb0fe0e969ee..33e5a027347dd7949ab1a0e0b2aeddfd06a92b51 100644
--- a/ui/snapshot/snapshot_android.cc
+++ b/ui/snapshot/snapshot_android.cc
@@ -12,6 +12,7 @@
#include "ui/android/view_android.h"
#include "ui/android/window_android.h"
#include "ui/android/window_android_compositor.h"
+#include "ui/gfx/android/device_display_info.h"
#include "ui/gfx/display.h"
#include "ui/gfx/geometry/point_conversions.h"
#include "ui/gfx/geometry/rect_conversions.h"
@@ -41,8 +42,11 @@ static void MakeAsyncCopyRequest(
scoped_ptr<cc::CopyOutputRequest> request =
cc::CopyOutputRequest::CreateBitmapRequest(callback);
- const gfx::Display& display = gfx::Screen::GetScreen()->GetPrimaryDisplay();
- float device_scale_factor = display.device_scale_factor();
+ float device_scale_factor =
+ gfx::Display::HasForceDeviceScaleFactor()
+ ? gfx::Display::GetForcedDeviceScaleFactor()
+ : window->GetDeviceDisplayInfo().GetDIPScale();
+
gfx::Rect source_rect_in_pixel =
gfx::ScaleToEnclosingRect(source_rect, device_scale_factor);
« no previous file with comments | « ui/gfx/screen_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698