Chromium Code Reviews| Index: ui/base/win/dpi_setup.cc |
| diff --git a/ui/base/win/dpi_setup.cc b/ui/base/win/dpi_setup.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..947cde3e18175bffead55ca435259daab75dcb26 |
| --- /dev/null |
| +++ b/ui/base/win/dpi_setup.cc |
| @@ -0,0 +1,26 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "ui/base/win/dpi_setup.h" |
| + |
| +#include "ui/base/layout.h" |
| +#include "ui/gfx/display.h" |
| +#include "ui/gfx/win/dpi.h" |
| + |
| +namespace ui { |
| +namespace win { |
| + |
| +void InitDeviceScaleFactor() { |
| + float scale = 1.0f; |
| + if (gfx::IsHighDPIEnabled()) { |
| + float scale = gfx::Display::HasForceDeviceScaleFactor() ? |
| + gfx::Display::GetForcedDeviceScaleFactor() : gfx::GetDPIScale(); |
|
sky
2013/09/25 19:28:15
nit: indent 2 more.
|
| + // Quantize to nearest supported scale factor. |
| + scale = ui::GetImageScale(ui::GetSupportedScaleFactor(scale)); |
| + } |
| + gfx::InitDeviceScaleFactor(scale); |
| +} |
| + |
| +} // namespace win |
| +} // namespace ui |