OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/util/display_util.h" | 5 #include "ui/display/util/display_util.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 namespace ui { | 9 namespace ui { |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 return 1.0f; | 61 return 1.0f; |
62 | 62 |
63 const unsigned int dpi = static_cast<unsigned int>( | 63 const unsigned int dpi = static_cast<unsigned int>( |
64 kInchInMm * screen_size_in_pixels.width() / physical_size_in_mm.width()); | 64 kInchInMm * screen_size_in_pixels.width() / physical_size_in_mm.width()); |
65 const unsigned int threshold = | 65 const unsigned int threshold = |
66 (physical_size_in_mm.width() >= kLargeDisplayWidthThresholdMM) ? | 66 (physical_size_in_mm.width() >= kLargeDisplayWidthThresholdMM) ? |
67 kHighDensityDPIThresholdLarge : kHighDensityDPIThresholdSmall; | 67 kHighDensityDPIThresholdLarge : kHighDensityDPIThresholdSmall; |
68 return (dpi > threshold) ? 2.0f : 1.0f; | 68 return (dpi > threshold) ? 2.0f : 1.0f; |
69 } | 69 } |
70 | 70 |
| 71 int64_t GenerateDisplayID(uint16_t manufacturer_id, |
| 72 uint32_t product_code_hash, |
| 73 uint8_t output_index) { |
| 74 return ((static_cast<int64_t>(manufacturer_id) << 40) | |
| 75 (static_cast<int64_t>(product_code_hash) << 8) | output_index); |
| 76 } |
| 77 |
71 } // namespace ui | 78 } // namespace ui |
OLD | NEW |