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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 | 789 |
788 void LayerTreeImpl::set_bottom_controls_height(float bottom_controls_height) { | 790 void LayerTreeImpl::set_bottom_controls_height(float bottom_controls_height) { |
789 if (bottom_controls_height_ == bottom_controls_height) | 791 if (bottom_controls_height_ == bottom_controls_height) |
790 return; | 792 return; |
791 | 793 |
792 bottom_controls_height_ = bottom_controls_height; | 794 bottom_controls_height_ = bottom_controls_height; |
793 if (IsActiveTree()) | 795 if (IsActiveTree()) |
794 host_impl_->UpdateViewportContainerSizes(); | 796 host_impl_->UpdateViewportContainerSizes(); |
795 } | 797 } |
796 | 798 |
| 799 void LayerTreeImpl::set_scroll_boundary_behavior( |
| 800 const ScrollBoundaryBehavior& behavior) { |
| 801 scroll_boundary_behavior_ = behavior; |
| 802 } |
| 803 |
797 bool LayerTreeImpl::ClampBrowserControlsShownRatio() { | 804 bool LayerTreeImpl::ClampBrowserControlsShownRatio() { |
798 float ratio = top_controls_shown_ratio_->Current(true); | 805 float ratio = top_controls_shown_ratio_->Current(true); |
799 ratio = std::max(ratio, 0.f); | 806 ratio = std::max(ratio, 0.f); |
800 ratio = std::min(ratio, 1.f); | 807 ratio = std::min(ratio, 1.f); |
801 return top_controls_shown_ratio_->SetCurrent(ratio); | 808 return top_controls_shown_ratio_->SetCurrent(ratio); |
802 } | 809 } |
803 | 810 |
804 bool LayerTreeImpl::SetCurrentBrowserControlsShownRatio(float ratio) { | 811 bool LayerTreeImpl::SetCurrentBrowserControlsShownRatio(float ratio) { |
805 bool changed = top_controls_shown_ratio_->SetCurrent(ratio); | 812 bool changed = top_controls_shown_ratio_->SetCurrent(ratio); |
806 changed |= ClampBrowserControlsShownRatio(); | 813 changed |= ClampBrowserControlsShownRatio(); |
(...skipping 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2051 | 2058 |
2052 void LayerTreeImpl::ResetAllChangeTracking() { | 2059 void LayerTreeImpl::ResetAllChangeTracking() { |
2053 layers_that_should_push_properties_.clear(); | 2060 layers_that_should_push_properties_.clear(); |
2054 // Iterate over all layers, including masks. | 2061 // Iterate over all layers, including masks. |
2055 for (auto& layer : *layers_) | 2062 for (auto& layer : *layers_) |
2056 layer->ResetChangeTracking(); | 2063 layer->ResetChangeTracking(); |
2057 property_trees_.ResetAllChangeTracking(); | 2064 property_trees_.ResetAllChangeTracking(); |
2058 } | 2065 } |
2059 | 2066 |
2060 } // namespace cc | 2067 } // namespace cc |
OLD | NEW |