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

Commit dd671599 authored by Chet Haase's avatar Chet Haase
Browse files

Fix quickReject logic to account for setClipChildren() setting

The rendering code optimizes by rejecting drawing operations that
lie outside of the bounds of their views. This works in most
situations, but breaks down when containers have called
setClipChildren(false), because we reject drawing that is outside
of that container, but which should be drawn anyway.

Fix is to pass in the value of that flag to the DisplayList drawing
routines which take that flag into account when deciding whether
to quickReject any particular operation.

Issue #8659277 animation clipping

Change-Id: Ief568e4db01b533a97b3c5ea5ad777c03c0eea71
parent 9b3ebb12
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -285,9 +285,9 @@ public abstract class DisplayList {
     * Set whether the display list should clip itself to its bounds. This property is controlled by
     * the view's parent.
     *
     * @param clipChildren true if the display list should clip to its bounds
     * @param clipToBounds true if the display list should clip to its bounds
     */
    public abstract void setClipChildren(boolean clipChildren);
    public abstract void setClipToBounds(boolean clipToBounds);

    /**
     * Set the static matrix on the display list. The specified matrix is combined with other
+3 −3
Original line number Diff line number Diff line
@@ -137,9 +137,9 @@ class GLES20DisplayList extends DisplayList {
    }

    @Override
    public void setClipChildren(boolean clipChildren) {
    public void setClipToBounds(boolean clipToBounds) {
        if (hasNativeDisplayList()) {
            nSetClipChildren(mFinalizer.mNativeDisplayList, clipChildren);
            nSetClipToBounds(mFinalizer.mNativeDisplayList, clipToBounds);
        }
    }

@@ -450,7 +450,7 @@ class GLES20DisplayList extends DisplayList {
    private static native void nSetPivotY(int displayList, float pivotY);
    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 nSetClipToBounds(int displayList, boolean clipToBounds);
    private static native void nSetAlpha(int displayList, float alpha);
    private static native void nSetHasOverlappingRendering(int displayList,
            boolean hasOverlappingRendering);
+2 −2
Original line number Diff line number Diff line
@@ -13489,7 +13489,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
            displayList.setLeftTopRightBottom(mLeft, mTop, mRight, mBottom);
            displayList.setHasOverlappingRendering(hasOverlappingRendering());
            if (mParent instanceof ViewGroup) {
                displayList.setClipChildren(
                displayList.setClipToBounds(
                        (((ViewGroup) mParent).mGroupFlags & ViewGroup.FLAG_CLIP_CHILDREN) != 0);
            }
            float alpha = 1;
+1 −1
Original line number Diff line number Diff line
@@ -3109,7 +3109,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
            for (int i = 0; i < mChildrenCount; ++i) {
                View child = getChildAt(i);
                if (child.mDisplayList != null) {
                    child.mDisplayList.setClipChildren(clipChildren);
                    child.mDisplayList.setClipToBounds(clipChildren);
                }
            }
        }
+1 −1
Original line number Diff line number Diff line
@@ -1351,7 +1351,7 @@ public class Editor {
                        } finally {
                            blockDisplayList.end();
                            // Same as drawDisplayList below, handled by our TextView's parent
                            blockDisplayList.setClipChildren(false);
                            blockDisplayList.setClipToBounds(false);
                        }
                    }

Loading