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 <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 // no overscan. flipped upside-down (180 degree) and 1.5 ui scale. | 79 // no overscan. flipped upside-down (180 degree) and 1.5 ui scale. |
80 // "200x100#300x200|200x100%59.0|100x100%60" | 80 // "200x100#300x200|200x100%59.0|100x100%60" |
81 // 200x100 window at 0,0 origin, with 3 possible resolutions, | 81 // 200x100 window at 0,0 origin, with 3 possible resolutions, |
82 // 300x200, 200x100 at 59 Hz, and 100x100 at 60 Hz. | 82 // 300x200, 200x100 at 59 Hz, and 100x100 at 60 Hz. |
83 static DisplayInfo CreateFromSpec(const std::string& spec); | 83 static DisplayInfo CreateFromSpec(const std::string& spec); |
84 | 84 |
85 // Creates a DisplayInfo from string spec using given |id|. | 85 // Creates a DisplayInfo from string spec using given |id|. |
86 static DisplayInfo CreateFromSpecWithID(const std::string& spec, | 86 static DisplayInfo CreateFromSpecWithID(const std::string& spec, |
87 int64 id); | 87 int64 id); |
88 | 88 |
| 89 // When this is set to true on the device whose internal display has |
| 90 // 1.25 dsf, Chrome uses 1.0f as a default scale factor, and uses |
| 91 // dsf 1.25 when UI scaling is set to 0.8f. |
| 92 static void SetUse125DSFForUIScalingForTest(bool enable); |
| 93 |
89 DisplayInfo(); | 94 DisplayInfo(); |
90 DisplayInfo(int64 id, const std::string& name, bool has_overscan); | 95 DisplayInfo(int64 id, const std::string& name, bool has_overscan); |
91 ~DisplayInfo(); | 96 ~DisplayInfo(); |
92 | 97 |
93 // When this is set to true on the device whose internal display has | |
94 // 1.25 dsf, Chrome uses 1.0f as a default scale factor, and uses | |
95 // dsf 1.25 when UI scaling is set to 0.8f. | |
96 static void SetUse125DSFForUIScaling(bool enable); | |
97 | |
98 int64 id() const { return id_; } | 98 int64 id() const { return id_; } |
99 | 99 |
100 // The name of the display. | 100 // The name of the display. |
101 const std::string& name() const { return name_; } | 101 const std::string& name() const { return name_; } |
102 | 102 |
103 // True if the display EDID has the overscan flag. This does not create the | 103 // True if the display EDID has the overscan flag. This does not create the |
104 // actual overscan automatically, but used in the message. | 104 // actual overscan automatically, but used in the message. |
105 bool has_overscan() const { return has_overscan_; } | 105 bool has_overscan() const { return has_overscan_; } |
106 | 106 |
107 void set_touch_support(gfx::Display::TouchSupport support) { | 107 void set_touch_support(gfx::Display::TouchSupport support) { |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 // modes. | 228 // modes. |
229 std::string ToString() const; | 229 std::string ToString() const; |
230 | 230 |
231 // Returns a string representation of the DisplayInfo, including display | 231 // Returns a string representation of the DisplayInfo, including display |
232 // modes. | 232 // modes. |
233 std::string ToFullString() const; | 233 std::string ToFullString() const; |
234 | 234 |
235 private: | 235 private: |
236 // Returns true if this display should use DSF=1.25 for UI scaling; i.e. | 236 // Returns true if this display should use DSF=1.25 for UI scaling; i.e. |
237 // SetUse125DSFForUIScaling(true) is called and this is the internal display. | 237 // SetUse125DSFForUIScaling(true) is called and this is the internal display. |
238 bool Use125DSFRorUIScaling() const; | 238 bool Use125DSFForUIScaling() const; |
239 | 239 |
240 int64 id_; | 240 int64 id_; |
241 std::string name_; | 241 std::string name_; |
242 bool has_overscan_; | 242 bool has_overscan_; |
243 std::map<gfx::Display::RotationSource, gfx::Display::Rotation> rotations_; | 243 std::map<gfx::Display::RotationSource, gfx::Display::Rotation> rotations_; |
244 gfx::Display::TouchSupport touch_support_; | 244 gfx::Display::TouchSupport touch_support_; |
245 | 245 |
246 // If the display is also a touch device, it will have a positive | 246 // If the display is also a touch device, it will have a positive |
247 // |touch_device_id_|. Otherwise |touch_device_id_| is 0. | 247 // |touch_device_id_|. Otherwise |touch_device_id_| is 0. |
248 int touch_device_id_; | 248 int touch_device_id_; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 | 288 |
289 // The list of available variations for the color calibration. | 289 // The list of available variations for the color calibration. |
290 std::vector<ui::ColorCalibrationProfile> available_color_profiles_; | 290 std::vector<ui::ColorCalibrationProfile> available_color_profiles_; |
291 | 291 |
292 // If you add a new member, you need to update Copy(). | 292 // If you add a new member, you need to update Copy(). |
293 }; | 293 }; |
294 | 294 |
295 } // namespace ash | 295 } // namespace ash |
296 | 296 |
297 #endif // ASH_DISPLAY_DISPLAY_INFO_H_ | 297 #endif // ASH_DISPLAY_DISPLAY_INFO_H_ |
OLD | NEW |