summaryrefslogtreecommitdiffstats
path: root/core/java/android/view/View.java
diff options
context:
space:
mode:
authorChet Haase <chet@google.com>2012-05-10 13:21:10 -0700
committerChet Haase <chet@google.com>2012-05-10 14:16:44 -0700
commitafd5c3ee60c45ebb5d63d2d0d14f08130075883b (patch)
treed5ba9a325578a2ded32ef63e296ee660d0a2138c /core/java/android/view/View.java
parent0891a89790777e2f88f413351fafe49dda36714f (diff)
downloadframeworks_base-afd5c3ee60c45ebb5d63d2d0d14f08130075883b.zip
frameworks_base-afd5c3ee60c45ebb5d63d2d0d14f08130075883b.tar.gz
frameworks_base-afd5c3ee60c45ebb5d63d2d0d14f08130075883b.tar.bz2
Clear animations in DisplayLists when done
The matrix calculated by Animations is pushed down to the native DisplayList object, and is then used when the DL is issued to the GL renderer. This works while the animation is running, but the end of animations is not handled correctly. In particular, we never clear the animation, so whatever the last frame of the animation calculated will persist on that DisplayList object until it is recreated. The fix is to note when we used to be animating and are no longer doing so, taking that opportunity to push the cleared state down to the DisplayList. Issue #6448993 action bar -- including settings menu -- disappears on Nakasi Change-Id: I73cdadaef40d87ccbc1beb02599c4d70506ea42b
Diffstat (limited to 'core/java/android/view/View.java')
-rw-r--r--core/java/android/view/View.java36
1 files changed, 27 insertions, 9 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index aad6756..75241f6 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -2128,6 +2128,13 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
*/
static final int ACCESSIBILITY_STATE_CHANGED = 0x00000080 << IMPORTANT_FOR_ACCESSIBILITY_SHIFT;
+ /**
+ * Flag indicating that view has an animation set on it. This is used to track whether an
+ * animation is cleared between successive frames, in order to tell the associated
+ * DisplayList to clear its animation matrix.
+ */
+ static final int VIEW_IS_ANIMATING_TRANSFORM = 0x10000000;
+
/* End of masks for mPrivateFlags2 */
static final int DRAG_MASK = DRAG_CAN_ACCEPT | DRAG_HOVERED;
@@ -12764,16 +12771,27 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
if (a != null) {
more = drawAnimation(parent, drawingTime, a, scalingRequired);
concatMatrix = a.willChangeTransformationMatrix();
+ if (concatMatrix) {
+ mPrivateFlags2 |= VIEW_IS_ANIMATING_TRANSFORM;
+ }
transformToApply = parent.mChildTransformation;
- } else if (!useDisplayListProperties &&
- (flags & ViewGroup.FLAG_SUPPORT_STATIC_TRANSFORMATIONS) != 0) {
- final boolean hasTransform =
- parent.getChildStaticTransformation(this, parent.mChildTransformation);
- if (hasTransform) {
- final int transformType = parent.mChildTransformation.getTransformationType();
- transformToApply = transformType != Transformation.TYPE_IDENTITY ?
- parent.mChildTransformation : null;
- concatMatrix = (transformType & Transformation.TYPE_MATRIX) != 0;
+ } else {
+ if ((mPrivateFlags2 & VIEW_IS_ANIMATING_TRANSFORM) == VIEW_IS_ANIMATING_TRANSFORM &&
+ mDisplayList != null) {
+ // No longer animating: clear out old animation matrix
+ mDisplayList.setAnimationMatrix(null);
+ mPrivateFlags2 &= ~VIEW_IS_ANIMATING_TRANSFORM;
+ }
+ if (!useDisplayListProperties &&
+ (flags & ViewGroup.FLAG_SUPPORT_STATIC_TRANSFORMATIONS) != 0) {
+ final boolean hasTransform =
+ parent.getChildStaticTransformation(this, parent.mChildTransformation);
+ if (hasTransform) {
+ final int transformType = parent.mChildTransformation.getTransformationType();
+ transformToApply = transformType != Transformation.TYPE_IDENTITY ?
+ parent.mChildTransformation : null;
+ concatMatrix = (transformType & Transformation.TYPE_MATRIX) != 0;
+ }
}
}