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

Commit f870c28d authored by Chet Haase's avatar Chet Haase Committed by Android (Google) Code Review
Browse files

Merge "Fix invalidation issue for optimized/GL case."

parents d3f5ce15 f2f7d8f9
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -6453,6 +6453,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
            mPrivateFlags &= ~DRAWING_CACHE_VALID;
            final ViewParent p = mParent;
            final AttachInfo ai = mAttachInfo;
            if (p != null && ai != null && ai.mHardwareAccelerated) {
                // fast-track for GL-enabled applications; just invalidate the whole hierarchy
                // with a null dirty rect, which tells the ViewRoot to redraw everything
                p.invalidateChild(this, null);
                return;
            }
            if (p != null && ai != null && l < r && t < b) {
                final int scrollX = mScrollX;
                final int scrollY = mScrollY;
@@ -6496,6 +6502,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
            }
            final AttachInfo ai = mAttachInfo;
            final ViewParent p = mParent;
            if (p != null && ai != null && ai.mHardwareAccelerated) {
                // fast-track for GL-enabled applications; just invalidate the whole hierarchy
                // with a null dirty rect, which tells the ViewRoot to redraw everything
                p.invalidateChild(this, null);
                return;
            }

            if (p != null && ai != null) {
                final Rect r = ai.mTmpInvalRect;
+3 −0
Original line number Diff line number Diff line
@@ -2349,9 +2349,11 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
                    child.draw(canvas);
                }
            } else {
                child.mPrivateFlags &= ~DIRTY_MASK;
                ((HardwareCanvas) canvas).drawDisplayList(displayList);
            }
        } else if (cache != null) {
            child.mPrivateFlags &= ~DIRTY_MASK;
            final Paint cachePaint = mCachePaint;
            if (alpha < 1.0f) {
                cachePaint.setAlpha((int) (alpha * 255));
@@ -2583,6 +2585,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
        // addViewInner() will call child.requestLayout() when setting the new LayoutParams
        // therefore, we call requestLayout() on ourselves before, so that the child's request
        // will be blocked at our level
        child.mPrivateFlags &= ~DIRTY_MASK;
        requestLayout();
        invalidate();
        addViewInner(child, index, params, false);