| Index: ui/base/layout.cc
|
| diff --git a/ui/base/layout.cc b/ui/base/layout.cc
|
| index 2c1fb51a3952706e1f6d77a0b2f29a46c2508124..01c38f1d5414cc431705df7021de457b2b774113 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(kScaleFactorScales[*it]);
|
| }
|
| gfx::ImageSkia::SetSupportedScales(scales);
|
| }
|
| @@ -117,7 +118,11 @@ ScaleFactor GetSupportedScaleFactor(float scale) {
|
| }
|
|
|
| float GetImageScale(ScaleFactor scale_factor) {
|
| - return kScaleFactorScales[scale_factor];
|
| +#if defined(OS_WIN)
|
| + if (gfx::IsHighDPIEnabled())
|
| + return gfx::win::GetDeviceScaleFactor();
|
| +#endif
|
| + return GetScaleForScaleFactor(scale_factor);
|
| }
|
|
|
| bool IsScaleFactorSupported(ScaleFactor scale_factor) {
|
| @@ -144,6 +149,10 @@ ScaleFactor FindClosestScaleFactorUnsafe(float scale) {
|
| return closest_match;
|
| }
|
|
|
| +float GetScaleForScaleFactor(ScaleFactor scale_factor) {
|
| + return kScaleFactorScales[scale_factor];
|
| +}
|
| +
|
| namespace test {
|
|
|
| ScopedSetSupportedScaleFactors::ScopedSetSupportedScaleFactors(
|
|
|