Chromium Code Reviews| Index: ui/base/resource/resource_bundle.cc |
| diff --git a/ui/base/resource/resource_bundle.cc b/ui/base/resource/resource_bundle.cc |
| index 37f6c773a43ebe489772aad7f3a4b9ed16fc1a54..e4e06590c369f291640f0bf86461626dbb7787bc 100644 |
| --- a/ui/base/resource/resource_bundle.cc |
| +++ b/ui/base/resource/resource_bundle.cc |
| @@ -29,6 +29,7 @@ |
| #include "ui/base/ui_base_switches.h" |
| #include "ui/gfx/codec/jpeg_codec.h" |
| #include "ui/gfx/codec/png_codec.h" |
| +#include "ui/gfx/dpi.h" |
| #include "ui/gfx/image/image_skia.h" |
| #include "ui/gfx/image/image_skia_source.h" |
| #include "ui/gfx/safe_integer_conversions.h" |
| @@ -45,11 +46,6 @@ |
| #include "ui/gfx/platform_font_pango.h" |
| #endif |
| -#if defined(OS_WIN) |
| -#include "ui/base/win/dpi_setup.h" |
| -#include "ui/gfx/win/dpi.h" |
| -#endif |
| - |
| #if defined(OS_MACOSX) && !defined(OS_IOS) |
| #include "base/mac/mac_util.h" |
| #endif |
| @@ -623,7 +619,12 @@ void ResourceBundle::InitSharedInstance(Delegate* delegate) { |
| #elif defined(OS_CHROMEOS) |
| // TODO(oshima): Include 200P only if the device support 200P |
| supported_scale_factors.push_back(SCALE_FACTOR_200P); |
| -#elif defined(OS_LINUX) && defined(ENABLE_HIDPI) |
| +#elif defined(OS_LINUX) |
| + supported_scale_factors.push_back(SCALE_FACTOR_125P); |
|
ananta
2014/10/17 00:49:06
Why do we need to push the fractional scale factor
scottmg
2014/10/17 23:18:41
Done.
|
| + supported_scale_factors.push_back(SCALE_FACTOR_133P); |
| + supported_scale_factors.push_back(SCALE_FACTOR_140P); |
| + supported_scale_factors.push_back(SCALE_FACTOR_150P); |
| + supported_scale_factors.push_back(SCALE_FACTOR_180P); |
| supported_scale_factors.push_back(SCALE_FACTOR_200P); |
| #elif defined(OS_WIN) |
| bool default_to_100P = true; |
| @@ -640,13 +641,13 @@ void ResourceBundle::InitSharedInstance(Delegate* delegate) { |
| supported_scale_factors.push_back(SCALE_FACTOR_100P); |
| #endif |
| ui::SetSupportedScaleFactors(supported_scale_factors); |
| -#if defined(OS_WIN) |
| +#if defined(OS_WIN) || defined(OS_LINUX) |
| // Must be called _after_ supported scale factors are set since it |
| // uses them. |
| // Don't initialize the device scale factor if it has already been |
| // initialized. |
| - if (!gfx::win::IsDeviceScaleFactorSet()) |
| - ui::win::InitDeviceScaleFactor(); |
| + if (!gfx::IsDeviceScaleFactorSet()) |
| + gfx::InitDeviceScaleFactor(gfx::GetDPIScale()); |
| #endif |
| } |