Chromium Code Reviews| Index: ui/base/layout.cc |
| diff --git a/ui/base/layout.cc b/ui/base/layout.cc |
| index 2c1fb51a3952706e1f6d77a0b2f29a46c2508124..10a0421f2d5f509a4b0e28cbf0e274e86cafdf01 100644 |
| --- a/ui/base/layout.cc |
| +++ b/ui/base/layout.cc |
| @@ -20,6 +20,7 @@ |
| #if defined(OS_WIN) |
| #include "base/win/metro.h" |
| +#include "ui/gfx/win/dpi.h" |
| #include <Windows.h> |
| #endif // defined(OS_WIN) |
| @@ -90,7 +91,7 @@ void SetSupportedScaleFactors( |
| for (std::vector<ScaleFactor>::const_iterator it = |
| g_supported_scale_factors->begin(); |
| it != g_supported_scale_factors->end(); ++it) { |
| - scales.push_back(GetImageScale(*it)); |
| + scales.push_back(GetImageScaleForScaleFactor(*it)); |
| } |
| gfx::ImageSkia::SetSupportedScales(scales); |
| } |
| @@ -116,10 +117,18 @@ ScaleFactor GetSupportedScaleFactor(float scale) { |
| return closest_match; |
| } |
| -float GetImageScale(ScaleFactor scale_factor) { |
| +float GetImageScaleForScaleFactor(ScaleFactor scale_factor) { |
| return kScaleFactorScales[scale_factor]; |
|
sky
2014/03/26 20:43:27
Is it possible to make this private too? It's conf
ananta
2014/03/26 21:49:27
As per our discussion, moved the kScaleFactorScale
|
| } |
| +float GetImageScale(ScaleFactor scale_factor) { |
| +#if defined(OS_WIN) |
| + if (gfx::IsHighDPIEnabled()) |
| + return gfx::win::GetDeviceScaleFactor(); |
| +#endif |
| + return GetImageScaleForScaleFactor(scale_factor); |
| +} |
| + |
| bool IsScaleFactorSupported(ScaleFactor scale_factor) { |
| DCHECK(g_supported_scale_factors != NULL); |
| return std::find(g_supported_scale_factors->begin(), |