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 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
74 static DisplayInfo CreateFromSpec(const std::string& spec); | 74 static DisplayInfo CreateFromSpec(const std::string& spec); |
75 | 75 |
76 // Creates a DisplayInfo from string spec using given |id|. | 76 // Creates a DisplayInfo from string spec using given |id|. |
77 static DisplayInfo CreateFromSpecWithID(const std::string& spec, | 77 static DisplayInfo CreateFromSpecWithID(const std::string& spec, |
78 int64 id); | 78 int64 id); |
79 | 79 |
80 DisplayInfo(); | 80 DisplayInfo(); |
81 DisplayInfo(int64 id, const std::string& name, bool has_overscan); | 81 DisplayInfo(int64 id, const std::string& name, bool has_overscan); |
82 ~DisplayInfo(); | 82 ~DisplayInfo(); |
83 | 83 |
84 // When this is set to true, Chrome switches High DPI when lower UI scale | |
85 // (<1.0f) is specificed on 1x device to make UI sharp, e.g, upgrade 0.6 | |
Jun Mukai
2014/04/09 18:16:40
typo: specified?
oshima
2014/04/10 14:22:22
Done.
| |
86 // scale on 1x DSF to 1.2 scale on 2x DSF. | |
87 static void SetAllowUpgradeToHighDPI(bool enable); | |
88 | |
84 int64 id() const { return id_; } | 89 int64 id() const { return id_; } |
85 | 90 |
86 // The name of the display. | 91 // The name of the display. |
87 const std::string& name() const { return name_; } | 92 const std::string& name() const { return name_; } |
88 | 93 |
89 // True if the display EDID has the overscan flag. This does not create the | 94 // True if the display EDID has the overscan flag. This does not create the |
90 // actual overscan automatically, but used in the message. | 95 // actual overscan automatically, but used in the message. |
91 bool has_overscan() const { return has_overscan_; } | 96 bool has_overscan() const { return has_overscan_; } |
92 | 97 |
93 void set_rotation(gfx::Display::Rotation rotation) { rotation_ = rotation; } | 98 void set_rotation(gfx::Display::Rotation rotation) { rotation_ = rotation; } |
(...skipping 22 matching lines...) Expand all Loading... | |
116 const gfx::Insets& overscan_insets_in_dip() const { | 121 const gfx::Insets& overscan_insets_in_dip() const { |
117 return overscan_insets_in_dip_; | 122 return overscan_insets_in_dip_; |
118 } | 123 } |
119 | 124 |
120 // Sets/gets configured ui scale. This can be different from the ui | 125 // Sets/gets configured ui scale. This can be different from the ui |
121 // scale actually used when the scale is 2.0 and DSF is 2.0. | 126 // scale actually used when the scale is 2.0 and DSF is 2.0. |
122 // (the effective ui scale is 1.0 in this case). | 127 // (the effective ui scale is 1.0 in this case). |
123 float configured_ui_scale() const { return configured_ui_scale_; } | 128 float configured_ui_scale() const { return configured_ui_scale_; } |
124 void set_configured_ui_scale(float scale) { configured_ui_scale_ = scale; } | 129 void set_configured_ui_scale(float scale) { configured_ui_scale_ = scale; } |
125 | 130 |
126 // Returns the ui scale used for the device scale factor. This | 131 // Returns the ui scale and device scale factor actually used to create |
127 // return 1.0f if the ui scale and dsf are both set to 2.0. | 132 // display that chrome sees. This can be different from one obtained |
133 // from dispaly or one specified by a user in following situation. | |
134 // 1) DSF is 2.0f and UI scale is 2.0f. (Returns 1.0f and 1.0f respectiely) | |
135 // 2) Lower UI scale (< 1.0) is specified on 1.0f DSF | |
136 // when 2x resources is available. (Returns 2.0f + 1.2f for 1.0DSF + 0.6 | |
137 // ui scale) so that chrome can use 2x resoruces. | |
128 float GetEffectiveUIScale() const; | 138 float GetEffectiveUIScale() const; |
139 float GetEffectiveDeviceScaleFactor() const; | |
Jun Mukai
2014/04/09 18:16:40
a bit confused because the order of declaration of
oshima
2014/04/10 14:22:22
Fixed the comment.
| |
129 | 140 |
130 // Copy the display info except for fields that can be modified by a | 141 // Copy the display info except for fields that can be modified by a |
131 // user (|rotation_| and |configured_ui_scale_|). |rotation_| and | 142 // user (|rotation_| and |configured_ui_scale_|). |rotation_| and |
132 // |configured_ui_scale_| are copied when the |another_info| isn't native one. | 143 // |configured_ui_scale_| are copied when the |another_info| isn't native one. |
133 void Copy(const DisplayInfo& another_info); | 144 void Copy(const DisplayInfo& another_info); |
134 | 145 |
135 // Update the |bounds_in_native_| and |size_in_pixel_| using | 146 // Update the |bounds_in_native_| and |size_in_pixel_| using |
136 // given |bounds_in_native|. | 147 // given |bounds_in_native|. |
137 void SetBounds(const gfx::Rect& bounds_in_native); | 148 void SetBounds(const gfx::Rect& bounds_in_native); |
138 | 149 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
220 // The current profile of the color calibration. | 231 // The current profile of the color calibration. |
221 ui::ColorCalibrationProfile color_profile_; | 232 ui::ColorCalibrationProfile color_profile_; |
222 | 233 |
223 // The list of available variations for the color calibration. | 234 // The list of available variations for the color calibration. |
224 std::vector<ui::ColorCalibrationProfile> available_color_profiles_; | 235 std::vector<ui::ColorCalibrationProfile> available_color_profiles_; |
225 }; | 236 }; |
226 | 237 |
227 } // namespace ash | 238 } // namespace ash |
228 | 239 |
229 #endif // ASH_DISPLAY_DISPLAY_INFO_H_ | 240 #endif // ASH_DISPLAY_DISPLAY_INFO_H_ |
OLD | NEW |