| OLD | NEW |
| 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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 inner_scroll->bounds_delta()); | 313 inner_scroll->bounds_delta()); |
| 314 } | 314 } |
| 315 | 315 |
| 316 void LayerTreeImpl::PushPropertiesTo(LayerTreeImpl* target_tree) { | 316 void LayerTreeImpl::PushPropertiesTo(LayerTreeImpl* target_tree) { |
| 317 // The request queue should have been processed and does not require a push. | 317 // The request queue should have been processed and does not require a push. |
| 318 DCHECK_EQ(ui_resource_request_queue_.size(), 0u); | 318 DCHECK_EQ(ui_resource_request_queue_.size(), 0u); |
| 319 | 319 |
| 320 LayerImpl* layer = target_tree->CurrentlyScrollingLayer(); | 320 LayerImpl* layer = target_tree->CurrentlyScrollingLayer(); |
| 321 target_tree->SetPropertyTrees(property_trees_); | 321 target_tree->SetPropertyTrees(property_trees_); |
| 322 target_tree->SetCurrentlyScrollingLayer(layer); | 322 target_tree->SetCurrentlyScrollingLayer(layer); |
| 323 target_tree->UpdatePropertyTreeScrollOffset(&property_trees_); |
| 323 | 324 |
| 324 if (next_activation_forces_redraw_) { | 325 if (next_activation_forces_redraw_) { |
| 325 target_tree->ForceRedrawNextActivation(); | 326 target_tree->ForceRedrawNextActivation(); |
| 326 next_activation_forces_redraw_ = false; | 327 next_activation_forces_redraw_ = false; |
| 327 } | 328 } |
| 328 | 329 |
| 329 target_tree->PassSwapPromises(&swap_promise_list_); | 330 target_tree->PassSwapPromises(&swap_promise_list_); |
| 330 | 331 |
| 331 target_tree->set_top_controls_shrink_blink_size( | 332 target_tree->set_top_controls_shrink_blink_size( |
| 332 top_controls_shrink_blink_size_); | 333 top_controls_shrink_blink_size_); |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 void LayerTreeImpl::ApplySentScrollAndScaleDeltasFromAbortedCommit() { | 681 void LayerTreeImpl::ApplySentScrollAndScaleDeltasFromAbortedCommit() { |
| 681 DCHECK(IsActiveTree()); | 682 DCHECK(IsActiveTree()); |
| 682 | 683 |
| 683 page_scale_factor()->AbortCommit(); | 684 page_scale_factor()->AbortCommit(); |
| 684 top_controls_shown_ratio()->AbortCommit(); | 685 top_controls_shown_ratio()->AbortCommit(); |
| 685 elastic_overscroll()->AbortCommit(); | 686 elastic_overscroll()->AbortCommit(); |
| 686 | 687 |
| 687 if (!root_layer()) | 688 if (!root_layer()) |
| 688 return; | 689 return; |
| 689 | 690 |
| 690 LayerTreeHostCommon::CallFunctionForSubtree( | 691 property_trees()->scroll_tree.ApplySentScrollDeltasFromAbortedCommit(); |
| 691 root_layer(), [](LayerImpl* layer) { | |
| 692 layer->ApplySentScrollDeltasFromAbortedCommit(); | |
| 693 }); | |
| 694 } | 692 } |
| 695 | 693 |
| 696 void LayerTreeImpl::SetViewportLayersFromIds( | 694 void LayerTreeImpl::SetViewportLayersFromIds( |
| 697 int overscroll_elasticity_layer_id, | 695 int overscroll_elasticity_layer_id, |
| 698 int page_scale_layer_id, | 696 int page_scale_layer_id, |
| 699 int inner_viewport_scroll_layer_id, | 697 int inner_viewport_scroll_layer_id, |
| 700 int outer_viewport_scroll_layer_id) { | 698 int outer_viewport_scroll_layer_id) { |
| 701 overscroll_elasticity_layer_id_ = overscroll_elasticity_layer_id; | 699 overscroll_elasticity_layer_id_ = overscroll_elasticity_layer_id; |
| 702 page_scale_layer_id_ = page_scale_layer_id; | 700 page_scale_layer_id_ = page_scale_layer_id; |
| 703 inner_viewport_scroll_layer_id_ = inner_viewport_scroll_layer_id; | 701 inner_viewport_scroll_layer_id_ = inner_viewport_scroll_layer_id; |
| (...skipping 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2050 const gfx::BoxF& box, | 2048 const gfx::BoxF& box, |
| 2051 gfx::BoxF* bounds) const { | 2049 gfx::BoxF* bounds) const { |
| 2052 *bounds = gfx::BoxF(); | 2050 *bounds = gfx::BoxF(); |
| 2053 return layer_tree_host_impl_->animation_host() | 2051 return layer_tree_host_impl_->animation_host() |
| 2054 ? layer_tree_host_impl_->animation_host() | 2052 ? layer_tree_host_impl_->animation_host() |
| 2055 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) | 2053 ->TransformAnimationBoundsForBox(layer->id(), box, bounds) |
| 2056 : true; | 2054 : true; |
| 2057 } | 2055 } |
| 2058 | 2056 |
| 2059 } // namespace cc | 2057 } // namespace cc |
| OLD | NEW |