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

Unified Diff: cc/animation/scroll_offset_animations_impl.cc

Issue 2251933002: Fix smooth scroll animation flake on janky pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix UpdateTarget while animation is not started Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/animation/element_animations_unittest.cc ('k') | cc/test/animation_test_common.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/scroll_offset_animations_impl.cc
diff --git a/cc/animation/scroll_offset_animations_impl.cc b/cc/animation/scroll_offset_animations_impl.cc
index f49bb9d54f7a3e3f32fd9d64241f97be9e593941..f72a2d80fa59531bef442f2988cc35bd91535451 100644
--- a/cc/animation/scroll_offset_animations_impl.cc
+++ b/cc/animation/scroll_offset_animations_impl.cc
@@ -86,9 +86,14 @@ bool ScrollOffsetAnimationsImpl::ScrollAnimationUpdateTarget(
new_target.SetToMax(gfx::ScrollOffset());
new_target.SetToMin(max_scroll_offset);
- curve->UpdateTarget(
- animation->TrimTimeToCurrentIteration(frame_monotonic_time).InSecondsF(),
- new_target);
+ // TODO(ymalik): Animation::TrimTimeToCurrentIteration should probably check
+ // for run_state == Animation::WAITING_FOR_TARGET_AVAILABILITY.
ajuma 2016/08/18 14:16:25 Yeah, Animation::ConvertToActiveTime should probab
ymalik 2016/08/18 17:23:33 Yeah. I tried to do it in this CL and a bunch of t
+ base::TimeDelta trimmed =
+ animation->run_state() == Animation::WAITING_FOR_TARGET_AVAILABILITY
+ ? base::TimeDelta()
+ : animation->TrimTimeToCurrentIteration(frame_monotonic_time);
+
+ curve->UpdateTarget(trimmed.InSecondsF(), new_target);
ymalik 2016/08/18 07:34:20 The observed failure mode is that when you do two
return true;
}
« no previous file with comments | « cc/animation/element_animations_unittest.cc ('k') | cc/test/animation_test_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698