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 #include "chromeos/display/real_output_configurator_delegate.h" | 5 #include "chromeos/display/real_output_configurator_delegate.h" |
6 | 6 |
7 #include <X11/Xatom.h> | 7 #include <X11/Xatom.h> |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 #include <X11/extensions/dpms.h> | 9 #include <X11/extensions/dpms.h> |
10 #include <X11/extensions/XInput.h> | 10 #include <X11/extensions/XInput.h> |
11 #include <X11/extensions/XInput2.h> | 11 #include <X11/extensions/XInput2.h> |
12 #include <X11/extensions/Xrandr.h> | 12 #include <X11/extensions/Xrandr.h> |
13 | 13 |
14 #include <cmath> | 14 #include <cmath> |
15 | 15 |
16 #include "base/logging.h" | 16 #include "base/logging.h" |
17 #include "base/message_pump_aurax11.h" | 17 #include "base/message_pump_aurax11.h" |
| 18 #include "chromeos/dbus/dbus_thread_manager.h" |
| 19 #include "chromeos/dbus/power_manager_client.h" |
18 | 20 |
19 namespace chromeos { | 21 namespace chromeos { |
20 | 22 |
21 namespace { | 23 namespace { |
22 | 24 |
23 // DPI measurements. | 25 // DPI measurements. |
24 const float kMmInInch = 25.4; | 26 const float kMmInInch = 25.4; |
25 const float kDpi96 = 96.0; | 27 const float kDpi96 = 96.0; |
26 const float kPixelsToMmScale = kMmInInch / kDpi96; | 28 const float kPixelsToMmScale = kMmInInch / kDpi96; |
27 | 29 |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 type, | 309 type, |
308 format, | 310 format, |
309 PropModeReplace, | 311 PropModeReplace, |
310 reinterpret_cast<unsigned char*>(value), | 312 reinterpret_cast<unsigned char*>(value), |
311 9); | 313 9); |
312 } | 314 } |
313 } | 315 } |
314 XIFreeDeviceInfo(info); | 316 XIFreeDeviceInfo(info); |
315 } | 317 } |
316 | 318 |
| 319 void RealOutputConfiguratorDelegate::SendProjectingStateToPowerManager( |
| 320 bool projecting) { |
| 321 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
| 322 SetIsProjecting(projecting); |
| 323 } |
| 324 |
317 void RealOutputConfiguratorDelegate::DestroyUnusedCrtcs( | 325 void RealOutputConfiguratorDelegate::DestroyUnusedCrtcs( |
318 OutputConfigurator::CrtcConfig* config1, | 326 OutputConfigurator::CrtcConfig* config1, |
319 OutputConfigurator::CrtcConfig* config2) { | 327 OutputConfigurator::CrtcConfig* config2) { |
320 CHECK(screen_) << "Server not grabbed"; | 328 CHECK(screen_) << "Server not grabbed"; |
321 // Setting the screen size will fail if any CRTC doesn't fit afterwards. | 329 // Setting the screen size will fail if any CRTC doesn't fit afterwards. |
322 // At the same time, turning CRTCs off and back on uses up a lot of time. | 330 // At the same time, turning CRTCs off and back on uses up a lot of time. |
323 // This function tries to be smart to avoid too many off/on cycles: | 331 // This function tries to be smart to avoid too many off/on cycles: |
324 // - We disable all the CRTCs we won't need after the FB resize. | 332 // - We disable all the CRTCs we won't need after the FB resize. |
325 // - We set the new modes on CRTCs, if they fit in both the old and new | 333 // - We set the new modes on CRTCs, if they fit in both the old and new |
326 // FBs, and park them at (0,0) | 334 // FBs, and park them at (0,0) |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 << " id " << info[i].deviceid | 566 << " id " << info[i].deviceid |
559 << " width " << width | 567 << " width " << width |
560 << " height " << height; | 568 << " height " << height; |
561 } | 569 } |
562 } | 570 } |
563 | 571 |
564 XIFreeDeviceInfo(info); | 572 XIFreeDeviceInfo(info); |
565 } | 573 } |
566 | 574 |
567 } // namespace chromeos | 575 } // namespace chromeos |
OLD | NEW |