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

Side by Side Diff: cc/trees/layer_tree_impl.cc

Issue 1736073002: cc: Move SyncedScrollOffset to scroll tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve comments 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
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_impl.h" 5 #include "cc/trees/layer_tree_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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 inner_scroll->bounds_delta()); 311 inner_scroll->bounds_delta());
312 } 312 }
313 313
314 void LayerTreeImpl::PushPropertiesTo(LayerTreeImpl* target_tree) { 314 void LayerTreeImpl::PushPropertiesTo(LayerTreeImpl* target_tree) {
315 // The request queue should have been processed and does not require a push. 315 // The request queue should have been processed and does not require a push.
316 DCHECK_EQ(ui_resource_request_queue_.size(), 0u); 316 DCHECK_EQ(ui_resource_request_queue_.size(), 0u);
317 317
318 LayerImpl* layer = target_tree->CurrentlyScrollingLayer(); 318 LayerImpl* layer = target_tree->CurrentlyScrollingLayer();
319 target_tree->SetPropertyTrees(property_trees_); 319 target_tree->SetPropertyTrees(property_trees_);
320 target_tree->SetCurrentlyScrollingLayer(layer); 320 target_tree->SetCurrentlyScrollingLayer(layer);
321 target_tree->UpdatePropertyTreeScrollOffset(&property_trees_);
321 322
322 if (next_activation_forces_redraw_) { 323 if (next_activation_forces_redraw_) {
323 target_tree->ForceRedrawNextActivation(); 324 target_tree->ForceRedrawNextActivation();
324 next_activation_forces_redraw_ = false; 325 next_activation_forces_redraw_ = false;
325 } 326 }
326 327
327 target_tree->PassSwapPromises(&swap_promise_list_); 328 target_tree->PassSwapPromises(&swap_promise_list_);
328 329
329 target_tree->set_top_controls_shrink_blink_size( 330 target_tree->set_top_controls_shrink_blink_size(
330 top_controls_shrink_blink_size_); 331 top_controls_shrink_blink_size_);
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 void LayerTreeImpl::ApplySentScrollAndScaleDeltasFromAbortedCommit() { 662 void LayerTreeImpl::ApplySentScrollAndScaleDeltasFromAbortedCommit() {
662 DCHECK(IsActiveTree()); 663 DCHECK(IsActiveTree());
663 664
664 page_scale_factor()->AbortCommit(); 665 page_scale_factor()->AbortCommit();
665 top_controls_shown_ratio()->AbortCommit(); 666 top_controls_shown_ratio()->AbortCommit();
666 elastic_overscroll()->AbortCommit(); 667 elastic_overscroll()->AbortCommit();
667 668
668 if (!root_layer()) 669 if (!root_layer())
669 return; 670 return;
670 671
671 LayerTreeHostCommon::CallFunctionForSubtree( 672 property_trees()->scroll_tree.ApplySentScrollDeltasFromAbortedCommit();
672 root_layer(), [](LayerImpl* layer) {
673 layer->ApplySentScrollDeltasFromAbortedCommit();
674 });
675 } 673 }
676 674
677 void LayerTreeImpl::SetViewportLayersFromIds( 675 void LayerTreeImpl::SetViewportLayersFromIds(
678 int overscroll_elasticity_layer_id, 676 int overscroll_elasticity_layer_id,
679 int page_scale_layer_id, 677 int page_scale_layer_id,
680 int inner_viewport_scroll_layer_id, 678 int inner_viewport_scroll_layer_id,
681 int outer_viewport_scroll_layer_id) { 679 int outer_viewport_scroll_layer_id) {
682 overscroll_elasticity_layer_id_ = overscroll_elasticity_layer_id; 680 overscroll_elasticity_layer_id_ = overscroll_elasticity_layer_id;
683 page_scale_layer_id_ = page_scale_layer_id; 681 page_scale_layer_id_ = page_scale_layer_id;
684 inner_viewport_scroll_layer_id_ = inner_viewport_scroll_layer_id; 682 inner_viewport_scroll_layer_id_ = inner_viewport_scroll_layer_id;
(...skipping 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after
2036 const gfx::BoxF& box, 2034 const gfx::BoxF& box,
2037 gfx::BoxF* bounds) const { 2035 gfx::BoxF* bounds) const {
2038 *bounds = gfx::BoxF(); 2036 *bounds = gfx::BoxF();
2039 return layer_tree_host_impl_->animation_host() 2037 return layer_tree_host_impl_->animation_host()
2040 ? layer_tree_host_impl_->animation_host() 2038 ? layer_tree_host_impl_->animation_host()
2041 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) 2039 ->TransformAnimationBoundsForBox(layer->id(), box, bounds)
2042 : true; 2040 : true;
2043 } 2041 }
2044 2042
2045 } // namespace cc 2043 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698