OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef ASH_DISPLAY_DISPLAY_INFO_H_ | 5 #ifndef ASH_DISPLAY_DISPLAY_INFO_H_ |
6 #define ASH_DISPLAY_DISPLAY_INFO_H_ | 6 #define ASH_DISPLAY_DISPLAY_INFO_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "ash/ash_export.h" | 11 #include "ash/ash_export.h" |
12 #include "ui/display/types/display_constants.h" | 12 #include "ui/display/types/display_constants.h" |
13 #include "ui/gfx/display.h" | 13 #include "ui/gfx/display.h" |
14 #include "ui/gfx/insets.h" | 14 #include "ui/gfx/insets.h" |
15 #include "ui/gfx/rect.h" | 15 #include "ui/gfx/rect.h" |
16 | 16 |
17 namespace ash { | 17 namespace ash { |
18 | 18 |
19 // A struct that represents the display's mode info. | 19 // A struct that represents the display's mode info. |
20 struct ASH_EXPORT DisplayMode { | 20 struct ASH_EXPORT DisplayMode { |
21 DisplayMode(); | 21 DisplayMode(); |
22 DisplayMode(const gfx::Size& size, | 22 DisplayMode(const gfx::Size& size, |
23 float refresh_rate, | 23 float refresh_rate, |
24 bool interlaced, | 24 bool interlaced, |
25 bool native); | 25 bool native); |
26 | 26 |
| 27 // Returns the size in DIP which isvisible to the user. |
| 28 gfx::Size GetSizeInDIP() const; |
| 29 |
| 30 // Returns true if |other| has same size and scale factors. |
| 31 bool IsEquivalent(const DisplayMode& other) const; |
| 32 |
27 gfx::Size size; // Physical pixel size of the display. | 33 gfx::Size size; // Physical pixel size of the display. |
28 float refresh_rate; // Refresh rate of the display, in Hz. | 34 float refresh_rate; // Refresh rate of the display, in Hz. |
29 bool interlaced; // True if mode is interlaced. | 35 bool interlaced; // True if mode is interlaced. |
30 bool native; // True if mode is native mode of the display. | 36 bool native; // True if mode is native mode of the display. |
| 37 float ui_scale; // The UI scale factor of the mode. |
| 38 float device_scale_factor; // The device scale factor of the mode. |
31 }; | 39 }; |
32 | 40 |
33 // DisplayInfo contains metadata for each display. This is used to | 41 // DisplayInfo contains metadata for each display. This is used to |
34 // create |gfx::Display| as well as to maintain extra infomation | 42 // create |gfx::Display| as well as to maintain extra infomation |
35 // to manage displays in ash environment. | 43 // to manage displays in ash environment. |
36 // This class is intentionally made copiable. | 44 // This class is intentionally made copiable. |
37 class ASH_EXPORT DisplayInfo { | 45 class ASH_EXPORT DisplayInfo { |
38 public: | 46 public: |
39 // Creates a DisplayInfo from string spec. 100+200-1440x800 creates display | 47 // Creates a DisplayInfo from string spec. 100+200-1440x800 creates display |
40 // whose size is 1440x800 at the location (100, 200) in host coordinates. | 48 // whose size is 1440x800 at the location (100, 200) in host coordinates. |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 // The current profile of the color calibration. | 259 // The current profile of the color calibration. |
252 ui::ColorCalibrationProfile color_profile_; | 260 ui::ColorCalibrationProfile color_profile_; |
253 | 261 |
254 // The list of available variations for the color calibration. | 262 // The list of available variations for the color calibration. |
255 std::vector<ui::ColorCalibrationProfile> available_color_profiles_; | 263 std::vector<ui::ColorCalibrationProfile> available_color_profiles_; |
256 }; | 264 }; |
257 | 265 |
258 } // namespace ash | 266 } // namespace ash |
259 | 267 |
260 #endif // ASH_DISPLAY_DISPLAY_INFO_H_ | 268 #endif // ASH_DISPLAY_DISPLAY_INFO_H_ |
OLD | NEW |