Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: ui/display/manager/chromeos/display_change_observer.cc

Issue 2745173004: Updating device scale factor thresholds (Closed)
Patch Set: Updates the device scale factor clamping intervals to Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ui/display/manager/chromeos/display_change_observer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/display/manager/chromeos/display_change_observer.h" 5 #include "ui/display/manager/chromeos/display_change_observer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 20 matching lines...) Expand all
31 namespace { 31 namespace {
32 32
33 // The DPI threshold to determine the device scale factor. 33 // The DPI threshold to determine the device scale factor.
34 // DPI higher than |dpi| will use |device_scale_factor|. 34 // DPI higher than |dpi| will use |device_scale_factor|.
35 struct DeviceScaleFactorDPIThreshold { 35 struct DeviceScaleFactorDPIThreshold {
36 float dpi; 36 float dpi;
37 float device_scale_factor; 37 float device_scale_factor;
38 }; 38 };
39 39
40 const DeviceScaleFactorDPIThreshold kThresholdTable[] = { 40 const DeviceScaleFactorDPIThreshold kThresholdTable[] = {
41 {200.0f, 2.0f}, 41 {220.0f, 2.0f},
42 {180.0f, 1.5f},
42 {150.0f, 1.25f}, 43 {150.0f, 1.25f},
43 {0.0f, 1.0f}, 44 {0.0f, 1.0f},
44 }; 45 };
45 46
46 // 1 inch in mm. 47 // 1 inch in mm.
47 const float kInchInMm = 25.4f; 48 const float kInchInMm = 25.4f;
48 49
49 // The minimum pixel width whose monitor can be called as '4K'. 50 // The minimum pixel width whose monitor can be called as '4K'.
50 const int kMinimumWidthFor4K = 3840; 51 const int kMinimumWidthFor4K = 3840;
51 52
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 // static 299 // static
299 float DisplayChangeObserver::FindDeviceScaleFactor(float dpi) { 300 float DisplayChangeObserver::FindDeviceScaleFactor(float dpi) {
300 for (size_t i = 0; i < arraysize(kThresholdTable); ++i) { 301 for (size_t i = 0; i < arraysize(kThresholdTable); ++i) {
301 if (dpi > kThresholdTable[i].dpi) 302 if (dpi > kThresholdTable[i].dpi)
302 return kThresholdTable[i].device_scale_factor; 303 return kThresholdTable[i].device_scale_factor;
303 } 304 }
304 return 1.0f; 305 return 1.0f;
305 } 306 }
306 307
307 } // namespace display 308 } // namespace display
OLDNEW
« no previous file with comments | « no previous file | ui/display/manager/chromeos/display_change_observer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698