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

Unified Diff: cc/layers/viewport.cc

Issue 2040543002: Take MT jank into account when animating the scroll offset on CC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix constant Created 4 years, 6 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/layers/viewport.cc
diff --git a/cc/layers/viewport.cc b/cc/layers/viewport.cc
index d80d40c9f2533f57f04651fe39829f282cede14a..5022e1aaa659bb2b3bc09291493e665e79af2e9e 100644
--- a/cc/layers/viewport.cc
+++ b/cc/layers/viewport.cc
@@ -73,7 +73,8 @@ bool Viewport::ShouldAnimateViewport(const gfx::Vector2dF& viewport_delta,
return max_dim_viewport_delta > max_dim_pending_delta;
}
-gfx::Vector2dF Viewport::ScrollAnimated(const gfx::Vector2dF& delta) {
+gfx::Vector2dF Viewport::ScrollAnimated(const gfx::Vector2dF& delta,
+ base::TimeTicks original_event_time) {
ScrollTree& scroll_tree =
host_impl_->active_tree()->property_trees()->scroll_tree;
@@ -104,10 +105,12 @@ gfx::Vector2dF Viewport::ScrollAnimated(const gfx::Vector2dF& delta) {
bool will_animate = false;
if (ShouldAnimateViewport(inner_delta, outer_delta)) {
scroll_tree.ScrollBy(outer_node, outer_delta, host_impl_->active_tree());
- will_animate = host_impl_->ScrollAnimationCreate(inner_node, inner_delta);
+ will_animate = host_impl_->ScrollAnimationCreate(inner_node, inner_delta,
+ original_event_time);
} else {
scroll_tree.ScrollBy(inner_node, inner_delta, host_impl_->active_tree());
- will_animate = host_impl_->ScrollAnimationCreate(outer_node, outer_delta);
+ will_animate = host_impl_->ScrollAnimationCreate(outer_node, outer_delta,
+ original_event_time);
}
if (will_animate) {

Powered by Google App Engine
This is Rietveld 408576698