Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 26b7b8b5 authored by Alan Viverette's avatar Alan Viverette Committed by Android (Google) Code Review
Browse files

Merge "Fix conditional in invalidateInternal"

parents 4c90185a f4f4e863
Loading
Loading
Loading
Loading
+9 −10
Original line number Diff line number Diff line
@@ -11465,7 +11465,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        final int scrollX = mScrollX;
        final int scrollY = mScrollY;
        invalidateInternal(dirty.left - scrollX, dirty.top - scrollY,
                dirty.right - scrollX, dirty.bottom - scrollY, true);
                dirty.right - scrollX, dirty.bottom - scrollY, true, false);
    }
    /**
@@ -11485,7 +11485,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    public void invalidate(int l, int t, int r, int b) {
        final int scrollX = mScrollX;
        final int scrollY = mScrollY;
        invalidateInternal(l - scrollX, t - scrollY, r - scrollY, b - scrollY, true);
        invalidateInternal(l - scrollX, t - scrollY, r - scrollY, b - scrollY, true, false);
    }
    /**
@@ -11513,20 +11513,19 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     *            dimensions have not changed.
     */
    void invalidate(boolean invalidateCache) {
        invalidateInternal(0, 0, mRight - mLeft, mBottom - mTop, invalidateCache);
        invalidateInternal(0, 0, mRight - mLeft, mBottom - mTop, invalidateCache, true);
    }
    void invalidateInternal(int l, int t, int r, int b, boolean invalidateCache) {
    void invalidateInternal(int l, int t, int r, int b, boolean invalidateCache,
            boolean checkOpaque) {
        if (skipInvalidate()) {
            return;
        }
        final boolean wasDrawn = (mPrivateFlags & (PFLAG_DRAWN | PFLAG_HAS_BOUNDS))
                == (PFLAG_DRAWN | PFLAG_HAS_BOUNDS);
        final boolean hasValidCache = (mPrivateFlags & PFLAG_DRAWING_CACHE_VALID) != 0;
        final boolean invalidated = (mPrivateFlags & PFLAG_INVALIDATED) != 0;
        final boolean opacityChanged = isOpaque() != mLastIsOpaque;
        if (wasDrawn || (invalidateCache && hasValidCache) || !invalidated || opacityChanged) {
        if ((mPrivateFlags & (PFLAG_DRAWN | PFLAG_HAS_BOUNDS)) == (PFLAG_DRAWN | PFLAG_HAS_BOUNDS)
                || (invalidateCache && (mPrivateFlags & PFLAG_DRAWING_CACHE_VALID) == PFLAG_DRAWING_CACHE_VALID)
                || (mPrivateFlags & PFLAG_INVALIDATED) != PFLAG_INVALIDATED
                || checkOpaque && isOpaque() != mLastIsOpaque) {
            mLastIsOpaque = isOpaque();
            mPrivateFlags &= ~PFLAG_DRAWN;
            mPrivateFlags |= PFLAG_DIRTY;