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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2863103002: Reduce composited smooth scroll latency by a frame (also fixes latency UMAs). (Closed)
Patch Set: Cleanup. Created 3 years, 7 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/scroll_offset_animations_impl.cc ('k') | 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 62e587ce860fceb390dcb40e31992f43b843aa36..6572c72149d60f3f2f4c0bd66a9e8241a7e2adf5 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -2938,8 +2938,14 @@ bool LayerTreeHostImpl::ScrollAnimationCreate(ScrollNode* scroll_node,
active_tree()->LayerById(scroll_node->owning_layer_id)->element_id()),
scroll_node->element_id);
+ // Start the animation one full frame in. Without any offset, the animation
+ // doesn't start until next frame, increasing latency, and preventing our
+ // input latency tracking architecture from working.
+ base::TimeDelta animation_start_offset = CurrentBeginFrameArgs().interval;
+
mutator_host_->ImplOnlyScrollAnimationCreate(
- scroll_node->element_id, target_offset, current_offset, delayed_by);
+ scroll_node->element_id, target_offset, current_offset, delayed_by,
+ animation_start_offset);
SetNeedsOneBeginImplFrame();
« no previous file with comments | « cc/animation/scroll_offset_animations_impl.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698