Index: ui/gfx/display.cc |
diff --git a/ui/gfx/display.cc b/ui/gfx/display.cc |
index e647f650603ff777e9a2c46931e5e11c7d3c645a..efc35c8fe51c333a25dc63cc4aa24af46260d87f 100644 |
--- a/ui/gfx/display.cc |
+++ b/ui/gfx/display.cc |
@@ -83,8 +83,17 @@ 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; |
+ } |
+#if defined(OS_CHROMEOS) || defined(OS_MACOSX) |
johnme
2012/11/06 15:45:34
We want this on Android (and all other platforms)
Sami
2012/11/06 17:08:47
Ok, I wasn't sure if this was the case so thanks f
|
+ device_scale_factor_ = std::max(1.0f, device_scale_factor_); |
+#endif |
#if defined(USE_AURA) |
bounds_in_pixel_ = bounds_in_pixel; |
#endif |