| 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" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
| 13 #include "base/task_runner_util.h" | 13 #include "base/task_runner_util.h" |
| 14 #include "base/threading/sequenced_worker_pool.h" | 14 #include "base/threading/sequenced_worker_pool.h" |
| 15 #include "components/quirks/quirks_manager.h" | 15 #include "components/quirks/quirks_manager.h" |
| 16 #include "third_party/qcms/src/qcms.h" | 16 #include "third_party/qcms/src/qcms.h" |
| 17 #include "ui/display/display.h" |
| 17 #include "ui/display/types/display_snapshot.h" | 18 #include "ui/display/types/display_snapshot.h" |
| 18 #include "ui/display/types/gamma_ramp_rgb_entry.h" | 19 #include "ui/display/types/gamma_ramp_rgb_entry.h" |
| 19 #include "ui/gfx/display.h" | |
| 20 | 20 |
| 21 namespace ash { | 21 namespace ash { |
| 22 | 22 |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 std::unique_ptr<DisplayColorManager::ColorCalibrationData> ParseDisplayProfile( | 25 std::unique_ptr<DisplayColorManager::ColorCalibrationData> ParseDisplayProfile( |
| 26 const base::FilePath& path, | 26 const base::FilePath& path, |
| 27 bool has_color_correction_matrix) { | 27 bool has_color_correction_matrix) { |
| 28 VLOG(1) << "Trying ICC file " << path.value() | 28 VLOG(1) << "Trying ICC file " << path.value() |
| 29 << " has_color_correction_matrix: " | 29 << " has_color_correction_matrix: " |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 if (!configurator_->SetColorCorrection(display_id, data->degamma_lut, | 180 if (!configurator_->SetColorCorrection(display_id, data->degamma_lut, |
| 181 data->gamma_lut, | 181 data->gamma_lut, |
| 182 data->correction_matrix)) | 182 data->correction_matrix)) |
| 183 LOG(WARNING) << "Error applying color correction data"; | 183 LOG(WARNING) << "Error applying color correction data"; |
| 184 } | 184 } |
| 185 } | 185 } |
| 186 | 186 |
| 187 void DisplayColorManager::LoadCalibrationForDisplay( | 187 void DisplayColorManager::LoadCalibrationForDisplay( |
| 188 const ui::DisplaySnapshot* display) { | 188 const ui::DisplaySnapshot* display) { |
| 189 DCHECK(thread_checker_.CalledOnValidThread()); | 189 DCHECK(thread_checker_.CalledOnValidThread()); |
| 190 if (display->display_id() == gfx::Display::kInvalidDisplayID) { | 190 if (display->display_id() == display::Display::kInvalidDisplayID) { |
| 191 LOG(WARNING) << "Trying to load calibration data for invalid display id"; | 191 LOG(WARNING) << "Trying to load calibration data for invalid display id"; |
| 192 return; | 192 return; |
| 193 } | 193 } |
| 194 | 194 |
| 195 quirks::QuirksManager::Get()->RequestIccProfilePath( | 195 quirks::QuirksManager::Get()->RequestIccProfilePath( |
| 196 display->product_id(), | 196 display->product_id(), |
| 197 base::Bind(&DisplayColorManager::FinishLoadCalibrationForDisplay, | 197 base::Bind(&DisplayColorManager::FinishLoadCalibrationForDisplay, |
| 198 weak_ptr_factory_.GetWeakPtr(), display->display_id(), | 198 weak_ptr_factory_.GetWeakPtr(), display->display_id(), |
| 199 display->product_id(), display->has_color_correction_matrix(), | 199 display->product_id(), display->has_color_correction_matrix(), |
| 200 display->type())); | 200 display->type())); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 calibration_map_[product_id] = data.release(); | 243 calibration_map_[product_id] = data.release(); |
| 244 ApplyDisplayColorCalibration(display_id, product_id); | 244 ApplyDisplayColorCalibration(display_id, product_id); |
| 245 } | 245 } |
| 246 } | 246 } |
| 247 | 247 |
| 248 DisplayColorManager::ColorCalibrationData::ColorCalibrationData() {} | 248 DisplayColorManager::ColorCalibrationData::ColorCalibrationData() {} |
| 249 | 249 |
| 250 DisplayColorManager::ColorCalibrationData::~ColorCalibrationData() {} | 250 DisplayColorManager::ColorCalibrationData::~ColorCalibrationData() {} |
| 251 | 251 |
| 252 } // namespace ash | 252 } // namespace ash |
| OLD | NEW |