| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ash/display/display_color_manager_chromeos.h" | 5 #include "ash/display/display_color_manager_chromeos.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 ui::DisplayConfigurator* configurator, | 151 ui::DisplayConfigurator* configurator, |
| 152 base::SequencedWorkerPool* blocking_pool) | 152 base::SequencedWorkerPool* blocking_pool) |
| 153 : configurator_(configurator), | 153 : configurator_(configurator), |
| 154 blocking_pool_(blocking_pool), | 154 blocking_pool_(blocking_pool), |
| 155 weak_ptr_factory_(this) { | 155 weak_ptr_factory_(this) { |
| 156 configurator_->AddObserver(this); | 156 configurator_->AddObserver(this); |
| 157 } | 157 } |
| 158 | 158 |
| 159 DisplayColorManager::~DisplayColorManager() { | 159 DisplayColorManager::~DisplayColorManager() { |
| 160 configurator_->RemoveObserver(this); | 160 configurator_->RemoveObserver(this); |
| 161 STLDeleteValues(&calibration_map_); | 161 base::STLDeleteValues(&calibration_map_); |
| 162 } | 162 } |
| 163 | 163 |
| 164 void DisplayColorManager::OnDisplayModeChanged( | 164 void DisplayColorManager::OnDisplayModeChanged( |
| 165 const ui::DisplayConfigurator::DisplayStateList& display_states) { | 165 const ui::DisplayConfigurator::DisplayStateList& display_states) { |
| 166 for (const ui::DisplaySnapshot* state : display_states) { | 166 for (const ui::DisplaySnapshot* state : display_states) { |
| 167 // Ensure we always reset the configuration before setting a new one. | 167 // Ensure we always reset the configuration before setting a new one. |
| 168 configurator_->SetColorCorrection( | 168 configurator_->SetColorCorrection( |
| 169 state->display_id(), std::vector<ui::GammaRampRGBEntry>(), | 169 state->display_id(), std::vector<ui::GammaRampRGBEntry>(), |
| 170 std::vector<ui::GammaRampRGBEntry>(), std::vector<float>()); | 170 std::vector<ui::GammaRampRGBEntry>(), std::vector<float>()); |
| 171 | 171 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 calibration_map_[product_id] = data.release(); | 248 calibration_map_[product_id] = data.release(); |
| 249 ApplyDisplayColorCalibration(display_id, product_id); | 249 ApplyDisplayColorCalibration(display_id, product_id); |
| 250 } | 250 } |
| 251 } | 251 } |
| 252 | 252 |
| 253 DisplayColorManager::ColorCalibrationData::ColorCalibrationData() {} | 253 DisplayColorManager::ColorCalibrationData::ColorCalibrationData() {} |
| 254 | 254 |
| 255 DisplayColorManager::ColorCalibrationData::~ColorCalibrationData() {} | 255 DisplayColorManager::ColorCalibrationData::~ColorCalibrationData() {} |
| 256 | 256 |
| 257 } // namespace ash | 257 } // namespace ash |
| OLD | NEW |