[SurfaceFlinger] Make sure data space is set correctly
This patch makes sure data space is set correctly for native window.
Previously, the data space could be unknown.
BUG: 77652630
BUG: 78025830
Test: Build, flash, watch some videos
Change-Id: I3096ebaecda35838493e0d5e2efdf141eff0b75e
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index 8c0050e..3a71188 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -1643,19 +1643,9 @@
return true;
}
-// Dataspace::UNKNOWN, Dataspace::SRGB, Dataspace::SRGB_LINEAR,
-// Dataspace::V0_SRGB and Dataspace::V0_SRGB_LINEAR are considered legacy
-// SRGB data space for now.
-// Note that Dataspace::V0_SRGB and Dataspace::V0_SRGB_LINEAR are not legacy
-// data space, however since framework doesn't distinguish them out of legacy
-// SRGB, we have to treat them as the same for now.
bool Layer::isLegacySrgbDataSpace() const {
- // TODO(lpy) b/77652630, need to figure out when UNKNOWN can be treated as SRGB.
- return mDrawingState.dataSpace == ui::Dataspace::UNKNOWN ||
- mDrawingState.dataSpace == ui::Dataspace::SRGB ||
- mDrawingState.dataSpace == ui::Dataspace::SRGB_LINEAR ||
- mDrawingState.dataSpace == ui::Dataspace::V0_SRGB ||
- mDrawingState.dataSpace == ui::Dataspace::V0_SRGB_LINEAR;
+ return mDrawingState.dataSpace == ui::Dataspace::SRGB ||
+ mDrawingState.dataSpace == ui::Dataspace::SRGB_LINEAR;
}
void Layer::setParent(const sp<Layer>& layer) {