Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 01d8fd92 authored by Chia-I Wu's avatar Chia-I Wu Committed by android-build-merger
Browse files

surfaceflinger: fix video color conversion in WCG

am: db06e5e5

Change-Id: Iac94999508fe2d141aad9bd87f694a80b0d11497
parents 0c3a97bf db06e5e5
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -321,10 +321,16 @@ void GLES20RenderEngine::drawMesh(const Mesh& mesh) {
            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");