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

Unified Diff: cc/trees/property_tree.cc

Issue 2339583002: cc: Move OnScrollOffsetAnimated to scroll tree (Closed)
Patch Set: 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/trees/property_tree.h ('k') | third_party/WebKit/Source/platform/graphics/CompositorMutableState.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/property_tree.cc
diff --git a/cc/trees/property_tree.cc b/cc/trees/property_tree.cc
index 912226b25e525f0e9045e26070783bbe0cb7c5eb..12aa51a5cabaff0bc300b696f10a5199c7d87090 100644
--- a/cc/trees/property_tree.cc
+++ b/cc/trees/property_tree.cc
@@ -1309,6 +1309,23 @@ gfx::ScrollOffset ScrollTree::MaxScrollOffset(int scroll_node_id) const {
return max_offset;
}
+void ScrollTree::OnScrollOffsetAnimated(int layer_id,
+ int transform_tree_index,
+ int scroll_tree_index,
+ const gfx::ScrollOffset& scroll_offset,
+ LayerTreeImpl* layer_tree_impl) {
+ // Only active tree needs to be updated, pending tree will find out about
+ // these changes as a result of the shared SyncedProperty.
+ if (!property_trees()->is_active)
+ return;
+
+ ScrollNode* scroll_node = Node(scroll_tree_index);
+ if (SetScrollOffset(layer_id,
+ ClampScrollOffsetToLimits(scroll_offset, scroll_node)))
+ layer_tree_impl->DidUpdateScrollOffset(layer_id, transform_tree_index);
+ layer_tree_impl->DidAnimateScrollOffset();
+}
+
gfx::Size ScrollTree::scroll_clip_layer_bounds(int scroll_node_id) const {
const ScrollNode* scroll_node = Node(scroll_node_id);
gfx::Size scroll_clip_layer_bounds = scroll_node->scroll_clip_layer_bounds;
« no previous file with comments | « cc/trees/property_tree.h ('k') | third_party/WebKit/Source/platform/graphics/CompositorMutableState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698