[SurfaceFlinger] Implement per layer color transformation.
Previously we introduced a new composer HAL API to set color transform for per
layer and added the plumbing in SurfaceFlinger. This patch implements the
functionality and alwasy mark those layers to fall back to GPU composition
until composer 2.3 is implemented.
BUG: 111562338
Test: Build, boot, flash, tested by setting a greyscale matrix on Settings
Test: adb shell /data/nativetest/SurfaceFlinger_test/SurfaceFlinger_test
Change-Id: If8d5ed52bf920d8cc962602196fb1b0b6e2955da
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 874b551..4890fa6 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -181,6 +181,7 @@
int32_t api;
sp<NativeHandle> sidebandStream;
+ mat4 colorTransform;
};
explicit Layer(const LayerCreationArgs& args);
@@ -255,6 +256,9 @@
virtual void setChildrenDrawingParent(const sp<Layer>& layer);
virtual bool reparent(const sp<IBinder>& newParentHandle);
virtual bool detachChildren();
+ virtual bool setColorTransform(const mat4& matrix);
+ virtual const mat4& getColorTransform() const;
+ virtual bool hasColorTransform() const;
// Used only to set BufferStateLayer state
virtual bool setTransform(uint32_t /*transform*/) { return false; };