OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/gfx/win/dpi.h" | 5 #include "ui/gfx/win/dpi.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include "base/win/scoped_hdc.h" | 8 #include "base/win/scoped_hdc.h" |
9 #include "ui/gfx/display.h" | 9 #include "ui/gfx/display.h" |
10 #include "ui/gfx/point_conversions.h" | 10 #include "ui/gfx/geometry/point_conversions.h" |
11 #include "ui/gfx/rect_conversions.h" | 11 #include "ui/gfx/rect_conversions.h" |
12 #include "ui/gfx/size_conversions.h" | 12 #include "ui/gfx/size_conversions.h" |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 int kDefaultDPIX = 96; | 16 int kDefaultDPIX = 96; |
17 int kDefaultDPIY = 96; | 17 int kDefaultDPIY = 96; |
18 | 18 |
19 bool force_highdpi_for_testing = false; | 19 bool force_highdpi_for_testing = false; |
20 | 20 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // Always ceil sizes. Otherwise we may be leaving off part of the bounds. | 102 // Always ceil sizes. Otherwise we may be leaving off part of the bounds. |
103 return ToCeiledSize(ScaleSize(dip_size, GetDPIScale())); | 103 return ToCeiledSize(ScaleSize(dip_size, GetDPIScale())); |
104 } | 104 } |
105 | 105 |
106 int GetSystemMetricsInDIP(int metric) { | 106 int GetSystemMetricsInDIP(int metric) { |
107 return static_cast<int>(GetSystemMetrics(metric) / GetDPIScale() + 0.5); | 107 return static_cast<int>(GetSystemMetrics(metric) / GetDPIScale() + 0.5); |
108 } | 108 } |
109 | 109 |
110 } // namespace win | 110 } // namespace win |
111 } // namespace gfx | 111 } // namespace gfx |
OLD | NEW |