[SurfaceFlinger] Plumb setLayerColorTransform.
setLayerColorTransform is a new compsoer HAL API to set color transform matrix
on a layer, which is applied before composition.
BUG: 111562338
Test: Build, flash, boot
Change-Id: I7ee145dcf78a7f61fac2c652f9b5e83e5aa0d1f3
diff --git a/services/surfaceflinger/DisplayHardware/HWC2.cpp b/services/surfaceflinger/DisplayHardware/HWC2.cpp
index a32ff6e..3a40648 100644
--- a/services/surfaceflinger/DisplayHardware/HWC2.cpp
+++ b/services/surfaceflinger/DisplayHardware/HWC2.cpp
@@ -781,7 +781,8 @@
: mComposer(composer),
mCapabilities(capabilities),
mDisplayId(displayId),
- mId(layerId)
+ mId(layerId),
+ mColorMatrix(android::mat4())
{
ALOGV("Created layer %" PRIu64 " on display %" PRIu64, layerId, displayId);
}
@@ -988,4 +989,14 @@
return static_cast<Error>(intError);
}
+// Composer HAL 2.3
+Error Layer::setColorTransform(const android::mat4& matrix) {
+ if (matrix == mColorMatrix) {
+ return Error::None;
+ }
+ mColorMatrix = matrix;
+ auto intError = mComposer.setLayerColorTransform(mDisplayId, mId, matrix.asArray());
+ return static_cast<Error>(intError);
+}
+
} // namespace HWC2