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

Commit e7c128f4 authored by John Reck's avatar John Reck
Browse files

Fix drawing translationZ to software canvas

Bug: 200578756
Test: DrawingOrderTest#testTranslationZOrder
Change-Id: Ie53a8ab3bcaedfb47f1e109556bf3a649e8a48f4
parent b1635458
Loading
Loading
Loading
Loading
+16 −8
Original line number Diff line number Diff line
@@ -22355,6 +22355,20 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        }
    }
    /**
     * If an attached view draws to a HW canvas, it may use its RenderNode + DisplayList.
     *
     * If a view is dettached, its DisplayList shouldn't exist. If the canvas isn't
     * HW accelerated, it can't handle drawing RenderNodes.
     *
     * @hide
     */
    protected final boolean drawsWithRenderNode(Canvas canvas) {
        return mAttachInfo != null
                && mAttachInfo.mHardwareAccelerated
                && canvas.isHardwareAccelerated();
    }
    /**
     * This method is called by ViewGroup.drawChild() to have each child view draw itself.
     *
@@ -22364,14 +22378,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    boolean draw(Canvas canvas, ViewGroup parent, long drawingTime) {
        final boolean hardwareAcceleratedCanvas = canvas.isHardwareAccelerated();
        /* If an attached view draws to a HW canvas, it may use its RenderNode + DisplayList.
         *
         * If a view is dettached, its DisplayList shouldn't exist. If the canvas isn't
         * HW accelerated, it can't handle drawing RenderNodes.
         */
        boolean drawingWithRenderNode = mAttachInfo != null
                && mAttachInfo.mHardwareAccelerated
                && hardwareAcceleratedCanvas;
        boolean drawingWithRenderNode = drawsWithRenderNode(canvas);
        boolean more = false;
        final boolean childHasIdentityMatrix = hasIdentityMatrix();
+1 −1
Original line number Diff line number Diff line
@@ -4266,7 +4266,7 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager
        int transientIndex = transientCount != 0 ? 0 : -1;
        // Only use the preordered list if not HW accelerated, since the HW pipeline will do the
        // draw reordering internally
        final ArrayList<View> preorderedList = isHardwareAccelerated()
        final ArrayList<View> preorderedList = drawsWithRenderNode(canvas)
                ? null : buildOrderedChildList();
        final boolean customOrder = preorderedList == null
                && isChildrenDrawingOrderEnabled();