Fix smooth scroll animation flake on janky pages
Some background:
In each frame, we have AnimateLayers and after we draw we do UpdateState. A call to
AnimateState ticks an animation and UpdateState adds a new animation to be ticked
in subsequent frames.
This CL fixes the following two cases:
1) An animation can get added at an unusual point. This can happen when
GestureScrollUpdate gets delivered after we AnimateLayers but before draw and
a call to UpdateState. In this case, the animation gets started with a stale start time
(last_tick_time_) and a call to AnimateState will jump and "finish" the animation. To
prevent this, we reset last_tick_time_ when element_animations becomes inactive.
2) An animation gets updated while it hasn't started and is in the
WAITING_FOR_TARGET_AVAILABILITY state. This happens when you do two simultaneous
mouse wheel ticks on a janky page. See inline comment for more details.
BUG=622553
CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel
Review-Url: https://codereview.chromium.org/2251933002
Cr-Commit-Position: refs/heads/master@{#412898}
6 files changed