surfaceflinger: fix video color conversion in WCG am: db06e5e561
am: 01d8fd9204
Change-Id: I4a8df4df95d71c4ba13bb224dfe44ee393cca99d
diff --git a/services/surfaceflinger/RenderEngine/GLES20RenderEngine.cpp b/services/surfaceflinger/RenderEngine/GLES20RenderEngine.cpp
index 0fb3d28..1efe0ac 100644
--- a/services/surfaceflinger/RenderEngine/GLES20RenderEngine.cpp
+++ b/services/surfaceflinger/RenderEngine/GLES20RenderEngine.cpp
@@ -321,10 +321,16 @@
default:
// treat all other dataspaces as sRGB
wideColorState.setColorMatrix(mState.getColorMatrix() * mSrgbToDisplayP3);
- if ((mDataSpace & Dataspace::TRANSFER_MASK) & Dataspace::TRANSFER_LINEAR) {
- wideColorState.setInputTransferFunction(Description::TransferFunction::LINEAR);
- } else {
- wideColorState.setInputTransferFunction(Description::TransferFunction::SRGB);
+ switch (static_cast<Dataspace>(mDataSpace & Dataspace::TRANSFER_MASK)) {
+ case Dataspace::TRANSFER_LINEAR:
+ wideColorState.setInputTransferFunction(
+ Description::TransferFunction::LINEAR);
+ break;
+ default:
+ // treat all other transfer functions as sRGB
+ wideColorState.setInputTransferFunction(
+ Description::TransferFunction::SRGB);
+ break;
}
wideColorState.setOutputTransferFunction(Description::TransferFunction::SRGB);
ALOGV("drawMesh: gamut transform applied");