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

Unified Diff: ui/ozone/platform/drm/gpu/drm_display.cc

Issue 1182063002: Add support for more advanced color correction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@qcms-fixed-point-gamma
Patch Set: Integrate dnicoara@ feedback Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: ui/ozone/platform/drm/gpu/drm_display.cc
diff --git a/ui/ozone/platform/drm/gpu/drm_display.cc b/ui/ozone/platform/drm/gpu/drm_display.cc
index 076cc59d356302ed9e79a8a47dbaebea13d1e27b..f4b59746859fc63737ccf98a1a4bef7e0937de00 100644
--- a/ui/ozone/platform/drm/gpu/drm_display.cc
+++ b/ui/ozone/platform/drm/gpu/drm_display.cc
@@ -170,10 +170,21 @@ bool DrmDisplay::SetHDCPState(HDCPState state) {
GetContentProtectionValue(hdcp_property.get(), state));
}
-void DrmDisplay::SetGammaRamp(const std::vector<GammaRampRGBEntry>& lut) {
- if (!drm_->SetGammaRamp(crtc_, lut)) {
- LOG(ERROR) << "Failed to set gamma ramp for display: crtc_id = " << crtc_
- << " size = " << lut.size();
+void DrmDisplay::SetColorCorrection(
+ const std::vector<GammaRampRGBEntry>& degamma_lut,
+ const std::vector<GammaRampRGBEntry>& gamma_lut,
+ const std::vector<float>& correction_matrix) {
+ if (degamma_lut.size() == 0) {
+ if (!drm_->SetGammaRamp(crtc_, gamma_lut)) {
+ LOG(ERROR) << "Failed to set gamma ramp for display: crtc_id = " << crtc_
+ << " size = " << gamma_lut.size();
spang 2016/02/22 18:57:51 PLOG?
+ }
+ } else {
+ if (!drm_->SetColorCorrection(crtc_, degamma_lut, gamma_lut,
+ correction_matrix)) {
+ LOG(ERROR) << "Failed to set color correction for display: crtc_id = "
+ << crtc_;
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698