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

Commit 13b069bc authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "In SkSL, replace 'sample' with '.eval'"

parents c7de0976 a0ea3b7b
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -39,14 +39,14 @@ BlurFilter::BlurFilter() {
        uniform float2 in_maxSizeXY;

        half4 main(float2 xy) {
            half4 c = sample(input, xy);
            c += sample(input, float2( clamp( in_blurOffset.x + xy.x, 0, in_maxSizeXY.x),
            half4 c = input.eval(xy);
            c += input.eval(float2(clamp( in_blurOffset.x + xy.x, 0, in_maxSizeXY.x),
                                   clamp( in_blurOffset.y + xy.y, 0, in_maxSizeXY.y)));
            c += sample(input, float2( clamp( in_blurOffset.x + xy.x, 0, in_maxSizeXY.x),
            c += input.eval(float2(clamp( in_blurOffset.x + xy.x, 0, in_maxSizeXY.x),
                                   clamp(-in_blurOffset.y + xy.y, 0, in_maxSizeXY.y)));
            c += sample(input, float2( clamp( -in_blurOffset.x + xy.x, 0, in_maxSizeXY.x),
            c += input.eval(float2(clamp(-in_blurOffset.x + xy.x, 0, in_maxSizeXY.x),
                                   clamp( in_blurOffset.y + xy.y, 0, in_maxSizeXY.y)));
            c += sample(input, float2( clamp( -in_blurOffset.x + xy.x, 0, in_maxSizeXY.x),
            c += input.eval(float2(clamp(-in_blurOffset.x + xy.x, 0, in_maxSizeXY.x),
                                   clamp(-in_blurOffset.y + xy.y, 0, in_maxSizeXY.y)));

            return half4(c.rgb * 0.2, 1.0);
@@ -65,7 +65,7 @@ BlurFilter::BlurFilter() {
        uniform float mixFactor;

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

+1 −1
Original line number Diff line number Diff line
@@ -391,7 +391,7 @@ static void generateEffectiveOOTF(bool undoPremultipliedAlpha, SkString& shader)
    shader.append(R"(
        uniform shader input;
        half4 main(float2 xy) {
            float4 c = float4(sample(input, xy));
            float4 c = float4(input.eval(xy));
    )");
    if (undoPremultipliedAlpha) {
        shader.append(R"(
+1 −1
Original line number Diff line number Diff line
@@ -184,7 +184,7 @@ static const SkString stretchShader = SkString(R"(
        );
        coord.x = (outU - uScrollX) * viewportWidth;
        coord.y = (outV - uScrollY) * viewportHeight;
        return sample(uContentTexture, coord);
        return uContentTexture.eval(coord);
    })");

const float INTERPOLATION_STRENGTH_VALUE = 0.7f;