| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 if (!display_profile) { | 39 if (!display_profile) { |
| 40 LOG(WARNING) << "Unable to load ICC file: " << path.value(); | 40 LOG(WARNING) << "Unable to load ICC file: " << path.value(); |
| 41 return false; | 41 return false; |
| 42 } | 42 } |
| 43 | 43 |
| 44 size_t vcgt_channel_length = | 44 size_t vcgt_channel_length = |
| 45 qcms_profile_get_vcgt_channel_length(display_profile); | 45 qcms_profile_get_vcgt_channel_length(display_profile); |
| 46 if (!vcgt_channel_length) { | 46 if (!vcgt_channel_length) { |
| 47 LOG(WARNING) << "No vcgt table in ICC file: " << path.value(); | 47 LOG(WARNING) << "No vcgt table in ICC file: " << path.value(); |
| 48 qcms_profile_release(display_profile); |
| 48 return false; | 49 return false; |
| 49 } | 50 } |
| 50 | 51 |
| 51 std::vector<uint16_t> vcgt_data; | 52 std::vector<uint16_t> vcgt_data; |
| 52 vcgt_data.resize(vcgt_channel_length * 3); | 53 vcgt_data.resize(vcgt_channel_length * 3); |
| 53 if (!qcms_profile_get_vcgt_rgb_channels(display_profile, &vcgt_data[0])) { | 54 if (!qcms_profile_get_vcgt_rgb_channels(display_profile, &vcgt_data[0])) { |
| 54 LOG(WARNING) << "Unable to get vcgt data"; | 55 LOG(WARNING) << "Unable to get vcgt data"; |
| 55 qcms_profile_release(display_profile); | 56 qcms_profile_release(display_profile); |
| 56 return false; | 57 return false; |
| 57 } | 58 } |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 calibration_map_[product_id] = data.release(); | 155 calibration_map_[product_id] = data.release(); |
| 155 ApplyDisplayColorCalibration(display_id, product_id); | 156 ApplyDisplayColorCalibration(display_id, product_id); |
| 156 } | 157 } |
| 157 } | 158 } |
| 158 | 159 |
| 159 DisplayColorManager::ColorCalibrationData::ColorCalibrationData() {} | 160 DisplayColorManager::ColorCalibrationData::ColorCalibrationData() {} |
| 160 | 161 |
| 161 DisplayColorManager::ColorCalibrationData::~ColorCalibrationData() {} | 162 DisplayColorManager::ColorCalibrationData::~ColorCalibrationData() {} |
| 162 | 163 |
| 163 } // namespace ash | 164 } // namespace ash |
| OLD | NEW |