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
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 77c1d7b..0fd2d0e 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -2400,12 +2400,6 @@
      */
     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 @@
      * @see #setOutlineProvider(ViewOutlineProvider)
      */
     public void invalidateOutline() {
-        mPrivateFlags3 |= PFLAG3_OUTLINE_INVALID;
+        rebuildOutline();
 
         notifySubtreeAccessibilityStateChangedIfNeeded();
         invalidateViewProperty(false, false);
@@ -14873,10 +14867,6 @@
      */
     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 @@
         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 @@
             mOverlay.getOverlayView().setRight(newWidth);
             mOverlay.getOverlayView().setBottom(newHeight);
         }
-        mPrivateFlags3 |= PFLAG3_OUTLINE_INVALID;
+        rebuildOutline();
     }
 
     /**
@@ -15897,8 +15887,7 @@
 
             invalidate(dirty.left + scrollX, dirty.top + scrollY,
                     dirty.right + scrollX, dirty.bottom + scrollY);
-
-            mPrivateFlags3 |= PFLAG3_OUTLINE_INVALID;
+            rebuildOutline();
         }
     }