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

Commit cd223583 authored by Peiyong Lin's avatar Peiyong Lin Committed by android-build-merger
Browse files

Merge "[RenderEngine] Convert BT2020 to SRGB by default." into pi-dev

am: 1236c388

Change-Id: I21d1285ab8b41b6879e3760702388e7a19059dab
parents ea3f68ff 1236c388
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -147,6 +147,7 @@ GLES20RenderEngine::GLES20RenderEngine(uint32_t featureFlags)
        mSrgbToXyz = srgb.getRGBtoXYZ();
        mDisplayP3ToXyz = displayP3.getRGBtoXYZ();
        mBt2020ToXyz = bt2020.getRGBtoXYZ();
        mXyzToSrgb = mat4(srgb.getXYZtoRGB());
        mXyzToDisplayP3 = mat4(displayP3.getXYZtoRGB());
        mXyzToBt2020 = mat4(bt2020.getXYZtoRGB());
    }
@@ -347,14 +348,17 @@ void GLES20RenderEngine::drawMesh(const Mesh& mesh) {
                    break;
            }

            // The supported output color spaces are Display P3 and BT2020.
            // The supported output color spaces are BT2020, Display P3 and standard RGB.
            switch (outputStandard) {
                case Dataspace::STANDARD_BT2020:
                    wideColorState.setOutputTransformMatrix(mXyzToBt2020);
                    break;
                default:
                case Dataspace::STANDARD_DCI_P3:
                    wideColorState.setOutputTransformMatrix(mXyzToDisplayP3);
                    break;
                default:
                    wideColorState.setOutputTransformMatrix(mXyzToSrgb);
                    break;
            }
        } else if (inputStandard != outputStandard) {
            // At this point, the input data space and output data space could be both
+1 −0
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@ protected:
    mat3 mSrgbToXyz;
    mat3 mBt2020ToXyz;
    mat3 mDisplayP3ToXyz;
    mat4 mXyzToSrgb;
    mat4 mXyzToDisplayP3;
    mat4 mXyzToBt2020;