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

Commit 77785f9d authored by Chet Haase's avatar Chet Haase
Browse files

Fix invalidation problem with display lists

It was previously the case that a view marked ~DRAWN must be
invalidated correctly already, so we would not mark any flags.
Display lists added new logic such that an undrawn node must still
be checked to see if its cache has been marked invalid. If not,
we must mark it invalid to make sure that a future rendering call
will cause the view to refresh its display list, thus refreshing its
child node tree's display lists, since that's where the invalidate
call must have originated.

Change-Id: I0f73c85459174c0e3f16d703f7eb914a706c808a
parent b8942108
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -8249,7 +8249,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
            // If we got here, we're recreating it. Mark it as such to ensure that
            // we copy in child display lists into ours in drawChild()
            mRecreateDisplayList = true;

            if (mDisplayList == null) {
                mDisplayList = mAttachInfo.mHardwareRenderer.createDisplayList(this);
                // If we're creating a new display list, make sure our parent gets invalidated
@@ -8287,6 +8286,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility

                mDisplayList.end();
            }
        } else {
            mPrivateFlags |= DRAWN | DRAWING_CACHE_VALID;
            mPrivateFlags &= ~DIRTY_MASK;
        }

        return mDisplayList;
+4 −2
Original line number Diff line number Diff line
@@ -3497,7 +3497,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
                        ((ViewRoot) parent).invalidate();
                        parent = null;
                    } else if (view != null) {
                        if ((mPrivateFlags & DRAWN) == DRAWN) {
                        if ((view.mPrivateFlags & DRAWN) == DRAWN ||
                                (view.mPrivateFlags & DRAWING_CACHE_VALID) == DRAWING_CACHE_VALID) {
                            view.mPrivateFlags &= ~DRAWING_CACHE_VALID;
                            view.mPrivateFlags |= DIRTY;
                            parent = view.mParent;
@@ -3594,7 +3595,8 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
            ViewDebug.trace(this, ViewDebug.HierarchyTraceType.INVALIDATE_CHILD_IN_PARENT);
        }

        if ((mPrivateFlags & DRAWN) == DRAWN) {
        if ((mPrivateFlags & DRAWN) == DRAWN ||
                (mPrivateFlags & DRAWING_CACHE_VALID) == DRAWING_CACHE_VALID) {
            if ((mGroupFlags & (FLAG_OPTIMIZE_INVALIDATE | FLAG_ANIMATION_DONE)) !=
                        FLAG_OPTIMIZE_INVALIDATE) {
                dirty.offset(location[CHILD_LEFT_INDEX] - mScrollX,