From c99d3c99f86be8cace507379c0d4f4b7a26fd1e1 Mon Sep 17 00:00:00 2001 From: John Reck Date: Mon, 17 Nov 2014 11:28:44 -0800 Subject: Fix invalidateOutline Bug: 18175261 invalidateOutline was switched to a lazy-method, but this doesn't work because invalidateViewProperty intentionally does not do a traversal, therefore the invalidate was never consumed. However it was attempting to be lazy about work that is cheap to do, so nuke the lazy aspect and restore invalidateOutline's previous, correct behavior. rebuildOutline is kept to avoid triggering traversals in places they are not needed Change-Id: I70f8cbacd54a607c0bf0bc7fe6eea78554cb2ea3 --- core/java/android/view/View.java | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 77c1d7b2edd9..0fd2d0eb3300 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -2400,12 +2400,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ static final int PFLAG3_NESTED_SCROLLING_ENABLED = 0x80; - /** - * Flag indicating that outline was invalidated and should be rebuilt the next time - * the DisplayList is updated. - */ - static final int PFLAG3_OUTLINE_INVALID = 0x100; - /* End of masks for mPrivateFlags3 */ static final int DRAG_MASK = PFLAG2_DRAG_CAN_ACCEPT | PFLAG2_DRAG_HOVERED; @@ -11277,7 +11271,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @see #setOutlineProvider(ViewOutlineProvider) */ public void invalidateOutline() { - mPrivateFlags3 |= PFLAG3_OUTLINE_INVALID; + rebuildOutline(); notifySubtreeAccessibilityStateChangedIfNeeded(); invalidateViewProperty(false, false); @@ -14873,10 +14867,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, */ void setDisplayListProperties(RenderNode renderNode) { if (renderNode != null) { - if ((mPrivateFlags3 & PFLAG3_OUTLINE_INVALID) != 0) { - rebuildOutline(); - mPrivateFlags3 &= ~PFLAG3_OUTLINE_INVALID; - } renderNode.setHasOverlappingRendering(hasOverlappingRendering()); if (mParent instanceof ViewGroup) { renderNode.setClipToBounds( @@ -15478,7 +15468,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, if (mBackgroundSizeChanged) { background.setBounds(0, 0, mRight - mLeft, mBottom - mTop); mBackgroundSizeChanged = false; - mPrivateFlags3 |= PFLAG3_OUTLINE_INVALID; + rebuildOutline(); } // Attempt to use a display list if requested. @@ -15861,7 +15851,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, mOverlay.getOverlayView().setRight(newWidth); mOverlay.getOverlayView().setBottom(newHeight); } - mPrivateFlags3 |= PFLAG3_OUTLINE_INVALID; + rebuildOutline(); } /** @@ -15897,8 +15887,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, invalidate(dirty.left + scrollX, dirty.top + scrollY, dirty.right + scrollX, dirty.bottom + scrollY); - - mPrivateFlags3 |= PFLAG3_OUTLINE_INVALID; + rebuildOutline(); } } -- cgit v1.2.3-59-g8ed1b