| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/display/chromeos/x11/native_display_delegate_x11.h" | 5 #include "ui/display/chromeos/x11/native_display_delegate_x11.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/Xrandr.h> | 10 #include <X11/extensions/Xrandr.h> |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 crtc = info->crtcs[i]; | 377 crtc = info->crtcs[i]; |
| 378 *last_used_crtc = crtc; | 378 *last_used_crtc = crtc; |
| 379 break; | 379 break; |
| 380 } | 380 } |
| 381 } | 381 } |
| 382 | 382 |
| 383 const DisplayMode* current_mode = NULL; | 383 const DisplayMode* current_mode = NULL; |
| 384 const DisplayMode* native_mode = NULL; | 384 const DisplayMode* native_mode = NULL; |
| 385 std::vector<const DisplayMode*> display_modes; | 385 std::vector<const DisplayMode*> display_modes; |
| 386 | 386 |
| 387 // TODO(mukai|marcheu): check the system status and fill the correct list of | |
| 388 // available color profiles. | |
| 389 | |
| 390 for (int i = 0; i < info->nmode; ++i) { | 387 for (int i = 0; i < info->nmode; ++i) { |
| 391 const RRMode mode = info->modes[i]; | 388 const RRMode mode = info->modes[i]; |
| 392 if (modes_.find(mode) != modes_.end()) { | 389 if (modes_.find(mode) != modes_.end()) { |
| 393 display_modes.push_back(modes_.at(mode)); | 390 display_modes.push_back(modes_.at(mode)); |
| 394 | 391 |
| 395 if (mode == current_mode_id) | 392 if (mode == current_mode_id) |
| 396 current_mode = display_modes.back(); | 393 current_mode = display_modes.back(); |
| 397 if (mode == native_mode_id) | 394 if (mode == native_mode_id) |
| 398 native_mode = display_modes.back(); | 395 native_mode = display_modes.back(); |
| 399 } else { | 396 } else { |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 if (values) | 597 if (values) |
| 601 XFree(values); | 598 XFree(values); |
| 602 } | 599 } |
| 603 } | 600 } |
| 604 if (props) | 601 if (props) |
| 605 XFree(props); | 602 XFree(props); |
| 606 | 603 |
| 607 return ret; | 604 return ret; |
| 608 } | 605 } |
| 609 | 606 |
| 607 |
| 608 std::vector<ColorCalibrationProfile> |
| 609 NativeDisplayDelegateX11::GetAvailableColorCalibrationProfiles( |
| 610 const DisplaySnapshot& output) { |
| 611 // TODO(mukai|marcheu): Checks the system data and fills the result. |
| 612 // Note that the order would be Dynamic -> Standard -> Movie -> Reading. |
| 613 return std::vector<ColorCalibrationProfile>(); |
| 614 } |
| 615 |
| 610 bool NativeDisplayDelegateX11::SetColorCalibrationProfile( | 616 bool NativeDisplayDelegateX11::SetColorCalibrationProfile( |
| 611 const DisplaySnapshot& output, | 617 const DisplaySnapshot& output, |
| 612 ColorCalibrationProfile new_profile) { | 618 ColorCalibrationProfile new_profile) { |
| 613 const DisplaySnapshotX11& x11_output = | 619 const DisplaySnapshotX11& x11_output = |
| 614 static_cast<const DisplaySnapshotX11&>(output); | 620 static_cast<const DisplaySnapshotX11&>(output); |
| 615 | 621 |
| 616 XRRCrtcGamma* gamma_ramp = CreateGammaRampForProfile(x11_output, new_profile); | 622 XRRCrtcGamma* gamma_ramp = CreateGammaRampForProfile(x11_output, new_profile); |
| 617 | 623 |
| 618 if (!gamma_ramp) | 624 if (!gamma_ramp) |
| 619 return false; | 625 return false; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 636 | 642 |
| 637 void NativeDisplayDelegateX11::AddObserver(NativeDisplayObserver* observer) { | 643 void NativeDisplayDelegateX11::AddObserver(NativeDisplayObserver* observer) { |
| 638 observers_.AddObserver(observer); | 644 observers_.AddObserver(observer); |
| 639 } | 645 } |
| 640 | 646 |
| 641 void NativeDisplayDelegateX11::RemoveObserver(NativeDisplayObserver* observer) { | 647 void NativeDisplayDelegateX11::RemoveObserver(NativeDisplayObserver* observer) { |
| 642 observers_.RemoveObserver(observer); | 648 observers_.RemoveObserver(observer); |
| 643 } | 649 } |
| 644 | 650 |
| 645 } // namespace ui | 651 } // namespace ui |
| OLD | NEW |