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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 | 418 |
419 target_tree->PassSwapPromises(std::move(swap_promise_list_)); | 419 target_tree->PassSwapPromises(std::move(swap_promise_list_)); |
420 swap_promise_list_.clear(); | 420 swap_promise_list_.clear(); |
421 | 421 |
422 target_tree->set_browser_controls_shrink_blink_size( | 422 target_tree->set_browser_controls_shrink_blink_size( |
423 browser_controls_shrink_blink_size_); | 423 browser_controls_shrink_blink_size_); |
424 target_tree->set_top_controls_height(top_controls_height_); | 424 target_tree->set_top_controls_height(top_controls_height_); |
425 target_tree->set_bottom_controls_height(bottom_controls_height_); | 425 target_tree->set_bottom_controls_height(bottom_controls_height_); |
426 target_tree->PushBrowserControls(nullptr); | 426 target_tree->PushBrowserControls(nullptr); |
427 | 427 |
| 428 target_tree->set_scroll_boundary_behavior(scroll_boundary_behavior_); |
| 429 |
428 // The page scale factor update can affect scrolling which requires that | 430 // The page scale factor update can affect scrolling which requires that |
429 // these ids are set, so this must be before PushPageScaleFactorAndLimits. | 431 // these ids are set, so this must be before PushPageScaleFactorAndLimits. |
430 target_tree->SetViewportLayersFromIds(viewport_layer_ids_); | 432 target_tree->SetViewportLayersFromIds(viewport_layer_ids_); |
431 | 433 |
432 // Active tree already shares the page_scale_factor object with pending | 434 // Active tree already shares the page_scale_factor object with pending |
433 // tree so only the limits need to be provided. | 435 // tree so only the limits need to be provided. |
434 target_tree->PushPageScaleFactorAndLimits(nullptr, min_page_scale_factor(), | 436 target_tree->PushPageScaleFactorAndLimits(nullptr, min_page_scale_factor(), |
435 max_page_scale_factor()); | 437 max_page_scale_factor()); |
436 target_tree->SetDeviceScaleFactor(device_scale_factor()); | 438 target_tree->SetDeviceScaleFactor(device_scale_factor()); |
437 target_tree->set_painted_device_scale_factor(painted_device_scale_factor()); | 439 target_tree->set_painted_device_scale_factor(painted_device_scale_factor()); |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 | 816 |
815 void LayerTreeImpl::set_bottom_controls_height(float bottom_controls_height) { | 817 void LayerTreeImpl::set_bottom_controls_height(float bottom_controls_height) { |
816 if (bottom_controls_height_ == bottom_controls_height) | 818 if (bottom_controls_height_ == bottom_controls_height) |
817 return; | 819 return; |
818 | 820 |
819 bottom_controls_height_ = bottom_controls_height; | 821 bottom_controls_height_ = bottom_controls_height; |
820 if (IsActiveTree()) | 822 if (IsActiveTree()) |
821 layer_tree_host_impl_->UpdateViewportContainerSizes(); | 823 layer_tree_host_impl_->UpdateViewportContainerSizes(); |
822 } | 824 } |
823 | 825 |
| 826 void LayerTreeImpl::set_scroll_boundary_behavior( |
| 827 const ScrollBoundaryBehavior& behavior) { |
| 828 scroll_boundary_behavior_ = behavior; |
| 829 } |
| 830 |
824 bool LayerTreeImpl::ClampBrowserControlsShownRatio() { | 831 bool LayerTreeImpl::ClampBrowserControlsShownRatio() { |
825 float ratio = top_controls_shown_ratio_->Current(true); | 832 float ratio = top_controls_shown_ratio_->Current(true); |
826 ratio = std::max(ratio, 0.f); | 833 ratio = std::max(ratio, 0.f); |
827 ratio = std::min(ratio, 1.f); | 834 ratio = std::min(ratio, 1.f); |
828 return top_controls_shown_ratio_->SetCurrent(ratio); | 835 return top_controls_shown_ratio_->SetCurrent(ratio); |
829 } | 836 } |
830 | 837 |
831 bool LayerTreeImpl::SetCurrentBrowserControlsShownRatio(float ratio) { | 838 bool LayerTreeImpl::SetCurrentBrowserControlsShownRatio(float ratio) { |
832 bool changed = top_controls_shown_ratio_->SetCurrent(ratio); | 839 bool changed = top_controls_shown_ratio_->SetCurrent(ratio); |
833 changed |= ClampBrowserControlsShownRatio(); | 840 changed |= ClampBrowserControlsShownRatio(); |
(...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2079 | 2086 |
2080 void LayerTreeImpl::ResetAllChangeTracking() { | 2087 void LayerTreeImpl::ResetAllChangeTracking() { |
2081 layers_that_should_push_properties_.clear(); | 2088 layers_that_should_push_properties_.clear(); |
2082 // Iterate over all layers, including masks. | 2089 // Iterate over all layers, including masks. |
2083 for (auto& layer : *layers_) | 2090 for (auto& layer : *layers_) |
2084 layer->ResetChangeTracking(); | 2091 layer->ResetChangeTracking(); |
2085 property_trees_.ResetAllChangeTracking(); | 2092 property_trees_.ResetAllChangeTracking(); |
2086 } | 2093 } |
2087 | 2094 |
2088 } // namespace cc | 2095 } // namespace cc |
OLD | NEW |