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/14 16:52:35
Is this necessary for android?
I most likely elimi
johnme
2012/11/14 16:56:45
There should never be any harm in using this safeg
|
#if defined(USE_AURA) |
bounds_in_pixel_ = bounds_in_pixel; |
#endif |