Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: ash/display/display_color_manager_chromeos.cc

Issue 1914343003: Reland: ash: reset color management when new screens are hotplugged (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add an error when trying to set a gamma table without driver support Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ash/display/display_color_manager_chromeos_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 } 157 }
158 158
159 DisplayColorManager::~DisplayColorManager() { 159 DisplayColorManager::~DisplayColorManager() {
160 configurator_->RemoveObserver(this); 160 configurator_->RemoveObserver(this);
161 STLDeleteValues(&calibration_map_); 161 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.
168 configurator_->SetColorCorrection(
169 state->display_id(), std::vector<ui::GammaRampRGBEntry>(),
170 std::vector<ui::GammaRampRGBEntry>(), std::vector<float>());
171
167 if (calibration_map_[state->product_id()]) { 172 if (calibration_map_[state->product_id()]) {
168 ApplyDisplayColorCalibration(state->display_id(), state->product_id()); 173 ApplyDisplayColorCalibration(state->display_id(), state->product_id());
169 } else { 174 } else {
170 if (state->product_id() != ui::DisplaySnapshot::kInvalidProductID) 175 if (state->product_id() != ui::DisplaySnapshot::kInvalidProductID)
171 LoadCalibrationForDisplay(state); 176 LoadCalibrationForDisplay(state);
172 } 177 }
173 } 178 }
174 } 179 }
175 180
176 void DisplayColorManager::ApplyDisplayColorCalibration(int64_t display_id, 181 void DisplayColorManager::ApplyDisplayColorCalibration(int64_t display_id,
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 calibration_map_[product_id] = data.release(); 248 calibration_map_[product_id] = data.release();
244 ApplyDisplayColorCalibration(display_id, product_id); 249 ApplyDisplayColorCalibration(display_id, product_id);
245 } 250 }
246 } 251 }
247 252
248 DisplayColorManager::ColorCalibrationData::ColorCalibrationData() {} 253 DisplayColorManager::ColorCalibrationData::ColorCalibrationData() {}
249 254
250 DisplayColorManager::ColorCalibrationData::~ColorCalibrationData() {} 255 DisplayColorManager::ColorCalibrationData::~ColorCalibrationData() {}
251 256
252 } // namespace ash 257 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/display/display_color_manager_chromeos_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698