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

Unified Diff: cc/animation/element_animations.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
Index: cc/animation/element_animations.cc
diff --git a/cc/animation/element_animations.cc b/cc/animation/element_animations.cc
index f75ffbe678211b926493a49636ccb518852ebfc4..80823d226b1b3a4893705570d3a4ecfaafbdf0d4 100644
--- a/cc/animation/element_animations.cc
+++ b/cc/animation/element_animations.cc
@@ -1014,10 +1014,14 @@ void ElementAnimations::UpdateActivation(UpdateActivationType type) {
}
}
- if (is_active_ && (!was_active || force))
+ if (is_active_ && (!was_active || force)) {
animation_host_->DidActivateElementAnimations(this);
- else if (!is_active_ && (was_active || force))
+ } else if (!is_active_ && (was_active || force)) {
+ // Resetting last_tick_time_ here ensures that calling ::UpdateState
+ // before ::Animate doesn't start an animation.
+ last_tick_time_ = base::TimeTicks();
animation_host_->DidDeactivateElementAnimations(this);
+ }
}
}
« no previous file with comments | « no previous file | cc/animation/element_animations_unittest.cc » ('j') | cc/animation/scroll_offset_animations_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698