Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Issue 2251933002: Fix smooth scroll animation flake on janky pages (Closed)

Created:
4 years, 4 months ago by ymalik
Modified:
4 years, 4 months ago
Reviewers:
ajuma, skobes
CC:
chromium-reviews, cc-bugs_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

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 Committed: https://crrev.com/04da03ce765e60b6081ed755b834b9e7e555a64f Cr-Commit-Position: refs/heads/master@{#412898}

Patch Set 1 #

Patch Set 2 : Add test #

Patch Set 3 : Fix UpdateTarget while animation is not started #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+154 lines, -5 lines) Patch
M cc/animation/element_animations.cc View 1 1 chunk +6 lines, -2 lines 0 comments Download
M cc/animation/element_animations_unittest.cc View 1 1 chunk +57 lines, -0 lines 0 comments Download
M cc/animation/scroll_offset_animations_impl.cc View 1 2 1 chunk +8 lines, -3 lines 3 comments Download
M cc/test/animation_test_common.h View 1 2 chunks +9 lines, -0 lines 0 comments Download
M cc/test/animation_test_common.cc View 1 2 chunks +23 lines, -0 lines 0 comments Download
M cc/trees/layer_tree_host_impl_unittest.cc View 1 2 1 chunk +51 lines, -0 lines 0 comments Download

Messages

Total messages: 22 (15 generated)
ymalik
https://codereview.chromium.org/2251933002/diff/40001/cc/animation/scroll_offset_animations_impl.cc File cc/animation/scroll_offset_animations_impl.cc (right): https://codereview.chromium.org/2251933002/diff/40001/cc/animation/scroll_offset_animations_impl.cc#newcode96 cc/animation/scroll_offset_animations_impl.cc:96: curve->UpdateTarget(trimmed.InSecondsF(), new_target); The observed failure mode is that when ...
4 years, 4 months ago (2016-08-18 07:34:20 UTC) #9
ajuma
lgtm https://codereview.chromium.org/2251933002/diff/40001/cc/animation/scroll_offset_animations_impl.cc File cc/animation/scroll_offset_animations_impl.cc (right): https://codereview.chromium.org/2251933002/diff/40001/cc/animation/scroll_offset_animations_impl.cc#newcode90 cc/animation/scroll_offset_animations_impl.cc:90: // for run_state == Animation::WAITING_FOR_TARGET_AVAILABILITY. Yeah, Animation::ConvertToActiveTime should ...
4 years, 4 months ago (2016-08-18 14:16:25 UTC) #10
ymalik
https://codereview.chromium.org/2251933002/diff/40001/cc/animation/scroll_offset_animations_impl.cc File cc/animation/scroll_offset_animations_impl.cc (right): https://codereview.chromium.org/2251933002/diff/40001/cc/animation/scroll_offset_animations_impl.cc#newcode90 cc/animation/scroll_offset_animations_impl.cc:90: // for run_state == Animation::WAITING_FOR_TARGET_AVAILABILITY. On 2016/08/18 14:16:25, ajuma ...
4 years, 4 months ago (2016-08-18 17:23:33 UTC) #13
skobes
lgtm I verified this fixes http://crbug.com/622553.
4 years, 4 months ago (2016-08-18 18:22:06 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2251933002/40001
4 years, 4 months ago (2016-08-18 18:34:18 UTC) #18
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 4 months ago (2016-08-18 18:38:43 UTC) #20
commit-bot: I haz the power
4 years, 4 months ago (2016-08-18 18:41:11 UTC) #22
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/04da03ce765e60b6081ed755b834b9e7e555a64f
Cr-Commit-Position: refs/heads/master@{#412898}

Powered by Google App Engine
This is Rietveld 408576698