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

Commit adb7c55d authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Remove scale effect from screen off animation

Not resizing anymore per UX guidelines.

Test: visual, press power button.
Change-Id: Ic11134cd89d35b5421d269e52ab7715318d0e180
Fixes: 36899914
Bug: 64155983
parent 84a41d66
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
uniform mat4 proj_matrix;
uniform mat4 tex_matrix;
uniform float scale;
attribute vec2 position;
attribute vec2 uv;
varying vec2 UV;
@@ -9,5 +8,5 @@ void main()
{
    vec4 transformed_uv = tex_matrix * vec4(uv.x, uv.y, 1.0, 1.0);
    UV = transformed_uv.st / transformed_uv.q;
    gl_Position = vec4(scale, scale, 1.0, 1.0) * (proj_matrix * vec4(position.x, position.y, 0.0, 1.0));
    gl_Position = proj_matrix * vec4(position.x, position.y, 0.0, 1.0);
}
+4 −7
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ final class ColorFade {
    private final float mProjMatrix[] = new float[16];
    private final int[] mGLBuffers = new int[2];
    private int mTexCoordLoc, mVertexLoc, mTexUnitLoc, mProjMatrixLoc, mTexMatrixLoc;
    private int mOpacityLoc, mScaleLoc, mGammaLoc, mSaturationLoc;
    private int mOpacityLoc, mGammaLoc, mSaturationLoc;
    private int mProgram;

    // Vertex and corresponding texture coordinates.
@@ -246,7 +246,6 @@ final class ColorFade {
        mOpacityLoc = GLES20.glGetUniformLocation(mProgram, "opacity");
        mGammaLoc = GLES20.glGetUniformLocation(mProgram, "gamma");
        mSaturationLoc = GLES20.glGetUniformLocation(mProgram, "saturation");
        mScaleLoc = GLES20.glGetUniformLocation(mProgram, "scale");
        mTexUnitLoc = GLES20.glGetUniformLocation(mProgram, "texUnit");

        GLES20.glUseProgram(mProgram);
@@ -395,9 +394,8 @@ final class ColorFade {
            double sign = cos < 0 ? -1 : 1;
            float opacity = (float) -Math.pow(one_minus_level, 2) + 1;
            float saturation = (float) Math.pow(level, 4);
            float scale = (float) ((-Math.pow(one_minus_level, 2) + 1) * 0.1d + 0.9d);
            float gamma = (float) ((0.5d * sign * Math.pow(cos, 2) + 0.5d) * 0.9d + 0.1d);
            drawFaded(opacity, 1.f / gamma, saturation, scale);
            drawFaded(opacity, 1.f / gamma, saturation);
            if (checkGlErrors("drawFrame")) {
                return false;
            }
@@ -409,10 +407,10 @@ final class ColorFade {
        return showSurface(1.0f);
    }

    private void drawFaded(float opacity, float gamma, float saturation, float scale) {
    private void drawFaded(float opacity, float gamma, float saturation) {
        if (DEBUG) {
            Slog.d(TAG, "drawFaded: opacity=" + opacity + ", gamma=" + gamma +
                        ", saturation=" + saturation + ", scale=" + scale);
                        ", saturation=" + saturation);
        }
        // Use shaders
        GLES20.glUseProgram(mProgram);
@@ -423,7 +421,6 @@ final class ColorFade {
        GLES20.glUniform1f(mOpacityLoc, opacity);
        GLES20.glUniform1f(mGammaLoc, gamma);
        GLES20.glUniform1f(mSaturationLoc, saturation);
        GLES20.glUniform1f(mScaleLoc, scale);

        // Use textures
        GLES20.glActiveTexture(GLES20.GL_TEXTURE0);