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

Commit e048f84a authored by Raph Levien's avatar Raph Levien
Browse files

Fix for jank when fast-scrolling DeskClock's world cities list in RTL

This is a fix for bug 10863979.

The onPreDraw() method in TextView was canceling the draw every time a
the horizontal scroll changed. These dropped frames were visible as
jank. The fix is to never cancel the draw. It seems likely that the
previous rationale for canceling draw is no longer valid, due to other
fixes, because the scroll state will have been fully updated.

Change-Id: I8c2da5450723f993055a49b1cb57320c08f2a11e
parent 015bcd4d
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -4679,8 +4679,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
            assumeLayout();
        }

        boolean changed = false;

        if (mMovement != null) {
            /* This code also provides auto-scrolling when a cursor is moved using a
             * CursorController (insertion point or selection limits).
@@ -4703,10 +4701,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
            }

            if (curs >= 0) {
                changed = bringPointIntoView(curs);
                bringPointIntoView(curs);
            }
        } else {
            changed = bringTextIntoView();
            bringTextIntoView();
        }

        // This has to be checked here since:
@@ -4727,7 +4725,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        getViewTreeObserver().removeOnPreDrawListener(this);
        mPreDrawRegistered = false;

        return !changed;
        return true;
    }

    @Override