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

Commit a0ec96f1 authored by Lucas Dupin's avatar Lucas Dupin Committed by Android (Google) Code Review
Browse files

Merge "Constant sparkle scale" into sc-dev

parents a75009f5 9f6fb354
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -975,7 +975,7 @@ public class RippleDrawable extends LayerDrawable {
        shader.setColor(color, effectColor);
        shader.setOrigin(cx, cy);
        shader.setTouch(x, y);
        shader.setResolution(w, h, mState.mDensity);
        shader.setResolution(w, h);
        shader.setNoisePhase(noisePhase);
        shader.setRadius(radius);
        shader.setProgress(.0f);
+2 −3
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ import android.annotation.ColorInt;
import android.graphics.Color;
import android.graphics.RuntimeShader;
import android.graphics.Shader;
import android.util.DisplayMetrics;

final class RippleShader extends RuntimeShader {
    private static final String SHADER_UNIFORMS =  "uniform vec2 in_origin;\n"
@@ -204,8 +203,8 @@ final class RippleShader extends RuntimeShader {
                sparkleColor.green(), sparkleColor.blue(), sparkleColor.alpha()});
    }

    public void setResolution(float w, float h, int density) {
        final float densityScale = density * DisplayMetrics.DENSITY_DEFAULT_SCALE * 0.8f;
    public void setResolution(float w, float h) {
        final float densityScale = 2.1f;
        setUniform("in_resolutionScale", new float[] {1f / w, 1f / h});
        setUniform("in_noiseScale", new float[] {densityScale / w, densityScale / h});
    }