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 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/chromeos/chromeos_version.h" | 11 #include "base/chromeos/chromeos_version.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
14 #include "base/time.h" | 14 #include "base/time/time.h" |
15 #include "chromeos/display/output_util.h" | 15 #include "chromeos/display/output_util.h" |
16 #include "chromeos/display/real_output_configurator_delegate.h" | 16 #include "chromeos/display/real_output_configurator_delegate.h" |
17 | 17 |
18 namespace chromeos { | 18 namespace chromeos { |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 // The delay to perform configuration after RRNotify. See the comment | 22 // The delay to perform configuration after RRNotify. See the comment |
23 // in |Dispatch()|. | 23 // in |Dispatch()|. |
24 const int64 kConfigureDelayMs = 500; | 24 const int64 kConfigureDelayMs = 500; |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 float width_ratio = static_cast<float>(mirror_mode_width) / | 626 float width_ratio = static_cast<float>(mirror_mode_width) / |
627 static_cast<float>(native_mode_width); | 627 static_cast<float>(native_mode_width); |
628 float height_ratio = static_cast<float>(mirror_mode_height) / | 628 float height_ratio = static_cast<float>(mirror_mode_height) / |
629 static_cast<float>(native_mode_height); | 629 static_cast<float>(native_mode_height); |
630 | 630 |
631 area_ratio = width_ratio * height_ratio; | 631 area_ratio = width_ratio * height_ratio; |
632 return area_ratio; | 632 return area_ratio; |
633 } | 633 } |
634 | 634 |
635 } // namespace chromeos | 635 } // namespace chromeos |
OLD | NEW |