diff options
author | Chet Haase <chet@google.com> | 2012-08-09 14:16:29 -0700 |
---|---|---|
committer | Chet Haase <chet@google.com> | 2012-08-09 14:16:29 -0700 |
commit | 9b5599894b80b2707909e8e6872eeec7c58af73a (patch) | |
tree | 481011b0bb5d0a82707a642785f98a59a46a21b8 /core/java/android/animation | |
parent | 7c46e4380e6c50c30aad80807f87af25f000c7ff (diff) | |
download | frameworks_base-9b5599894b80b2707909e8e6872eeec7c58af73a.zip frameworks_base-9b5599894b80b2707909e8e6872eeec7c58af73a.tar.gz frameworks_base-9b5599894b80b2707909e8e6872eeec7c58af73a.tar.bz2 |
Fix shift/mask error in ArtbEvaluator
Shifting from the left copies the MSB along with it. This causes a problem
in ArgbEvaluator, which shifts the top byte down by 24 for the start/end
colors, and then uses those values to interpolate alpha values. The correct
appraoch (used with the other color components) is to mask by 0xff after the
shift.
Issue #6960514 External bug: ArgbEvaluator can't evaluate alpha value properly
Change-Id: I750d38ddfecc5f30d8dab7c6d27d1a7ac06361c3
Diffstat (limited to 'core/java/android/animation')
-rw-r--r-- | core/java/android/animation/ArgbEvaluator.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/animation/ArgbEvaluator.java b/core/java/android/animation/ArgbEvaluator.java index c3875be..717a3d9 100644 --- a/core/java/android/animation/ArgbEvaluator.java +++ b/core/java/android/animation/ArgbEvaluator.java @@ -40,13 +40,13 @@ public class ArgbEvaluator implements TypeEvaluator { */ public Object evaluate(float fraction, Object startValue, Object endValue) { int startInt = (Integer) startValue; - int startA = (startInt >> 24); + int startA = (startInt >> 24) & 0xff; int startR = (startInt >> 16) & 0xff; int startG = (startInt >> 8) & 0xff; int startB = startInt & 0xff; int endInt = (Integer) endValue; - int endA = (endInt >> 24); + int endA = (endInt >> 24) & 0xff; int endR = (endInt >> 16) & 0xff; int endG = (endInt >> 8) & 0xff; int endB = endInt & 0xff; |