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/ozone/platform/drm/gpu/drm_gpu_display_manager.h" | 5 #include "ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h" |
6 | 6 |
7 #include "ui/display/types/gamma_ramp_rgb_entry.h" | 7 #include "ui/display/types/gamma_ramp_rgb_entry.h" |
8 #include "ui/ozone/common/display_util.h" | 8 #include "ui/ozone/common/display_util.h" |
9 #include "ui/ozone/platform/drm/common/drm_util.h" | 9 #include "ui/ozone/platform/drm/common/drm_util.h" |
10 #include "ui/ozone/platform/drm/gpu/drm_device.h" | 10 #include "ui/ozone/platform/drm/gpu/drm_device.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 const std::vector<GammaRampRGBEntry>& lut) { | 185 const std::vector<GammaRampRGBEntry>& lut) { |
186 DrmDisplay* display = FindDisplay(display_id); | 186 DrmDisplay* display = FindDisplay(display_id); |
187 if (!display) { | 187 if (!display) { |
188 LOG(ERROR) << "There is no display with ID " << display_id; | 188 LOG(ERROR) << "There is no display with ID " << display_id; |
189 return; | 189 return; |
190 } | 190 } |
191 | 191 |
192 display->SetGammaRamp(lut); | 192 display->SetGammaRamp(lut); |
193 } | 193 } |
194 | 194 |
| 195 void DrmGpuDisplayManager::SetColorCorrection( |
| 196 int64_t display_id, |
| 197 const std::vector<GammaRampRGBEntry>& degamma_lut, |
| 198 const std::vector<GammaRampRGBEntry>& gamma_lut, |
| 199 const float correction_matrix[9]) { |
| 200 DrmDisplay* display = FindDisplay(display_id); |
| 201 if (!display) { |
| 202 LOG(ERROR) << "There is no display with ID " << display_id; |
| 203 return; |
| 204 } |
| 205 |
| 206 display->SetColorCorrection(degamma_lut, gamma_lut, correction_matrix); |
| 207 } |
| 208 |
195 DrmDisplay* DrmGpuDisplayManager::FindDisplay(int64_t display_id) { | 209 DrmDisplay* DrmGpuDisplayManager::FindDisplay(int64_t display_id) { |
196 for (DrmDisplay* display : displays_) | 210 for (DrmDisplay* display : displays_) |
197 if (display->display_id() == display_id) | 211 if (display->display_id() == display_id) |
198 return display; | 212 return display; |
199 | 213 |
200 return nullptr; | 214 return nullptr; |
201 } | 215 } |
202 | 216 |
203 void DrmGpuDisplayManager::NotifyScreenManager( | 217 void DrmGpuDisplayManager::NotifyScreenManager( |
204 const std::vector<DrmDisplay*>& new_displays, | 218 const std::vector<DrmDisplay*>& new_displays, |
(...skipping 16 matching lines...) Expand all Loading... |
221 | 235 |
222 if (it == old_displays.end()) { | 236 if (it == old_displays.end()) { |
223 screen_manager_->AddDisplayController(new_displays[i]->drm(), | 237 screen_manager_->AddDisplayController(new_displays[i]->drm(), |
224 new_displays[i]->crtc(), | 238 new_displays[i]->crtc(), |
225 new_displays[i]->connector()); | 239 new_displays[i]->connector()); |
226 } | 240 } |
227 } | 241 } |
228 } | 242 } |
229 | 243 |
230 } // namespace ui | 244 } // namespace ui |
OLD | NEW |