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

Commit 15d26578 authored by Brian Osman's avatar Brian Osman
Browse files

Update RenderEngine to use newer SkRuntimeEffect::MakeForShader

This enforces stricter rules on the SkSL at effect creation time, and
ensures it's valid as an SkShader (vs. an SkColorFilter).

Bug: skia:11813
Change-Id: Iddba9361a453fd4adc8ffd8fd41c0b0ab2905fad
(cherry picked from commit fe13a4a8)
parent 3654df01
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ BlurFilter::BlurFilter() {
        }
    )");

    auto [blurEffect, error] = SkRuntimeEffect::Make(blurString);
    auto [blurEffect, error] = SkRuntimeEffect::MakeForShader(blurString);
    if (!blurEffect) {
        LOG_ALWAYS_FATAL("RuntimeShader error: %s", error.c_str());
    }
@@ -65,11 +65,11 @@ BlurFilter::BlurFilter() {
        uniform float mixFactor;

        half4 main(float2 xy) {
            return half4(mix(sample(originalInput), sample(blurredInput), mixFactor));
            return half4(mix(sample(originalInput, xy), sample(blurredInput, xy), mixFactor));
        }
    )");

    auto [mixEffect, mixError] = SkRuntimeEffect::Make(mixString);
    auto [mixEffect, mixError] = SkRuntimeEffect::MakeForShader(mixString);
    if (!mixEffect) {
        LOG_ALWAYS_FATAL("RuntimeShader error: %s", mixError.c_str());
    }
+1 −1
Original line number Diff line number Diff line
@@ -438,7 +438,7 @@ sk_sp<SkRuntimeEffect> buildRuntimeEffect(const LinearEffect& linearEffect) {
    generateOETF(linearEffect.outputDataspace, shaderString);
    generateEffectiveOOTF(linearEffect.undoPremultipliedAlpha, shaderString);

    auto [shader, error] = SkRuntimeEffect::Make(shaderString);
    auto [shader, error] = SkRuntimeEffect::MakeForShader(shaderString);
    if (!shader) {
        LOG_ALWAYS_FATAL("LinearColorFilter construction error: %s", error.c_str());
    }