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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 | 433 |
434 target_tree->PassSwapPromises(std::move(swap_promise_list_)); | 434 target_tree->PassSwapPromises(std::move(swap_promise_list_)); |
435 swap_promise_list_.clear(); | 435 swap_promise_list_.clear(); |
436 | 436 |
437 target_tree->set_browser_controls_shrink_blink_size( | 437 target_tree->set_browser_controls_shrink_blink_size( |
438 browser_controls_shrink_blink_size_); | 438 browser_controls_shrink_blink_size_); |
439 target_tree->set_top_controls_height(top_controls_height_); | 439 target_tree->set_top_controls_height(top_controls_height_); |
440 target_tree->set_bottom_controls_height(bottom_controls_height_); | 440 target_tree->set_bottom_controls_height(bottom_controls_height_); |
441 target_tree->PushBrowserControls(nullptr); | 441 target_tree->PushBrowserControls(nullptr); |
442 | 442 |
| 443 target_tree->set_scroll_boundary_behavior(scroll_boundary_behavior_); |
| 444 |
443 // The page scale factor update can affect scrolling which requires that | 445 // The page scale factor update can affect scrolling which requires that |
444 // these ids are set, so this must be before PushPageScaleFactorAndLimits. | 446 // these ids are set, so this must be before PushPageScaleFactorAndLimits. |
445 target_tree->SetViewportLayersFromIds(viewport_layer_ids_); | 447 target_tree->SetViewportLayersFromIds(viewport_layer_ids_); |
446 | 448 |
447 // Active tree already shares the page_scale_factor object with pending | 449 // Active tree already shares the page_scale_factor object with pending |
448 // tree so only the limits need to be provided. | 450 // tree so only the limits need to be provided. |
449 target_tree->PushPageScaleFactorAndLimits(nullptr, min_page_scale_factor(), | 451 target_tree->PushPageScaleFactorAndLimits(nullptr, min_page_scale_factor(), |
450 max_page_scale_factor()); | 452 max_page_scale_factor()); |
451 target_tree->SetDeviceScaleFactor(device_scale_factor()); | 453 target_tree->SetDeviceScaleFactor(device_scale_factor()); |
452 target_tree->set_painted_device_scale_factor(painted_device_scale_factor()); | 454 target_tree->set_painted_device_scale_factor(painted_device_scale_factor()); |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 | 855 |
854 void LayerTreeImpl::set_bottom_controls_height(float bottom_controls_height) { | 856 void LayerTreeImpl::set_bottom_controls_height(float bottom_controls_height) { |
855 if (bottom_controls_height_ == bottom_controls_height) | 857 if (bottom_controls_height_ == bottom_controls_height) |
856 return; | 858 return; |
857 | 859 |
858 bottom_controls_height_ = bottom_controls_height; | 860 bottom_controls_height_ = bottom_controls_height; |
859 if (IsActiveTree()) | 861 if (IsActiveTree()) |
860 layer_tree_host_impl_->UpdateViewportContainerSizes(); | 862 layer_tree_host_impl_->UpdateViewportContainerSizes(); |
861 } | 863 } |
862 | 864 |
| 865 void LayerTreeImpl::set_scroll_boundary_behavior( |
| 866 const ScrollBoundaryBehavior& behavior) { |
| 867 scroll_boundary_behavior_ = behavior; |
| 868 } |
| 869 |
863 bool LayerTreeImpl::ClampBrowserControlsShownRatio() { | 870 bool LayerTreeImpl::ClampBrowserControlsShownRatio() { |
864 float ratio = top_controls_shown_ratio_->Current(true); | 871 float ratio = top_controls_shown_ratio_->Current(true); |
865 ratio = std::max(ratio, 0.f); | 872 ratio = std::max(ratio, 0.f); |
866 ratio = std::min(ratio, 1.f); | 873 ratio = std::min(ratio, 1.f); |
867 return top_controls_shown_ratio_->SetCurrent(ratio); | 874 return top_controls_shown_ratio_->SetCurrent(ratio); |
868 } | 875 } |
869 | 876 |
870 bool LayerTreeImpl::SetCurrentBrowserControlsShownRatio(float ratio) { | 877 bool LayerTreeImpl::SetCurrentBrowserControlsShownRatio(float ratio) { |
871 bool changed = top_controls_shown_ratio_->SetCurrent(ratio); | 878 bool changed = top_controls_shown_ratio_->SetCurrent(ratio); |
872 changed |= ClampBrowserControlsShownRatio(); | 879 changed |= ClampBrowserControlsShownRatio(); |
(...skipping 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2109 | 2116 |
2110 void LayerTreeImpl::ResetAllChangeTracking() { | 2117 void LayerTreeImpl::ResetAllChangeTracking() { |
2111 layers_that_should_push_properties_.clear(); | 2118 layers_that_should_push_properties_.clear(); |
2112 // Iterate over all layers, including masks. | 2119 // Iterate over all layers, including masks. |
2113 for (auto& layer : *layers_) | 2120 for (auto& layer : *layers_) |
2114 layer->ResetChangeTracking(); | 2121 layer->ResetChangeTracking(); |
2115 property_trees_.ResetAllChangeTracking(); | 2122 property_trees_.ResetAllChangeTracking(); |
2116 } | 2123 } |
2117 | 2124 |
2118 } // namespace cc | 2125 } // namespace cc |
OLD | NEW |