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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 static DisplayInfo CreateFromSpec(const std::string& spec); | 82 static DisplayInfo CreateFromSpec(const std::string& spec); |
83 | 83 |
84 // Creates a DisplayInfo from string spec using given |id|. | 84 // Creates a DisplayInfo from string spec using given |id|. |
85 static DisplayInfo CreateFromSpecWithID(const std::string& spec, | 85 static DisplayInfo CreateFromSpecWithID(const std::string& spec, |
86 int64 id); | 86 int64 id); |
87 | 87 |
88 DisplayInfo(); | 88 DisplayInfo(); |
89 DisplayInfo(int64 id, const std::string& name, bool has_overscan); | 89 DisplayInfo(int64 id, const std::string& name, bool has_overscan); |
90 ~DisplayInfo(); | 90 ~DisplayInfo(); |
91 | 91 |
92 // When this is set to true, Chrome switches High DPI when lower UI scale | |
93 // (<1.0f) is specified on 1x device to make UI sharp, e.g, upgrade 0.6 | |
94 // scale on 1x DSF to 1.2 scale on 2x DSF. | |
95 static void SetAllowUpgradeToHighDPI(bool enable); | |
96 | |
97 // When this is set to true on the device whose internal display has | 92 // When this is set to true on the device whose internal display has |
98 // 1.25 dsf, Chrome uses 1.0f as a default scale factor, and uses | 93 // 1.25 dsf, Chrome uses 1.0f as a default scale factor, and uses |
99 // dsf 1.25 when UI scaling is set to 0.8f. | 94 // dsf 1.25 when UI scaling is set to 0.8f. |
100 static void SetUse125DSFForUIScaling(bool enable); | 95 static void SetUse125DSFForUIScaling(bool enable); |
101 | 96 |
102 int64 id() const { return id_; } | 97 int64 id() const { return id_; } |
103 | 98 |
104 // The name of the display. | 99 // The name of the display. |
105 const std::string& name() const { return name_; } | 100 const std::string& name() const { return name_; } |
106 | 101 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 // Sets/gets configured ui scale. This can be different from the ui | 136 // Sets/gets configured ui scale. This can be different from the ui |
142 // scale actually used when the scale is 2.0 and DSF is 2.0. | 137 // scale actually used when the scale is 2.0 and DSF is 2.0. |
143 // (the effective ui scale is 1.0 in this case). | 138 // (the effective ui scale is 1.0 in this case). |
144 float configured_ui_scale() const { return configured_ui_scale_; } | 139 float configured_ui_scale() const { return configured_ui_scale_; } |
145 void set_configured_ui_scale(float scale) { configured_ui_scale_ = scale; } | 140 void set_configured_ui_scale(float scale) { configured_ui_scale_ = scale; } |
146 | 141 |
147 // Returns the ui scale and device scale factor actually used to create | 142 // Returns the ui scale and device scale factor actually used to create |
148 // display that chrome sees. This can be different from one obtained | 143 // display that chrome sees. This can be different from one obtained |
149 // from dispaly or one specified by a user in following situation. | 144 // from dispaly or one specified by a user in following situation. |
150 // 1) DSF is 2.0f and UI scale is 2.0f. (Returns 1.0f and 1.0f respectiely) | 145 // 1) DSF is 2.0f and UI scale is 2.0f. (Returns 1.0f and 1.0f respectiely) |
151 // 2) Lower UI scale (< 1.0) is specified on 1.0f DSF device | 146 // 2) A user specified 0.8x on the device that has 1.25 DSF. 1.25 DSF device |
152 // when 2x resources is available. (Returns 2.0f DSF + 1.2f UI scale | 147 // uses 1.0f DFS unless 0.8x UI scaling is specified. |
153 // for 1.0DSF + 0.6 UI scale). | |
154 float GetEffectiveDeviceScaleFactor() const; | 148 float GetEffectiveDeviceScaleFactor() const; |
| 149 |
| 150 // Returns the ui scale used for the device scale factor. This |
| 151 // return 1.0f if the ui scale and dsf are both set to 2.0. |
155 float GetEffectiveUIScale() const; | 152 float GetEffectiveUIScale() const; |
156 | 153 |
157 // Copy the display info except for fields that can be modified by a | 154 // Copy the display info except for fields that can be modified by a |
158 // user (|rotation_| and |configured_ui_scale_|). |rotation_| and | 155 // user (|rotation_| and |configured_ui_scale_|). |rotation_| and |
159 // |configured_ui_scale_| are copied when the |another_info| isn't native one. | 156 // |configured_ui_scale_| are copied when the |another_info| isn't native one. |
160 void Copy(const DisplayInfo& another_info); | 157 void Copy(const DisplayInfo& another_info); |
161 | 158 |
162 // Update the |bounds_in_native_| and |size_in_pixel_| using | 159 // Update the |bounds_in_native_| and |size_in_pixel_| using |
163 // given |bounds_in_native|. | 160 // given |bounds_in_native|. |
164 void SetBounds(const gfx::Rect& bounds_in_native); | 161 void SetBounds(const gfx::Rect& bounds_in_native); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 // The current profile of the color calibration. | 265 // The current profile of the color calibration. |
269 ui::ColorCalibrationProfile color_profile_; | 266 ui::ColorCalibrationProfile color_profile_; |
270 | 267 |
271 // The list of available variations for the color calibration. | 268 // The list of available variations for the color calibration. |
272 std::vector<ui::ColorCalibrationProfile> available_color_profiles_; | 269 std::vector<ui::ColorCalibrationProfile> available_color_profiles_; |
273 }; | 270 }; |
274 | 271 |
275 } // namespace ash | 272 } // namespace ash |
276 | 273 |
277 #endif // ASH_DISPLAY_DISPLAY_INFO_H_ | 274 #endif // ASH_DISPLAY_DISPLAY_INFO_H_ |
OLD | NEW |