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

Side by Side Diff: cc/trees/layer_tree_host_impl.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, 9 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 unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 3231 matching lines...) Expand 10 before | Expand all | Expand 10 after
3242 // scales that we want when we're not inside a pinch. 3242 // scales that we want when we're not inside a pinch.
3243 active_tree_->set_needs_update_draw_properties(); 3243 active_tree_->set_needs_update_draw_properties();
3244 SetNeedsRedraw(); 3244 SetNeedsRedraw();
3245 } 3245 }
3246 3246
3247 static void CollectScrollDeltas(ScrollAndScaleSet* scroll_info, 3247 static void CollectScrollDeltas(ScrollAndScaleSet* scroll_info,
3248 LayerImpl* root_layer) { 3248 LayerImpl* root_layer) {
3249 if (!root_layer) 3249 if (!root_layer)
3250 return; 3250 return;
3251 3251
3252 for (auto* layer : *root_layer->layer_tree_impl()) { 3252 return root_layer->layer_tree_impl()
3253 gfx::ScrollOffset scroll_delta = layer->PullDeltaForMainThread(); 3253 ->property_trees()
3254 3254 ->scroll_tree.CollectScrollDeltas(scroll_info);
3255 if (!scroll_delta.IsZero()) {
3256 LayerTreeHostCommon::ScrollUpdateInfo scroll;
3257 scroll.layer_id = layer->id();
3258 scroll.scroll_delta = gfx::Vector2d(scroll_delta.x(), scroll_delta.y());
3259 scroll_info->scrolls.push_back(scroll);
3260 }
3261 }
3262 } 3255 }
3263 3256
3264 scoped_ptr<ScrollAndScaleSet> LayerTreeHostImpl::ProcessScrollDeltas() { 3257 scoped_ptr<ScrollAndScaleSet> LayerTreeHostImpl::ProcessScrollDeltas() {
3265 scoped_ptr<ScrollAndScaleSet> scroll_info(new ScrollAndScaleSet()); 3258 scoped_ptr<ScrollAndScaleSet> scroll_info(new ScrollAndScaleSet());
3266 3259
3267 CollectScrollDeltas(scroll_info.get(), active_tree_->root_layer()); 3260 CollectScrollDeltas(scroll_info.get(), active_tree_->root_layer());
3268 scroll_info->page_scale_delta = 3261 scroll_info->page_scale_delta =
3269 active_tree_->page_scale_factor()->PullDeltaForMainThread(); 3262 active_tree_->page_scale_factor()->PullDeltaForMainThread();
3270 scroll_info->top_controls_delta = 3263 scroll_info->top_controls_delta =
3271 active_tree()->top_controls_shown_ratio()->PullDeltaForMainThread(); 3264 active_tree()->top_controls_shown_ratio()->PullDeltaForMainThread();
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
3970 return task_runner_provider_->HasImplThread(); 3963 return task_runner_provider_->HasImplThread();
3971 } 3964 }
3972 3965
3973 bool LayerTreeHostImpl::CommitToActiveTree() const { 3966 bool LayerTreeHostImpl::CommitToActiveTree() const {
3974 // In single threaded mode we skip the pending tree and commit directly to the 3967 // In single threaded mode we skip the pending tree and commit directly to the
3975 // active tree. 3968 // active tree.
3976 return !task_runner_provider_->HasImplThread(); 3969 return !task_runner_provider_->HasImplThread();
3977 } 3970 }
3978 3971
3979 } // namespace cc 3972 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698