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

Commit 6e73a8af authored by Michael Ludwig's avatar Michael Ludwig
Browse files

Wrap the linear effect color filter in a makeWithWorkingColorSpace()

This enables more coordination with Skia's internal color management and
keeps behavior consistent now that that the SkSL of the generated linear
effect assumes its operating in a linear context.

Flag: EXEMPT bug fix
Bug: b/426596235
Change-Id: I12bae2f565b4c2f845eab5e337499257e27bfcbf
parent 948a1c44
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -71,7 +71,16 @@ static sk_sp<SkColorFilter> createLinearEffectColorFilter(const shaders::LinearE
        effectBuilder.uniform(uniform.name.c_str()).set(uniform.value.data(), uniform.value.size());
    }

    return effectBuilder.makeColorFilter();
    auto filter = effectBuilder.makeColorFilter();
    if (filter) {
        // HWUI does not use the fakeDataspace, so there is no need to override the output space
        // of the working color space filter.
        sk_sp<SkColorSpace> inputSpace =
                DataSpaceToColorSpace(static_cast<android_dataspace>(linearEffect.inputDataspace))
                        ->makeLinearGamma();
        filter = filter->makeWithWorkingColorSpace(inputSpace);
    }
    return filter;
}

static ui::Dataspace extractTransfer(ui::Dataspace dataspace) {