[SurfaceFlinger] Add methods for setting legacy starution matrix.
This patch adds methods for setting legacy saturation matrix for legacy sRGB
content. Previously it was combined into the color transform matrix which was
applied right before applying OETF, however, we want to apply the legacy
staturation matrix right after applying EOTF.
BUG: 78891890
Test: build
Change-Id: I7709eab0857822e48c49237d6681f6e337b4d29e
diff --git a/services/surfaceflinger/RenderEngine/Description.cpp b/services/surfaceflinger/RenderEngine/Description.cpp
index c218e4d..09414fd 100644
--- a/services/surfaceflinger/RenderEngine/Description.cpp
+++ b/services/surfaceflinger/RenderEngine/Description.cpp
@@ -51,6 +51,10 @@
mProjectionMatrix = mtx;
}
+void Description::setSaturationMatrix(const mat4& mtx) {
+ mSaturationMatrix = mtx;
+}
+
void Description::setColorMatrix(const mat4& mtx) {
mColorMatrix = mtx;
}
@@ -78,6 +82,11 @@
return mColorMatrix != identity;
}
+bool Description::hasSaturationMatrix() const {
+ const mat4 identity;
+ return mSaturationMatrix != identity;
+}
+
const mat4& Description::getColorMatrix() const {
return mColorMatrix;
}