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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 131373004: Let the browser know the end of fling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile break Created 6 years, 11 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 | content/browser/android/content_view_core_impl.h » ('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 fbc4a820f982496949dce7d3040f3a0518f703c4..587547f8d6b7299468a707ba7c263e7b4c42f1b4 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -2553,8 +2553,14 @@ void LayerTreeHostImpl::AnimateTopControls(base::TimeTicks time) {
UpdateMaxScrollOffset();
if (RootScrollLayer()->TotalScrollOffset().y() == 0.f)
return;
- RootScrollLayer()->ScrollBy(gfx::ScaleVector2d(
- scroll, 1.f / active_tree_->total_page_scale_factor()));
+ if (scroll.IsZero()) {
+ // This may happen on the first animation step. Force redraw otherwise
+ // the animation would stop because of no new frames.
+ SetNeedsRedraw();
+ } else {
+ RootScrollLayer()->ScrollBy(gfx::ScaleVector2d(
+ scroll, 1.f / active_tree_->total_page_scale_factor()));
+ }
}
void LayerTreeHostImpl::AnimateLayers(base::TimeTicks monotonic_time,
« no previous file with comments | « no previous file | content/browser/android/content_view_core_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698