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

Unified Diff: cc/layers/layer_impl.cc

Issue 1141353002: cc: Update transform tree after compositor thread scroll (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@compproptree_2_add_verification_code
Patch Set: Update to scroll offset Created 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index f0d54ff503e636d968109fcf82f4786480d0dfa6..45ec68f4e7ac233b11c1da6cf651283ee4faf93a 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -1218,15 +1218,29 @@ void LayerImpl::PushScrollOffset(const gfx::ScrollOffset* scroll_offset) {
}
void LayerImpl::DidUpdateScrollOffset(bool is_from_root_delegate) {
+ DCHECK(scroll_offset_);
+
if (!is_from_root_delegate)
layer_tree_impl()->DidUpdateScrollOffset(id());
NoteLayerPropertyChangedForSubtree();
ScrollbarParametersDidChange(false);
+
+ // TODO(enne): in the future, scrolling should update the scroll tree
+ // directly instead of going through layers.
+ if (transform_tree_index_ != -1) {
+ TransformTree& transform_tree =
+ layer_tree_impl()->property_trees()->transform_tree;
+ TransformNode* node = transform_tree.Node(transform_tree_index_);
+ node->data.scroll_offset = scroll_offset_->Current(IsActive());
+ node->data.needs_local_transform_update = true;
+ transform_tree.set_needs_update(true);
+ }
+
// Inform the pending twin that a property changed.
if (layer_tree_impl()->IsActiveTree()) {
LayerImpl* pending_twin = layer_tree_impl()->FindPendingTreeLayerById(id());
if (pending_twin)
- pending_twin->NoteLayerPropertyChangedForSubtree();
+ pending_twin->DidUpdateScrollOffset(is_from_root_delegate);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698