Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Side by Side Diff: cc/trees/layer_tree_impl.cc

Issue 2884423003: Use scroll-boundary-behavior to control overscroll-refresh/glow on android. (Closed)
Patch Set: rebase Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 427
428 target_tree->PassSwapPromises(std::move(swap_promise_list_)); 428 target_tree->PassSwapPromises(std::move(swap_promise_list_));
429 swap_promise_list_.clear(); 429 swap_promise_list_.clear();
430 430
431 target_tree->set_browser_controls_shrink_blink_size( 431 target_tree->set_browser_controls_shrink_blink_size(
432 browser_controls_shrink_blink_size_); 432 browser_controls_shrink_blink_size_);
433 target_tree->set_top_controls_height(top_controls_height_); 433 target_tree->set_top_controls_height(top_controls_height_);
434 target_tree->set_bottom_controls_height(bottom_controls_height_); 434 target_tree->set_bottom_controls_height(bottom_controls_height_);
435 target_tree->PushBrowserControls(nullptr); 435 target_tree->PushBrowserControls(nullptr);
436 436
437 target_tree->set_scroll_boundary_behavior(scroll_boundary_behavior_);
438
437 // The page scale factor update can affect scrolling which requires that 439 // The page scale factor update can affect scrolling which requires that
438 // these ids are set, so this must be before PushPageScaleFactorAndLimits. 440 // these ids are set, so this must be before PushPageScaleFactorAndLimits.
439 target_tree->SetViewportLayersFromIds(viewport_layer_ids_); 441 target_tree->SetViewportLayersFromIds(viewport_layer_ids_);
440 442
441 // Active tree already shares the page_scale_factor object with pending 443 // Active tree already shares the page_scale_factor object with pending
442 // tree so only the limits need to be provided. 444 // tree so only the limits need to be provided.
443 target_tree->PushPageScaleFactorAndLimits(nullptr, min_page_scale_factor(), 445 target_tree->PushPageScaleFactorAndLimits(nullptr, min_page_scale_factor(),
444 max_page_scale_factor()); 446 max_page_scale_factor());
445 target_tree->SetDeviceScaleFactor(device_scale_factor()); 447 target_tree->SetDeviceScaleFactor(device_scale_factor());
446 target_tree->set_painted_device_scale_factor(painted_device_scale_factor()); 448 target_tree->set_painted_device_scale_factor(painted_device_scale_factor());
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 827
826 void LayerTreeImpl::set_bottom_controls_height(float bottom_controls_height) { 828 void LayerTreeImpl::set_bottom_controls_height(float bottom_controls_height) {
827 if (bottom_controls_height_ == bottom_controls_height) 829 if (bottom_controls_height_ == bottom_controls_height)
828 return; 830 return;
829 831
830 bottom_controls_height_ = bottom_controls_height; 832 bottom_controls_height_ = bottom_controls_height;
831 if (IsActiveTree()) 833 if (IsActiveTree())
832 layer_tree_host_impl_->UpdateViewportContainerSizes(); 834 layer_tree_host_impl_->UpdateViewportContainerSizes();
833 } 835 }
834 836
837 void LayerTreeImpl::set_scroll_boundary_behavior(
838 const ScrollBoundaryBehavior& behavior) {
839 scroll_boundary_behavior_ = behavior;
840 }
841
835 bool LayerTreeImpl::ClampBrowserControlsShownRatio() { 842 bool LayerTreeImpl::ClampBrowserControlsShownRatio() {
836 float ratio = top_controls_shown_ratio_->Current(true); 843 float ratio = top_controls_shown_ratio_->Current(true);
837 ratio = std::max(ratio, 0.f); 844 ratio = std::max(ratio, 0.f);
838 ratio = std::min(ratio, 1.f); 845 ratio = std::min(ratio, 1.f);
839 return top_controls_shown_ratio_->SetCurrent(ratio); 846 return top_controls_shown_ratio_->SetCurrent(ratio);
840 } 847 }
841 848
842 bool LayerTreeImpl::SetCurrentBrowserControlsShownRatio(float ratio) { 849 bool LayerTreeImpl::SetCurrentBrowserControlsShownRatio(float ratio) {
843 bool changed = top_controls_shown_ratio_->SetCurrent(ratio); 850 bool changed = top_controls_shown_ratio_->SetCurrent(ratio);
844 changed |= ClampBrowserControlsShownRatio(); 851 changed |= ClampBrowserControlsShownRatio();
(...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after
2083 2090
2084 void LayerTreeImpl::ResetAllChangeTracking() { 2091 void LayerTreeImpl::ResetAllChangeTracking() {
2085 layers_that_should_push_properties_.clear(); 2092 layers_that_should_push_properties_.clear();
2086 // Iterate over all layers, including masks. 2093 // Iterate over all layers, including masks.
2087 for (auto& layer : *layers_) 2094 for (auto& layer : *layers_)
2088 layer->ResetChangeTracking(); 2095 layer->ResetChangeTracking();
2089 property_trees_.ResetAllChangeTracking(); 2096 property_trees_.ResetAllChangeTracking();
2090 } 2097 }
2091 2098
2092 } // namespace cc 2099 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698