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

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

Issue 2106753004: Introduce bottom controls to CC and let it respond to scrolling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adjust documentations Created 4 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_host.h" 5 #include "cc/trees/layer_tree_host.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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 page_scale_factor_, min_page_scale_factor_, max_page_scale_factor_); 512 page_scale_factor_, min_page_scale_factor_, max_page_scale_factor_);
513 sync_tree->elastic_overscroll()->PushFromMainThread(elastic_overscroll_); 513 sync_tree->elastic_overscroll()->PushFromMainThread(elastic_overscroll_);
514 if (sync_tree->IsActiveTree()) 514 if (sync_tree->IsActiveTree())
515 sync_tree->elastic_overscroll()->PushPendingToActive(); 515 sync_tree->elastic_overscroll()->PushPendingToActive();
516 516
517 sync_tree->PassSwapPromises(&swap_promise_list_); 517 sync_tree->PassSwapPromises(&swap_promise_list_);
518 518
519 sync_tree->set_top_controls_shrink_blink_size( 519 sync_tree->set_top_controls_shrink_blink_size(
520 top_controls_shrink_blink_size_); 520 top_controls_shrink_blink_size_);
521 sync_tree->set_top_controls_height(top_controls_height_); 521 sync_tree->set_top_controls_height(top_controls_height_);
522 sync_tree->set_bottom_controls_height(bottom_controls_height_);
522 sync_tree->PushTopControlsFromMainThread(top_controls_shown_ratio_); 523 sync_tree->PushTopControlsFromMainThread(top_controls_shown_ratio_);
523 524
524 host_impl->SetHasGpuRasterizationTrigger(has_gpu_rasterization_trigger_); 525 host_impl->SetHasGpuRasterizationTrigger(has_gpu_rasterization_trigger_);
525 host_impl->SetContentIsSuitableForGpuRasterization( 526 host_impl->SetContentIsSuitableForGpuRasterization(
526 content_is_suitable_for_gpu_rasterization_); 527 content_is_suitable_for_gpu_rasterization_);
527 RecordGpuRasterizationHistogram(); 528 RecordGpuRasterizationHistogram();
528 529
529 host_impl->SetViewportSize(device_viewport_size_); 530 host_impl->SetViewportSize(device_viewport_size_);
530 // TODO(senorblanco): Move this up so that it happens before GPU rasterization 531 // TODO(senorblanco): Move this up so that it happens before GPU rasterization
531 // properties are set, since those trigger an update of GPU rasterization 532 // properties are set, since those trigger an update of GPU rasterization
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 } 828 }
828 829
829 void LayerTreeHost::SetTopControlsShownRatio(float ratio) { 830 void LayerTreeHost::SetTopControlsShownRatio(float ratio) {
830 if (top_controls_shown_ratio_ == ratio) 831 if (top_controls_shown_ratio_ == ratio)
831 return; 832 return;
832 833
833 top_controls_shown_ratio_ = ratio; 834 top_controls_shown_ratio_ = ratio;
834 SetNeedsCommit(); 835 SetNeedsCommit();
835 } 836 }
836 837
838 void LayerTreeHost::setBottomControlHeight(float height) {
839 if (bottom_controls_height_ == height)
840 return;
841
842 bottom_controls_height_ = height;
843 SetNeedsCommit();
844 }
845
837 void LayerTreeHost::ApplyPageScaleDeltaFromImplSide(float page_scale_delta) { 846 void LayerTreeHost::ApplyPageScaleDeltaFromImplSide(float page_scale_delta) {
838 DCHECK(CommitRequested()); 847 DCHECK(CommitRequested());
839 if (page_scale_delta == 1.f) 848 if (page_scale_delta == 1.f)
840 return; 849 return;
841 page_scale_factor_ *= page_scale_delta; 850 page_scale_factor_ *= page_scale_delta;
842 SetPropertyTreesNeedRebuild(); 851 SetPropertyTreesNeedRebuild();
843 } 852 }
844 853
845 void LayerTreeHost::SetPageScaleFactorAndLimits(float page_scale_factor, 854 void LayerTreeHost::SetPageScaleFactorAndLimits(float page_scale_factor,
846 float min_page_scale_factor, 855 float min_page_scale_factor,
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after
1723 int seq_num = property_trees_.sequence_number; 1732 int seq_num = property_trees_.sequence_number;
1724 LayerTreeHostCommon::CallFunctionForEveryLayer(this, [seq_num](Layer* layer) { 1733 LayerTreeHostCommon::CallFunctionForEveryLayer(this, [seq_num](Layer* layer) {
1725 layer->set_property_tree_sequence_number(seq_num); 1734 layer->set_property_tree_sequence_number(seq_num);
1726 }); 1735 });
1727 1736
1728 surface_id_namespace_ = proto.surface_id_namespace(); 1737 surface_id_namespace_ = proto.surface_id_namespace();
1729 next_surface_sequence_ = proto.next_surface_sequence(); 1738 next_surface_sequence_ = proto.next_surface_sequence();
1730 } 1739 }
1731 1740
1732 } // namespace cc 1741 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698