summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2013-09-05 18:55:29 -0700
committerMathias Agopian <mathias@google.com>2013-09-05 18:58:51 -0700
commit97f0aa6f8a8b7c1ed41786404423b9c9fcf789b8 (patch)
tree914f7955fd49ed9492514c0633f5ca70aa4eabd6 /services
parentde59baab31271a186a2f32719abd19a8adbda1e3 (diff)
downloadframeworks_base-97f0aa6f8a8b7c1ed41786404423b9c9fcf789b8.zip
frameworks_base-97f0aa6f8a8b7c1ed41786404423b9c9fcf789b8.tar.gz
frameworks_base-97f0aa6f8a8b7c1ed41786404423b9c9fcf789b8.tar.bz2
tweak the electron beam animation a bit
we make the "beam" vanish in the center of the screen. Bug: 10641933 Change-Id: I61fdb4d46e9f62dc80d65356a884dff0b177384a
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/power/ElectronBeam.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/services/java/com/android/server/power/ElectronBeam.java b/services/java/com/android/server/power/ElectronBeam.java
index 379e704..0d92f66 100644
--- a/services/java/com/android/server/power/ElectronBeam.java
+++ b/services/java/com/android/server/power/ElectronBeam.java
@@ -319,10 +319,10 @@ final class ElectronBeam {
/**
* Draws a frame where the electron beam has been stretched out into
- * a thin white horizontal line that fades as it expands outwards.
+ * a thin white horizontal line that fades as it collapses inwards.
*
- * @param stretch The stretch factor. 0.0 is no stretch / no fade,
- * 1.0 is maximum stretch / maximum fade.
+ * @param stretch The stretch factor. 0.0 is maximum stretch / no fade,
+ * 1.0 is collapsed / maximum fade.
*/
private void drawHStretch(float stretch) {
// compute interpolation scale factor
@@ -338,7 +338,7 @@ final class ElectronBeam {
// draw narrow fading white line
setHStretchQuad(mVertexBuffer, mDisplayWidth, mDisplayHeight, ag);
- GLES10.glColor4f(1.0f - ag, 1.0f - ag, 1.0f - ag, 1.0f);
+ GLES10.glColor4f(1.0f - ag*0.75f, 1.0f - ag*0.75f, 1.0f - ag*0.75f, 1.0f);
GLES10.glDrawArrays(GLES10.GL_TRIANGLE_FAN, 0, 4);
// clean up
@@ -355,7 +355,7 @@ final class ElectronBeam {
}
private static void setHStretchQuad(FloatBuffer vtx, float dw, float dh, float a) {
- final float w = dw + (dw * a);
+ final float w = 2 * dw * (1.0f - a);
final float h = 1.0f;
final float x = (dw - w) * 0.5f;
final float y = (dh - h) * 0.5f;