OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chromeos/display/output_configurator.h" | 5 #include "chromeos/display/output_configurator.h" |
6 | 6 |
7 #include <X11/Xlib.h> | 7 #include <X11/Xlib.h> |
8 #include <X11/extensions/Xrandr.h> | 8 #include <X11/extensions/Xrandr.h> |
9 #include <X11/extensions/XInput2.h> | 9 #include <X11/extensions/XInput2.h> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/chromeos/chromeos_version.h" | |
13 #include "base/logging.h" | 12 #include "base/logging.h" |
14 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
| 14 #include "base/sys_info.h" |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
16 #include "chromeos/display/output_util.h" | 16 #include "chromeos/display/output_util.h" |
17 #include "chromeos/display/real_output_configurator_delegate.h" | 17 #include "chromeos/display/real_output_configurator_delegate.h" |
18 | 18 |
19 namespace chromeos { | 19 namespace chromeos { |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 // The delay to perform configuration after RRNotify. See the comment | 23 // The delay to perform configuration after RRNotify. See the comment |
24 // in |Dispatch()|. | 24 // in |Dispatch()|. |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 best_rate = info.refresh_rate; | 217 best_rate = info.refresh_rate; |
218 } | 218 } |
219 } | 219 } |
220 return found; | 220 return found; |
221 } | 221 } |
222 | 222 |
223 OutputConfigurator::OutputConfigurator() | 223 OutputConfigurator::OutputConfigurator() |
224 : state_controller_(NULL), | 224 : state_controller_(NULL), |
225 mirroring_controller_(NULL), | 225 mirroring_controller_(NULL), |
226 is_panel_fitting_enabled_(false), | 226 is_panel_fitting_enabled_(false), |
227 configure_display_(base::chromeos::IsRunningOnChromeOS()), | 227 configure_display_(base::SysInfo::IsRunningOnChromeOS()), |
228 xrandr_event_base_(0), | 228 xrandr_event_base_(0), |
229 output_state_(STATE_INVALID), | 229 output_state_(STATE_INVALID), |
230 power_state_(DISPLAY_POWER_ALL_ON) { | 230 power_state_(DISPLAY_POWER_ALL_ON) { |
231 } | 231 } |
232 | 232 |
233 OutputConfigurator::~OutputConfigurator() {} | 233 OutputConfigurator::~OutputConfigurator() {} |
234 | 234 |
235 void OutputConfigurator::SetDelegateForTesting(scoped_ptr<Delegate> delegate) { | 235 void OutputConfigurator::SetDelegateForTesting(scoped_ptr<Delegate> delegate) { |
236 delegate_ = delegate.Pass(); | 236 delegate_ = delegate.Pass(); |
237 configure_display_ = true; | 237 configure_display_ = true; |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 float width_ratio = static_cast<float>(mirror_mode_info->width) / | 857 float width_ratio = static_cast<float>(mirror_mode_info->width) / |
858 static_cast<float>(native_mode_info->width); | 858 static_cast<float>(native_mode_info->width); |
859 float height_ratio = static_cast<float>(mirror_mode_info->height) / | 859 float height_ratio = static_cast<float>(mirror_mode_info->height) / |
860 static_cast<float>(native_mode_info->height); | 860 static_cast<float>(native_mode_info->height); |
861 | 861 |
862 area_ratio = width_ratio * height_ratio; | 862 area_ratio = width_ratio * height_ratio; |
863 return area_ratio; | 863 return area_ratio; |
864 } | 864 } |
865 | 865 |
866 } // namespace chromeos | 866 } // namespace chromeos |
OLD | NEW |