Loading core/java/android/view/View.java +36 −15 Original line number Diff line number Diff line Loading @@ -2114,19 +2114,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ 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; /** * Flag indicating whether a view failed the quickReject() check in draw(). This condition * is used to check whether later changes to the view's transform should invalidate the * view to force the quickReject test to run again. */ static final int VIEW_QUICK_REJECTED = 0x20000000; static final int VIEW_QUICK_REJECTED = 0x10000000; // Accessiblity constants for mPrivateFlags2 Loading @@ -2134,7 +2127,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * Shift for the bits in {@link #mPrivateFlags2} related to the * "accessibilityFocusable" attribute. */ static final int ACCESSIBILITY_FOCUSABLE_SHIFT = 30; static final int ACCESSIBILITY_FOCUSABLE_SHIFT = 29; /** * The system determines whether the view can take accessibility focus - default (recommended). Loading Loading @@ -2196,6 +2189,25 @@ public class View implements Drawable.Callback, KeyEvent.Callback, /* End of masks for mPrivateFlags2 */ /* Masks for mPrivateFlags3 */ /** * Flag indicating that view has a transform 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 = 0x1; /** * Flag indicating that view has an alpha 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 restore its alpha value. */ static final int VIEW_IS_ANIMATING_ALPHA = 0x2; /* End of masks for mPrivateFlags3 */ static final int DRAG_MASK = DRAG_CAN_ACCEPT | DRAG_HOVERED; /** Loading Loading @@ -2576,6 +2588,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, }) int mPrivateFlags; int mPrivateFlags2; int mPrivateFlags3; /** * This view's request for the visibility of the status bar. Loading Loading @@ -13022,15 +13035,15 @@ public class View implements Drawable.Callback, KeyEvent.Callback, more = drawAnimation(parent, drawingTime, a, scalingRequired); concatMatrix = a.willChangeTransformationMatrix(); if (concatMatrix) { mPrivateFlags2 |= VIEW_IS_ANIMATING_TRANSFORM; mPrivateFlags3 |= VIEW_IS_ANIMATING_TRANSFORM; } transformToApply = parent.mChildTransformation; } else { if ((mPrivateFlags2 & VIEW_IS_ANIMATING_TRANSFORM) == VIEW_IS_ANIMATING_TRANSFORM && if ((mPrivateFlags3 & 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; mPrivateFlags3 &= ~VIEW_IS_ANIMATING_TRANSFORM; } if (!useDisplayListProperties && (flags & ViewGroup.FLAG_SUPPORT_STATIC_TRANSFORMATIONS) != 0) { Loading Loading @@ -13142,7 +13155,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } float alpha = useDisplayListProperties ? 1 : getAlpha(); if (transformToApply != null || alpha < 1 || !hasIdentityMatrix()) { if (transformToApply != null || alpha < 1 || !hasIdentityMatrix() || (mPrivateFlags3 & VIEW_IS_ANIMATING_ALPHA) == VIEW_IS_ANIMATING_ALPHA) { if (transformToApply != null || !childHasIdentityMatrix) { int transX = 0; int transY = 0; Loading @@ -13168,7 +13182,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, float transformAlpha = transformToApply.getAlpha(); if (transformAlpha < 1) { alpha *= transformToApply.getAlpha(); alpha *= transformAlpha; parent.mGroupFlags |= ViewGroup.FLAG_CLEAR_TRANSFORMATION; } } Loading @@ -13180,7 +13194,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } } // Deal with alpha if it is or used to be <1 if (alpha < 1 || (mPrivateFlags3 & VIEW_IS_ANIMATING_ALPHA) == VIEW_IS_ANIMATING_ALPHA) { if (alpha < 1) { mPrivateFlags3 |= VIEW_IS_ANIMATING_ALPHA; } else { mPrivateFlags3 &= ~VIEW_IS_ANIMATING_ALPHA; } parent.mGroupFlags |= ViewGroup.FLAG_CLEAR_TRANSFORMATION; if (hasNoCache) { final int multipliedAlpha = (int) (255 * alpha); Loading Loading
core/java/android/view/View.java +36 −15 Original line number Diff line number Diff line Loading @@ -2114,19 +2114,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ 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; /** * Flag indicating whether a view failed the quickReject() check in draw(). This condition * is used to check whether later changes to the view's transform should invalidate the * view to force the quickReject test to run again. */ static final int VIEW_QUICK_REJECTED = 0x20000000; static final int VIEW_QUICK_REJECTED = 0x10000000; // Accessiblity constants for mPrivateFlags2 Loading @@ -2134,7 +2127,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * Shift for the bits in {@link #mPrivateFlags2} related to the * "accessibilityFocusable" attribute. */ static final int ACCESSIBILITY_FOCUSABLE_SHIFT = 30; static final int ACCESSIBILITY_FOCUSABLE_SHIFT = 29; /** * The system determines whether the view can take accessibility focus - default (recommended). Loading Loading @@ -2196,6 +2189,25 @@ public class View implements Drawable.Callback, KeyEvent.Callback, /* End of masks for mPrivateFlags2 */ /* Masks for mPrivateFlags3 */ /** * Flag indicating that view has a transform 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 = 0x1; /** * Flag indicating that view has an alpha 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 restore its alpha value. */ static final int VIEW_IS_ANIMATING_ALPHA = 0x2; /* End of masks for mPrivateFlags3 */ static final int DRAG_MASK = DRAG_CAN_ACCEPT | DRAG_HOVERED; /** Loading Loading @@ -2576,6 +2588,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, }) int mPrivateFlags; int mPrivateFlags2; int mPrivateFlags3; /** * This view's request for the visibility of the status bar. Loading Loading @@ -13022,15 +13035,15 @@ public class View implements Drawable.Callback, KeyEvent.Callback, more = drawAnimation(parent, drawingTime, a, scalingRequired); concatMatrix = a.willChangeTransformationMatrix(); if (concatMatrix) { mPrivateFlags2 |= VIEW_IS_ANIMATING_TRANSFORM; mPrivateFlags3 |= VIEW_IS_ANIMATING_TRANSFORM; } transformToApply = parent.mChildTransformation; } else { if ((mPrivateFlags2 & VIEW_IS_ANIMATING_TRANSFORM) == VIEW_IS_ANIMATING_TRANSFORM && if ((mPrivateFlags3 & 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; mPrivateFlags3 &= ~VIEW_IS_ANIMATING_TRANSFORM; } if (!useDisplayListProperties && (flags & ViewGroup.FLAG_SUPPORT_STATIC_TRANSFORMATIONS) != 0) { Loading Loading @@ -13142,7 +13155,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } float alpha = useDisplayListProperties ? 1 : getAlpha(); if (transformToApply != null || alpha < 1 || !hasIdentityMatrix()) { if (transformToApply != null || alpha < 1 || !hasIdentityMatrix() || (mPrivateFlags3 & VIEW_IS_ANIMATING_ALPHA) == VIEW_IS_ANIMATING_ALPHA) { if (transformToApply != null || !childHasIdentityMatrix) { int transX = 0; int transY = 0; Loading @@ -13168,7 +13182,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, float transformAlpha = transformToApply.getAlpha(); if (transformAlpha < 1) { alpha *= transformToApply.getAlpha(); alpha *= transformAlpha; parent.mGroupFlags |= ViewGroup.FLAG_CLEAR_TRANSFORMATION; } } Loading @@ -13180,7 +13194,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } } // Deal with alpha if it is or used to be <1 if (alpha < 1 || (mPrivateFlags3 & VIEW_IS_ANIMATING_ALPHA) == VIEW_IS_ANIMATING_ALPHA) { if (alpha < 1) { mPrivateFlags3 |= VIEW_IS_ANIMATING_ALPHA; } else { mPrivateFlags3 &= ~VIEW_IS_ANIMATING_ALPHA; } parent.mGroupFlags |= ViewGroup.FLAG_CLEAR_TRANSFORMATION; if (hasNoCache) { final int multipliedAlpha = (int) (255 * alpha); Loading