[SurfaceFlinger] Expose WCG composition preference through ISurfaceComposer API.
Previously we introduced an API to return default composition preference.
However, wide color gamut composition preference is very likely to be different
than the default composition preference. This patch also exposes this
information back to upper stack, notable HWUI, to make sure upper stack has the
flexibility to render into desired format for wide color gamut surfaces.
BUG: 111436479
Test: Build, flash and boot, run some display validation.
Change-Id: Ic05747591e62ca5f3c396704390555b7f545c31c
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index 7498f36..e5a2454 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -866,9 +866,12 @@
ComposerService::getComposerService()->setPowerMode(token, mode);
}
-status_t SurfaceComposerClient::getCompositionPreference(ui::Dataspace* dataSpace,
- ui::PixelFormat* pixelFormat) {
- return ComposerService::getComposerService()->getCompositionPreference(dataSpace, pixelFormat);
+status_t SurfaceComposerClient::getCompositionPreference(
+ ui::Dataspace* defaultDataspace, ui::PixelFormat* defaultPixelFormat,
+ ui::Dataspace* wideColorGamutDataspace, ui::PixelFormat* wideColorGamutPixelFormat) {
+ return ComposerService::getComposerService()
+ ->getCompositionPreference(defaultDataspace, defaultPixelFormat,
+ wideColorGamutDataspace, wideColorGamutPixelFormat);
}
status_t SurfaceComposerClient::clearAnimationFrameStats() {