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

Commit b0094482 authored by Peiyong Lin's avatar Peiyong Lin
Browse files

[RenderEngine] Support extended SRGB transform.

Previously RenderEngine didn't support linear extended SRGB transform,
results in color faded-out, darker image in Photos. This patch adds
support for linear extended SRGB transform.

BUG: 72810755
Test: Build, flash and test with Photos
Change-Id: I071ae090a22a4727d6a20b41952f6281ed678260
parent 0d3890a9
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -330,6 +330,11 @@ void GLES20RenderEngine::drawMesh(const Mesh& mesh) {
            case HAL_DATASPACE_DISPLAY_P3:
                // input matches output
                break;
            case HAL_DATASPACE_V0_SCRGB_LINEAR:
                wideColorState.setColorMatrix(mState.getColorMatrix() * mSrgbToDisplayP3);
                wideColorState.setInputTransferFunction(Description::TransferFunction::LINEAR);
                wideColorState.setOutputTransferFunction(Description::TransferFunction::SRGB);
                break;
            case HAL_DATASPACE_BT2020_PQ:
            case HAL_DATASPACE_BT2020_ITU_PQ:
                wideColorState.setColorMatrix(mState.getColorMatrix() * mBt2020ToDisplayP3);