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

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: add test + apply suggested improvement Created 4 years, 3 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/layers/viewport.h ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/viewport.cc
diff --git a/cc/layers/viewport.cc b/cc/layers/viewport.cc
index 0c248bfbe5886a679fa44261de95c7d3dd21f702..f2f6282d166a4bee64c6952afbaed0b690689e9d 100644
--- a/cc/layers/viewport.cc
+++ b/cc/layers/viewport.cc
@@ -77,7 +77,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::TimeDelta delayed_by) {
if (!OuterScrollLayer())
return gfx::Vector2dF(0, 0);
@@ -111,10 +112,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, delayed_by);
} 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, delayed_by);
}
if (will_animate) {
« no previous file with comments | « cc/layers/viewport.h ('k') | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698