| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/base/win/dpi_setup.h" | 5 #include "ui/base/win/dpi_setup.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "ui/base/layout.h" | 8 #include "ui/base/layout.h" |
| 9 #include "ui/gfx/display.h" | 9 #include "ui/gfx/display.h" |
| 10 #include "ui/gfx/win/dpi.h" | 10 #include "ui/gfx/win/dpi.h" |
| 11 | 11 |
| 12 namespace ui { | 12 namespace ui { |
| 13 namespace win { | 13 namespace win { |
| 14 | 14 |
| 15 void InitDeviceScaleFactor() { | 15 void InitDeviceScaleFactor() { |
| 16 gfx::InitDeviceScaleFactor(gfx::GetDPIScale()); | 16 // Don't initialize the device scale factor if it has already been |
| 17 // initialized. |
| 18 if (!gfx::win::GetDeviceScaleFactor()) |
| 19 gfx::InitDeviceScaleFactor(gfx::GetDPIScale()); |
| 17 } | 20 } |
| 18 | 21 |
| 19 } // namespace win | 22 } // namespace win |
| 20 } // namespace ui | 23 } // namespace ui |
| OLD | NEW |