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

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: Pass display area instead of NativeWindow to GLHelperHolder. Created 5 years, 2 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
« ui/gfx/screen_android.cc ('K') | « 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 a8200be708df7f46de0ffb94bba8dba36153c850..c4616c8b84ffda83245bf9a54a11a0f83ce4a638 100644
--- a/ui/snapshot/snapshot_android.cc
+++ b/ui/snapshot/snapshot_android.cc
@@ -10,6 +10,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"
@@ -39,9 +40,11 @@ static void MakeAsyncCopyRequest(
scoped_ptr<cc::CopyOutputRequest> request =
cc::CopyOutputRequest::CreateBitmapRequest(callback);
- const gfx::Display& display =
- gfx::Screen::GetNativeScreen()->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);
« ui/gfx/screen_android.cc ('K') | « ui/gfx/screen_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698