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

Commit 526057bc authored by Chet Haase's avatar Chet Haase
Browse files

Remove redundant computeScroll() call for hw-accelerated views

View.draw() calls computeScroll() to initialize scrolling values correctly.
But getDisplayList() also calls computeScroll() for the same reason, resulting
in 2 calls to that method for hw-accelerated views.
Fix: avoid calling computeScroll() in View.draw() for views with display lists.

Change-Id: I57a3862e2d554752cd0fdb862513cbb3dfb3105c
parent c09008f0
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -12909,11 +12909,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
            mPrivateFlags &= ~INVALIDATED;
        }
        computeScroll();
        final int sx = mScrollX;
        final int sy = mScrollY;
        DisplayList displayList = null;
        Bitmap cache = null;
        boolean hasDisplayList = false;
@@ -12960,6 +12955,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
            }
        }
        int sx = 0;
        int sy = 0;
        if (!hasDisplayList) {
            computeScroll();
            sx = mScrollX;
            sy = mScrollY;
        }
        final boolean hasNoCache = cache == null || hasDisplayList;
        final boolean offsetForScroll = cache == null && !hasDisplayList &&
                layerType != LAYER_TYPE_HARDWARE;