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

Unified Diff: cc/layers/layer.cc

Issue 1736073002: cc: Move SyncedScrollOffset to scroll tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and add comment Created 4 years, 10 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/input/scroll_state.cc ('k') | cc/layers/layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 6d25aac1ca4da2aae5e9beaf9c760e1dc62d6c46..a468e13d7baea4ed8eb1b0ef2532796a06a89b1b 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -884,6 +884,10 @@ void Layer::SetScrollOffset(const gfx::ScrollOffset& scroll_offset) {
if (!layer_tree_host_)
return;
+ if (scroll_tree_index() != -1 && scrollable())
+ layer_tree_host_->property_trees()->scroll_tree.SetScrollOffset(
+ id(), scroll_offset);
+
if (TransformNode* transform_node =
layer_tree_host_->property_trees()->transform_tree.Node(
transform_tree_index())) {
@@ -923,6 +927,11 @@ void Layer::SetScrollOffsetFromImplSide(
SetNeedsPushProperties();
bool needs_rebuild = true;
+
+ if (scroll_tree_index() != -1 && scrollable())
+ layer_tree_host_->property_trees()->scroll_tree.SetScrollOffset(
+ id(), scroll_offset);
+
if (TransformNode* transform_node =
layer_tree_host_->property_trees()->transform_tree.Node(
transform_tree_index())) {
@@ -1338,9 +1347,10 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
// active tree. To do so, avoid scrolling the pending tree along with it
// instead of trying to undo that scrolling later.
if (ScrollOffsetAnimationWasInterrupted())
- layer->PushScrollOffsetFromMainThreadAndClobberActiveValue(scroll_offset_);
- else
- layer->PushScrollOffsetFromMainThread(scroll_offset_);
+ layer_tree_host()
+ ->property_trees()
+ ->scroll_tree.synced_scroll_offset(layer->id())
+ ->set_clobber_active_value();
layer->SetScrollCompensationAdjustment(ScrollCompensationAdjustment());
{
@@ -1703,8 +1713,7 @@ void Layer::FromLayerSpecificPropertiesProto(
}
scoped_ptr<LayerImpl> Layer::CreateLayerImpl(LayerTreeImpl* tree_impl) {
- return LayerImpl::Create(tree_impl, layer_id_,
- new LayerImpl::SyncedScrollOffset);
+ return LayerImpl::Create(tree_impl, layer_id_);
}
bool Layer::DrawsContent() const {
« no previous file with comments | « cc/input/scroll_state.cc ('k') | cc/layers/layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698