Chromium Code Reviews| Index: ui/gfx/display.cc |
| diff --git a/ui/gfx/display.cc b/ui/gfx/display.cc |
| index e647f650603ff777e9a2c46931e5e11c7d3c645a..d47f8deffca2dbe3782c81d226ced61e0d112389 100644 |
| --- a/ui/gfx/display.cc |
| +++ b/ui/gfx/display.cc |
| @@ -83,8 +83,15 @@ void Display::SetScaleAndBounds( |
| float device_scale_factor, |
| const gfx::Rect& bounds_in_pixel) { |
| Insets insets = bounds_.InsetsFrom(work_area_); |
| - if (!HasForceDeviceScaleFactor()) |
| + if (!HasForceDeviceScaleFactor()) { |
| +#if defined(OS_CHROMEOS) || defined(OS_MACOSX) |
| + // Unless an explicit scale factor was provided for testing, ensure the |
| + // scale is integral. |
| + device_scale_factor = static_cast<int>(device_scale_factor); |
| +#endif |
| device_scale_factor_ = device_scale_factor; |
| + } |
| + device_scale_factor_ = std::max(1.0f, device_scale_factor_); |
|
oshima
2012/11/06 18:40:35
This will break --force-device-scale-factor option
Sami
2012/11/06 18:52:56
Did you mean you want to test with scale factors t
|
| #if defined(USE_AURA) |
| bounds_in_pixel_ = bounds_in_pixel; |
| #endif |