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/base/layout.h" | 5 #include "ui/base/layout.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <limits> | 9 #include <limits> |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "base/win/metro.h" | 22 #include "base/win/metro.h" |
23 #include "ui/gfx/win/dpi.h" | 23 #include "ui/gfx/win/dpi.h" |
24 #include <Windows.h> | 24 #include <Windows.h> |
25 #endif // defined(OS_WIN) | 25 #endif // defined(OS_WIN) |
26 | 26 |
27 namespace ui { | 27 namespace ui { |
28 | 28 |
29 namespace { | 29 namespace { |
30 | 30 |
31 bool ScaleFactorComparator(const ScaleFactor& lhs, const ScaleFactor& rhs){ | 31 bool ScaleFactorComparator(const ScaleFactor& lhs, const ScaleFactor& rhs){ |
32 return GetImageScale(lhs) < GetImageScale(rhs); | 32 return GetScaleForScaleFactor(lhs) < GetScaleForScaleFactor(rhs); |
33 } | 33 } |
34 | 34 |
35 std::vector<ScaleFactor>* g_supported_scale_factors = NULL; | 35 std::vector<ScaleFactor>* g_supported_scale_factors = NULL; |
36 | 36 |
37 const float kScaleFactorScales[] = {1.0f, 1.0f, 1.25f, 1.33f, 1.4f, 1.5f, 1.8f, | 37 const float kScaleFactorScales[] = {1.0f, 1.0f, 1.25f, 1.33f, 1.4f, 1.5f, 1.8f, |
38 2.0f, 3.0f}; | 38 2.0f, 3.0f}; |
39 COMPILE_ASSERT(NUM_SCALE_FACTORS == arraysize(kScaleFactorScales), | 39 COMPILE_ASSERT(NUM_SCALE_FACTORS == arraysize(kScaleFactorScales), |
40 kScaleFactorScales_incorrect_size); | 40 kScaleFactorScales_incorrect_size); |
41 | 41 |
42 } // namespace | 42 } // namespace |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 gfx::Screen* screen = gfx::Screen::GetScreenFor(view); | 124 gfx::Screen* screen = gfx::Screen::GetScreenFor(view); |
125 if (screen->IsDIPEnabled()) { | 125 if (screen->IsDIPEnabled()) { |
126 gfx::Display display = screen->GetDisplayNearestWindow(view); | 126 gfx::Display display = screen->GetDisplayNearestWindow(view); |
127 return display.device_scale_factor(); | 127 return display.device_scale_factor(); |
128 } | 128 } |
129 return 1.0f; | 129 return 1.0f; |
130 } | 130 } |
131 #endif // !defined(OS_MACOSX) | 131 #endif // !defined(OS_MACOSX) |
132 | 132 |
133 } // namespace ui | 133 } // namespace ui |
OLD | NEW |