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/display_configurator.h" | 5 #include "ui/display/chromeos/display_configurator.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/sys_info.h" | 10 #include "base/sys_info.h" |
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 int64_t display_id, | 806 int64_t display_id, |
807 const std::vector<GammaRampRGBEntry>& lut) { | 807 const std::vector<GammaRampRGBEntry>& lut) { |
808 for (const DisplaySnapshot* display : cached_displays_) { | 808 for (const DisplaySnapshot* display : cached_displays_) { |
809 if (display->display_id() == display_id) | 809 if (display->display_id() == display_id) |
810 return native_display_delegate_->SetGammaRamp(*display, lut); | 810 return native_display_delegate_->SetGammaRamp(*display, lut); |
811 } | 811 } |
812 | 812 |
813 return false; | 813 return false; |
814 } | 814 } |
815 | 815 |
| 816 bool DisplayConfigurator::SetColorCorrection( |
| 817 int64_t display_id, |
| 818 const std::vector<GammaRampRGBEntry>& degamma_lut, |
| 819 const std::vector<GammaRampRGBEntry>& gamma_lut, |
| 820 const float correction_matrix[9]) { |
| 821 for (const DisplaySnapshot* display : cached_displays_) { |
| 822 if (display->display_id() == display_id) |
| 823 return native_display_delegate_->SetColorCorrection( |
| 824 *display, degamma_lut, gamma_lut, correction_matrix); |
| 825 } |
| 826 |
| 827 return false; |
| 828 } |
| 829 |
816 void DisplayConfigurator::PrepareForExit() { | 830 void DisplayConfigurator::PrepareForExit() { |
817 configure_display_ = false; | 831 configure_display_ = false; |
818 } | 832 } |
819 | 833 |
820 void DisplayConfigurator::SetDisplayPower( | 834 void DisplayConfigurator::SetDisplayPower( |
821 chromeos::DisplayPowerState power_state, | 835 chromeos::DisplayPowerState power_state, |
822 int flags, | 836 int flags, |
823 const ConfigurationCallback& callback) { | 837 const ConfigurationCallback& callback) { |
824 if (!configure_display_ || display_externally_controlled_) { | 838 if (!configure_display_ || display_externally_controlled_) { |
825 callback.Run(false); | 839 callback.Run(false); |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1073 FOR_EACH_OBSERVER( | 1087 FOR_EACH_OBSERVER( |
1074 Observer, observers_, OnDisplayModeChanged(cached_displays_)); | 1088 Observer, observers_, OnDisplayModeChanged(cached_displays_)); |
1075 } else { | 1089 } else { |
1076 FOR_EACH_OBSERVER( | 1090 FOR_EACH_OBSERVER( |
1077 Observer, observers_, OnDisplayModeChangeFailed(cached_displays_, | 1091 Observer, observers_, OnDisplayModeChangeFailed(cached_displays_, |
1078 attempted_state)); | 1092 attempted_state)); |
1079 } | 1093 } |
1080 } | 1094 } |
1081 | 1095 |
1082 } // namespace ui | 1096 } // namespace ui |
OLD | NEW |