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

Commit 94328c30 authored by Romain Guy's avatar Romain Guy Committed by Android (Google) Code Review
Browse files

Merge "Clear bitmap references from display lists as early as possible Bug #6555840" into jb-dev

parents 1ed1de7a 38c2ece5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -82,6 +82,12 @@ public abstract class DisplayList {
     */
    public abstract void invalidate();

    /**
     * Clears additional resources held onto by this display list. You should
     * only invoke this method after {@link #invalidate()}.
     */
    public abstract void clear();

    /**
     * Returns whether the display list is currently usable. If this returns false,
     * the display list should be re-recorded prior to replaying it.
+7 −1
Original line number Diff line number Diff line
@@ -71,6 +71,13 @@ class GLES20DisplayList extends DisplayList {
        mValid = false;
    }

    @Override
    public void clear() {
        if (!mValid) {
            mBitmaps.clear();
        }
    }

    @Override
    public boolean isValid() {
        return mValid;
@@ -343,7 +350,6 @@ class GLES20DisplayList extends DisplayList {
    private static native void nSetPivotX(int displayList, float pivotX);
    private static native void nSetCaching(int displayList, boolean caching);
    private static native void nSetClipChildren(int displayList, boolean clipChildren);
    private static native void nSetApplicationScale(int displayList, float scale);
    private static native void nSetAlpha(int displayList, float alpha);
    private static native void nSetHasOverlappingRendering(int displayList,
            boolean hasOverlappingRendering);
+11 −4
Original line number Diff line number Diff line
@@ -6800,6 +6800,8 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
     */
    public void dispatchStartTemporaryDetach() {
        clearAccessibilityFocus();
        clearDisplayList();
        onStartTemporaryDetach();
    }
@@ -11455,10 +11457,8 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
            }
            mAttachInfo.mViewRootImpl.cancelInvalidate(this);
        } else {
            if (mDisplayList != null) {
            // Should never happen
                mDisplayList.invalidate();
            }
            clearDisplayList();
        }
        mCurrentAnimation = null;
@@ -12236,6 +12236,13 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
        return mDisplayList;
    }
    private void clearDisplayList() {
        if (mDisplayList != null) {
            mDisplayList.invalidate();
            mDisplayList.clear();
        }
    }
    /**
     * <p>Calling this method is equivalent to calling <code>getDrawingCache(false)</code>.</p>
     *
+3 −1
Original line number Diff line number Diff line
@@ -2335,7 +2335,9 @@ public final class ViewRootImpl implements ViewParent,
        final int count = displayLists.size();

        for (int i = 0; i < count; i++) {
            displayLists.get(i).invalidate();
            final DisplayList displayList = displayLists.get(i);
            displayList.invalidate();
            displayList.clear();
        }

        displayLists.clear();