| 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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 | 813 |
| 812 void LayerTreeImpl::set_bottom_controls_height(float bottom_controls_height) { | 814 void LayerTreeImpl::set_bottom_controls_height(float bottom_controls_height) { |
| 813 if (bottom_controls_height_ == bottom_controls_height) | 815 if (bottom_controls_height_ == bottom_controls_height) |
| 814 return; | 816 return; |
| 815 | 817 |
| 816 bottom_controls_height_ = bottom_controls_height; | 818 bottom_controls_height_ = bottom_controls_height; |
| 817 if (IsActiveTree()) | 819 if (IsActiveTree()) |
| 818 host_impl_->UpdateViewportContainerSizes(); | 820 host_impl_->UpdateViewportContainerSizes(); |
| 819 } | 821 } |
| 820 | 822 |
| 823 void LayerTreeImpl::set_scroll_boundary_behavior( |
| 824 const ScrollBoundaryBehavior& behavior) { |
| 825 scroll_boundary_behavior_ = behavior; |
| 826 } |
| 827 |
| 821 bool LayerTreeImpl::ClampBrowserControlsShownRatio() { | 828 bool LayerTreeImpl::ClampBrowserControlsShownRatio() { |
| 822 float ratio = top_controls_shown_ratio_->Current(true); | 829 float ratio = top_controls_shown_ratio_->Current(true); |
| 823 ratio = std::max(ratio, 0.f); | 830 ratio = std::max(ratio, 0.f); |
| 824 ratio = std::min(ratio, 1.f); | 831 ratio = std::min(ratio, 1.f); |
| 825 return top_controls_shown_ratio_->SetCurrent(ratio); | 832 return top_controls_shown_ratio_->SetCurrent(ratio); |
| 826 } | 833 } |
| 827 | 834 |
| 828 bool LayerTreeImpl::SetCurrentBrowserControlsShownRatio(float ratio) { | 835 bool LayerTreeImpl::SetCurrentBrowserControlsShownRatio(float ratio) { |
| 829 bool changed = top_controls_shown_ratio_->SetCurrent(ratio); | 836 bool changed = top_controls_shown_ratio_->SetCurrent(ratio); |
| 830 changed |= ClampBrowserControlsShownRatio(); | 837 changed |= ClampBrowserControlsShownRatio(); |
| (...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2078 | 2085 |
| 2079 void LayerTreeImpl::ResetAllChangeTracking() { | 2086 void LayerTreeImpl::ResetAllChangeTracking() { |
| 2080 layers_that_should_push_properties_.clear(); | 2087 layers_that_should_push_properties_.clear(); |
| 2081 // Iterate over all layers, including masks. | 2088 // Iterate over all layers, including masks. |
| 2082 for (auto& layer : *layers_) | 2089 for (auto& layer : *layers_) |
| 2083 layer->ResetChangeTracking(); | 2090 layer->ResetChangeTracking(); |
| 2084 property_trees_.ResetAllChangeTracking(); | 2091 property_trees_.ResetAllChangeTracking(); |
| 2085 } | 2092 } |
| 2086 | 2093 |
| 2087 } // namespace cc | 2094 } // namespace cc |
| OLD | NEW |