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

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

Merge "Postpone DisplayList recycling when detached from window"

parents c0102b7a bc7616ea
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package android.view;

import android.os.Handler;

/**
 * A display lists records a series of graphics related operation and can replay
 * them later. Display lists are usually built by recording operations on a
@@ -26,6 +28,13 @@ package android.view;
 * @hide 
 */
public abstract class DisplayList {
    private final Runnable mInvalidate = new Runnable() {
        @Override
        public void run() {
            invalidate();
        }
    };

    /**
     * Flag used when calling
     * {@link HardwareCanvas#drawDisplayList(DisplayList, int, int, android.graphics.Rect, int)}.
@@ -56,6 +65,13 @@ public abstract class DisplayList {
     */
    public abstract void invalidate();

    /**
     * Posts a call to {@link #invalidate()} in the specified handler.
     */
    final void postInvalidate(Handler handler) {
        handler.post(mInvalidate);
    }

    /**
     * Returns whether the display list is currently usable. If this returns false,
     * the display list should be re-recorded prior to replaying it.
+1 −1
Original line number Diff line number Diff line
@@ -9975,7 +9975,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
        destroyLayer();
        if (mDisplayList != null) {
            mDisplayList.invalidate();
            mDisplayList.postInvalidate(mAttachInfo.mHandler);
        }
        if (mAttachInfo != null) {