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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 461083002: Force a commit at the end of the top controls animation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: SetNeedsAnimate while animation active Created 6 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 | « no previous file | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 2d7a9323edf74e7bceb7eab96100f2d8996b12f6..8cf9d014e503fa9216faac5d255d4b1560ce57c1 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -3027,15 +3027,23 @@ void LayerTreeHostImpl::AnimatePageScale(base::TimeTicks monotonic_time) {
void LayerTreeHostImpl::AnimateTopControls(base::TimeTicks time) {
if (!top_controls_manager_ || !top_controls_manager_->animation())
return;
+
gfx::Vector2dF scroll = top_controls_manager_->Animate(time);
+
+ if (top_controls_manager_->animation())
+ SetNeedsAnimate();
+
if (active_tree_->TotalScrollOffset().y() == 0.f)
return;
- if (!scroll.IsZero()) {
- ScrollViewportBy(gfx::ScaleVector2d(
- scroll, 1.f / active_tree_->total_page_scale_factor()));
- SetNeedsRedraw();
- }
- SetNeedsAnimate();
+
+ if (scroll.IsZero())
+ return;
+
+ ScrollViewportBy(gfx::ScaleVector2d(
+ scroll, 1.f / active_tree_->total_page_scale_factor()));
+ SetNeedsRedraw();
+ client_->SetNeedsCommitOnImplThread();
+ client_->RenewTreePriority();
}
void LayerTreeHostImpl::AnimateLayers(base::TimeTicks monotonic_time) {
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698