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

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

Merge "Fix NPE with display lists when view not attached" into honeycomb

parents eea200a9 f4ac547f
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -8228,6 +8228,21 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
     */
    protected void dispatchGetDisplayList() {}

    /**
     * A view that is not attached or hardware accelerated cannot create a display list.
     * This method checks these conditions and returns the appropriate result.
     *
     * @return true if view has the ability to create a display list, false otherwise.
     *
     * @hide
     */
    public boolean canHaveDisplayList() {
        if (mAttachInfo == null || mAttachInfo.mHardwareRenderer == null) {
            return false;
        }
        return true;
    }
    
    /**
     * <p>Returns a display list that can be used to draw this view again
     * without executing its draw method.</p>
@@ -8237,7 +8252,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility
     * @hide
     */
    public DisplayList getDisplayList() {
        if (mAttachInfo == null || mAttachInfo.mHardwareRenderer == null) {
        if (!canHaveDisplayList()) {
            return null;
        }

+1 −1
Original line number Diff line number Diff line
@@ -2381,7 +2381,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
                } else if (layerType == LAYER_TYPE_NONE) {
                    // Delay getting the display list until animation-driven alpha values are
                    // set up and possibly passed on to the view
                    hasDisplayList = true;
                    hasDisplayList = child.canHaveDisplayList();
                }
            }
        }