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

Commit e0da95a1 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

am: 01d8fd92

Change-Id: I4a8df4df95d71c4ba13bb224dfe44ee393cca99d
parents cd302522 01d8fd92
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");