Chromium Code Reviews| Index: ui/snapshot/snapshot_android.cc |
| diff --git a/ui/snapshot/snapshot_android.cc b/ui/snapshot/snapshot_android.cc |
| index 433d0f7f439f13721e3bfacaae454c47c2a411e5..8af02e299ed42572d964f9bbe268fdb91a8dcd8d 100644 |
| --- a/ui/snapshot/snapshot_android.cc |
| +++ b/ui/snapshot/snapshot_android.cc |
| @@ -39,9 +39,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() |
|
jdduke (slow)
2015/07/15 16:03:07
Why not use GetDisplayNearestWindow which should d
gsennton
2015/07/15 19:26:21
GetDisplayNearestWindow takes a NativeView (contra
|
| + : window->GetDeviceDisplayInfo().GetDIPScale(); |
| + |
| gfx::Rect source_rect_in_pixel = |
| gfx::ToEnclosingRect(gfx::ScaleRect(source_rect, device_scale_factor)); |