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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user