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_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 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 page_scale_factor_, min_page_scale_factor_, max_page_scale_factor_); | 509 page_scale_factor_, min_page_scale_factor_, max_page_scale_factor_); |
510 sync_tree->elastic_overscroll()->PushFromMainThread(elastic_overscroll_); | 510 sync_tree->elastic_overscroll()->PushFromMainThread(elastic_overscroll_); |
511 if (sync_tree->IsActiveTree()) | 511 if (sync_tree->IsActiveTree()) |
512 sync_tree->elastic_overscroll()->PushPendingToActive(); | 512 sync_tree->elastic_overscroll()->PushPendingToActive(); |
513 | 513 |
514 sync_tree->PassSwapPromises(std::move(swap_promise_list_)); | 514 sync_tree->PassSwapPromises(std::move(swap_promise_list_)); |
515 | 515 |
516 sync_tree->set_top_controls_shrink_blink_size( | 516 sync_tree->set_top_controls_shrink_blink_size( |
517 top_controls_shrink_blink_size_); | 517 top_controls_shrink_blink_size_); |
518 sync_tree->set_top_controls_height(top_controls_height_); | 518 sync_tree->set_top_controls_height(top_controls_height_); |
| 519 sync_tree->set_bottom_controls_height(bottom_controls_height_); |
519 sync_tree->PushTopControlsFromMainThread(top_controls_shown_ratio_); | 520 sync_tree->PushTopControlsFromMainThread(top_controls_shown_ratio_); |
520 | 521 |
521 host_impl->SetHasGpuRasterizationTrigger(has_gpu_rasterization_trigger_); | 522 host_impl->SetHasGpuRasterizationTrigger(has_gpu_rasterization_trigger_); |
522 host_impl->SetContentIsSuitableForGpuRasterization( | 523 host_impl->SetContentIsSuitableForGpuRasterization( |
523 content_is_suitable_for_gpu_rasterization_); | 524 content_is_suitable_for_gpu_rasterization_); |
524 RecordGpuRasterizationHistogram(); | 525 RecordGpuRasterizationHistogram(); |
525 | 526 |
526 host_impl->SetViewportSize(device_viewport_size_); | 527 host_impl->SetViewportSize(device_viewport_size_); |
527 // TODO(senorblanco): Move this up so that it happens before GPU rasterization | 528 // TODO(senorblanco): Move this up so that it happens before GPU rasterization |
528 // properties are set, since those trigger an update of GPU rasterization | 529 // properties are set, since those trigger an update of GPU rasterization |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 } | 825 } |
825 | 826 |
826 void LayerTreeHost::SetTopControlsShownRatio(float ratio) { | 827 void LayerTreeHost::SetTopControlsShownRatio(float ratio) { |
827 if (top_controls_shown_ratio_ == ratio) | 828 if (top_controls_shown_ratio_ == ratio) |
828 return; | 829 return; |
829 | 830 |
830 top_controls_shown_ratio_ = ratio; | 831 top_controls_shown_ratio_ = ratio; |
831 SetNeedsCommit(); | 832 SetNeedsCommit(); |
832 } | 833 } |
833 | 834 |
| 835 void LayerTreeHost::setBottomControlHeight(float height) { |
| 836 if (bottom_controls_height_ == height) |
| 837 return; |
| 838 |
| 839 bottom_controls_height_ = height; |
| 840 SetNeedsCommit(); |
| 841 } |
| 842 |
834 void LayerTreeHost::ApplyPageScaleDeltaFromImplSide(float page_scale_delta) { | 843 void LayerTreeHost::ApplyPageScaleDeltaFromImplSide(float page_scale_delta) { |
835 DCHECK(CommitRequested()); | 844 DCHECK(CommitRequested()); |
836 if (page_scale_delta == 1.f) | 845 if (page_scale_delta == 1.f) |
837 return; | 846 return; |
838 page_scale_factor_ *= page_scale_delta; | 847 page_scale_factor_ *= page_scale_delta; |
839 SetPropertyTreesNeedRebuild(); | 848 SetPropertyTreesNeedRebuild(); |
840 } | 849 } |
841 | 850 |
842 void LayerTreeHost::SetPageScaleFactorAndLimits(float page_scale_factor, | 851 void LayerTreeHost::SetPageScaleFactorAndLimits(float page_scale_factor, |
843 float min_page_scale_factor, | 852 float min_page_scale_factor, |
(...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1675 | 1684 |
1676 surface_client_id_ = proto.surface_client_id(); | 1685 surface_client_id_ = proto.surface_client_id(); |
1677 next_surface_sequence_ = proto.next_surface_sequence(); | 1686 next_surface_sequence_ = proto.next_surface_sequence(); |
1678 } | 1687 } |
1679 | 1688 |
1680 AnimationHost* LayerTreeHost::animation_host() const { | 1689 AnimationHost* LayerTreeHost::animation_host() const { |
1681 return layer_tree_.animation_host(); | 1690 return layer_tree_.animation_host(); |
1682 } | 1691 } |
1683 | 1692 |
1684 } // namespace cc | 1693 } // namespace cc |
OLD | NEW |