Chromium Code Reviews| Index: content/renderer/render_widget.cc |
| diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc |
| index 3449f3e569f3d305794f969353f32413c74d7a0b..200a9950499829e26b8065e828a3b0ffacf97f85 100644 |
| --- a/content/renderer/render_widget.cc |
| +++ b/content/renderer/render_widget.cc |
| @@ -33,6 +33,7 @@ |
| #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" |
| #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
| #include "third_party/skia/include/core/SkShader.h" |
| +#include "ui/base/ui_base_switches.h" |
| #include "ui/gfx/point.h" |
| #include "ui/gfx/size.h" |
| #include "ui/gfx/skia_util.h" |
| @@ -70,7 +71,7 @@ using WebKit::WebVector; |
| using WebKit::WebWidget; |
| using content::RenderThread; |
| -static const int kStandardDPI = 160; |
| +static const float kStandardDPI = 160; |
| RenderWidget::RenderWidget(WebKit::WebPopupType popup_type, |
| const WebKit::WebScreenInfo& screen_info, |
| @@ -113,7 +114,11 @@ RenderWidget::RenderWidget(WebKit::WebPopupType popup_type, |
| has_disable_gpu_vsync_switch_ = CommandLine::ForCurrentProcess()->HasSwitch( |
| switches::kDisableGpuVsync); |
| #if defined(OS_CHROMEOS) || defined(OS_MACOSX) |
| - device_scale_factor_ = std::max(1, screen_info.verticalDPI / kStandardDPI); |
| + device_scale_factor_ = screen_info.verticalDPI / kStandardDPI; |
| + if (!CommandLine::ForCurrentProcess()->HasSwitch( |
|
Avi (use Gerrit)
2012/06/19 03:33:57
I think a comment is worthwhile here. Something li
|
| + switches::kForceDeviceScaleFactor)) |
| + device_scale_factor_ = static_cast<int>(device_scale_factor_); |
| + device_scale_factor_ = std::max(1.0f, device_scale_factor_); |
| #endif |
| } |