Index: ui/gfx/display.cc |
diff --git a/ui/gfx/display.cc b/ui/gfx/display.cc |
index ef3f250a483d113770958e5003f37b2d1507044b..5b375891ad0fa271aae4cc990c0f116a724eabc7 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_MACOSX) |
sky
2012/11/15 17:23:52
Shouldn't this be done at the call site and not he
|
+ // 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_); |
#if defined(USE_AURA) |
bounds_in_pixel_ = bounds_in_pixel; |
#endif |