Add saturation boost feature to SurfaceFlinger
Bug: 62238038
Test: adb shell service call SurfaceFlinger 1022 f 1.5
The saturation boost will be set by framework to increase
the visual appeal of the sRGB mode. It simply modifies the
color transform matrix based on the supplied value (from
0.0 for black and white to 2.0 for 100% extra saturation).
Change-Id: I9832fbe0361acacc8b17300c37c006792c6c1618
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 1bc689d..68a088a 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -511,8 +511,10 @@
// Given a dataSpace, returns the appropriate color_mode to use
// to display that dataSpace.
- android_color_mode pickColorMode(android_dataspace dataSpace);
- android_dataspace bestTargetDataSpace(android_dataspace a, android_dataspace b);
+ android_color_mode pickColorMode(android_dataspace dataSpace) const;
+ android_dataspace bestTargetDataSpace(android_dataspace a, android_dataspace b) const;
+
+ mat4 computeSaturationMatrix() const;
void setUpHWComposer();
void doComposition();
@@ -747,7 +749,9 @@
std::atomic<bool> mVrFlingerRequestsDisplay;
static bool useVrFlinger;
#endif
- };
+
+ float mSaturation = 1.0f;
+};
}; // namespace android
#endif // ANDROID_SURFACE_FLINGER_H