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

Unified Diff: cc/trees/property_tree.cc

Issue 2144303002: Made layout viewport scroll updates from compositor work like ordinary layers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rootScrollerOnCompositor
Patch Set: Initialize ScrollUpdateInfo's layer id in constructor Created 4 years, 5 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') | cc/trees/tree_synchronizer_unittest.cc » ('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 d2b3783a5724dc82c0c44fadb6e5c24e3e3b5279..a09b4e058fb77a39bc27055772c7a5396a6da8e8 100644
--- a/cc/trees/property_tree.cc
+++ b/cc/trees/property_tree.cc
@@ -1289,16 +1289,26 @@ gfx::ScrollOffset ScrollTree::PullDeltaForMainThread(
return delta;
}
-void ScrollTree::CollectScrollDeltas(ScrollAndScaleSet* scroll_info) {
+void ScrollTree::CollectScrollDeltas(ScrollAndScaleSet* scroll_info,
+ int inner_viewport_layer_id) {
for (auto map_entry : layer_id_to_scroll_offset_map_) {
gfx::ScrollOffset scroll_delta =
PullDeltaForMainThread(map_entry.second.get());
+ gfx::Vector2d scroll_delta_vector(scroll_delta.x(), scroll_delta.y());
+ int layer_id = map_entry.first;
+
if (!scroll_delta.IsZero()) {
- LayerTreeHostCommon::ScrollUpdateInfo scroll;
- scroll.layer_id = map_entry.first;
- scroll.scroll_delta = gfx::Vector2d(scroll_delta.x(), scroll_delta.y());
- scroll_info->scrolls.push_back(scroll);
+ if (layer_id == inner_viewport_layer_id) {
+ // Inner (visual) viewport is stored separately.
+ scroll_info->inner_viewport_scroll.layer_id = layer_id;
+ scroll_info->inner_viewport_scroll.scroll_delta = scroll_delta_vector;
+ } else {
+ LayerTreeHostCommon::ScrollUpdateInfo scroll;
+ scroll.layer_id = layer_id;
+ scroll.scroll_delta = scroll_delta_vector;
+ scroll_info->scrolls.push_back(scroll);
+ }
}
}
}
« no previous file with comments | « cc/trees/property_tree.h ('k') | cc/trees/tree_synchronizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698