[email protected] | aa0759e0 | 2014-04-04 19:13:40 | [diff] [blame] | 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 | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | 90533fc | 2014-04-16 18:23:59 | [diff] [blame] | 5 | #ifndef UI_DISPLAY_UTIL_DISPLAY_UTIL_H_ |
6 | #define UI_DISPLAY_UTIL_DISPLAY_UTIL_H_ | ||||
[email protected] | aa0759e0 | 2014-04-04 19:13:40 | [diff] [blame] | 7 | |
avi | ce85b429 | 2015-12-24 21:08:25 | [diff] [blame] | 8 | #include <stdint.h> |
9 | |||||
[email protected] | 90533fc | 2014-04-16 18:23:59 | [diff] [blame] | 10 | #include "ui/display/util/display_util_export.h" |
[email protected] | aa0759e0 | 2014-04-04 19:13:40 | [diff] [blame] | 11 | #include "ui/gfx/geometry/size.h" |
12 | |||||
kylechar | 79bed53c | 2016-09-01 13:02:31 | [diff] [blame] | 13 | namespace display { |
[email protected] | aa0759e0 | 2014-04-04 19:13:40 | [diff] [blame] | 14 | |
15 | // Returns true if a given size is in the list of bogus sizes in mm that should | ||||
16 | // be ignored. | ||||
[email protected] | 90533fc | 2014-04-16 18:23:59 | [diff] [blame] | 17 | DISPLAY_UTIL_EXPORT bool IsDisplaySizeBlackListed( |
18 | const gfx::Size& physical_size); | ||||
[email protected] | aa0759e0 | 2014-04-04 19:13:40 | [diff] [blame] | 19 | |
[email protected] | 0e19df41 | 2014-04-10 05:07:34 | [diff] [blame] | 20 | // Returns the desired device scale factor for the display with the given |
21 | // physical_size and resoultion. | ||||
[email protected] | 90533fc | 2014-04-16 18:23:59 | [diff] [blame] | 22 | DISPLAY_UTIL_EXPORT float GetScaleFactor( |
[email protected] | 0e19df41 | 2014-04-10 05:07:34 | [diff] [blame] | 23 | const gfx::Size& physical_size_in_mm, |
24 | const gfx::Size& screen_size_in_pixels); | ||||
25 | |||||
robert.bradford | 3d88a67 | 2015-12-10 11:51:38 | [diff] [blame] | 26 | // Returns 64-bit persistent ID for the specified manufacturer's ID and |
27 | // product_code_hash, and the index of the output it is connected to. | ||||
28 | // |output_index| is used to distinguish the displays of the same type. For | ||||
29 | // example, swapping two identical display between two outputs will not be | ||||
30 | // treated as swap. The 'serial number' field in EDID isn't used here because | ||||
31 | // it is not guaranteed to have unique number and it may have the same fixed | ||||
32 | // value (like 0). | ||||
33 | DISPLAY_UTIL_EXPORT int64_t GenerateDisplayID(uint16_t manufacturer_id, | ||||
34 | uint32_t product_code_hash, | ||||
35 | uint8_t output_index); | ||||
36 | |||||
kylechar | 79bed53c | 2016-09-01 13:02:31 | [diff] [blame] | 37 | } // namespace display |
[email protected] | aa0759e0 | 2014-04-04 19:13:40 | [diff] [blame] | 38 | |
[email protected] | 90533fc | 2014-04-16 18:23:59 | [diff] [blame] | 39 | #endif // UI_DISPLAY_UTIL_DISPLAY_UTIL_H_ |