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 17 matching lines...) Expand all Loading... |
28 #include "base/threading/thread_task_runner_handle.h" | 28 #include "base/threading/thread_task_runner_handle.h" |
29 #include "base/timer/elapsed_timer.h" | 29 #include "base/timer/elapsed_timer.h" |
30 #include "base/trace_event/trace_event.h" | 30 #include "base/trace_event/trace_event.h" |
31 #include "base/trace_event/trace_event_argument.h" | 31 #include "base/trace_event/trace_event_argument.h" |
32 #include "cc/base/devtools_instrumentation.h" | 32 #include "cc/base/devtools_instrumentation.h" |
33 #include "cc/base/histograms.h" | 33 #include "cc/base/histograms.h" |
34 #include "cc/base/math_util.h" | 34 #include "cc/base/math_util.h" |
35 #include "cc/debug/rendering_stats_instrumentation.h" | 35 #include "cc/debug/rendering_stats_instrumentation.h" |
36 #include "cc/input/layer_selection_bound.h" | 36 #include "cc/input/layer_selection_bound.h" |
37 #include "cc/input/page_scale_animation.h" | 37 #include "cc/input/page_scale_animation.h" |
| 38 #include "cc/input/scroll_boundary_behavior.h" |
38 #include "cc/layers/heads_up_display_layer.h" | 39 #include "cc/layers/heads_up_display_layer.h" |
39 #include "cc/layers/heads_up_display_layer_impl.h" | 40 #include "cc/layers/heads_up_display_layer_impl.h" |
40 #include "cc/layers/layer.h" | 41 #include "cc/layers/layer.h" |
41 #include "cc/layers/painted_scrollbar_layer.h" | 42 #include "cc/layers/painted_scrollbar_layer.h" |
42 #include "cc/resources/ui_resource_manager.h" | 43 #include "cc/resources/ui_resource_manager.h" |
43 #include "cc/tiles/frame_viewer_instrumentation.h" | 44 #include "cc/tiles/frame_viewer_instrumentation.h" |
44 #include "cc/trees/draw_property_utils.h" | 45 #include "cc/trees/draw_property_utils.h" |
45 #include "cc/trees/effect_node.h" | 46 #include "cc/trees/effect_node.h" |
46 #include "cc/trees/layer_tree_host_client.h" | 47 #include "cc/trees/layer_tree_host_client.h" |
47 #include "cc/trees/layer_tree_host_common.h" | 48 #include "cc/trees/layer_tree_host_common.h" |
(...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
974 } | 975 } |
975 | 976 |
976 void LayerTreeHost::SetBottomControlsHeight(float height) { | 977 void LayerTreeHost::SetBottomControlsHeight(float height) { |
977 if (bottom_controls_height_ == height) | 978 if (bottom_controls_height_ == height) |
978 return; | 979 return; |
979 | 980 |
980 bottom_controls_height_ = height; | 981 bottom_controls_height_ = height; |
981 SetNeedsCommit(); | 982 SetNeedsCommit(); |
982 } | 983 } |
983 | 984 |
| 985 void LayerTreeHost::SetScrollBoundaryBehavior( |
| 986 const ScrollBoundaryBehavior& behavior) { |
| 987 if (scroll_boundary_behavior_ == behavior) |
| 988 return; |
| 989 scroll_boundary_behavior_ = behavior; |
| 990 SetNeedsCommit(); |
| 991 } |
| 992 |
984 void LayerTreeHost::SetPageScaleFactorAndLimits(float page_scale_factor, | 993 void LayerTreeHost::SetPageScaleFactorAndLimits(float page_scale_factor, |
985 float min_page_scale_factor, | 994 float min_page_scale_factor, |
986 float max_page_scale_factor) { | 995 float max_page_scale_factor) { |
987 if (page_scale_factor_ == page_scale_factor && | 996 if (page_scale_factor_ == page_scale_factor && |
988 min_page_scale_factor_ == min_page_scale_factor && | 997 min_page_scale_factor_ == min_page_scale_factor && |
989 max_page_scale_factor_ == max_page_scale_factor) | 998 max_page_scale_factor_ == max_page_scale_factor) |
990 return; | 999 return; |
991 | 1000 |
992 page_scale_factor_ = page_scale_factor; | 1001 page_scale_factor_ = page_scale_factor; |
993 min_page_scale_factor_ = min_page_scale_factor; | 1002 min_page_scale_factor_ = min_page_scale_factor; |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1208 | 1217 |
1209 tree_impl->RegisterSelection(selection_); | 1218 tree_impl->RegisterSelection(selection_); |
1210 | 1219 |
1211 tree_impl->PushPageScaleFromMainThread( | 1220 tree_impl->PushPageScaleFromMainThread( |
1212 page_scale_factor_, min_page_scale_factor_, max_page_scale_factor_); | 1221 page_scale_factor_, min_page_scale_factor_, max_page_scale_factor_); |
1213 | 1222 |
1214 tree_impl->set_browser_controls_shrink_blink_size( | 1223 tree_impl->set_browser_controls_shrink_blink_size( |
1215 browser_controls_shrink_blink_size_); | 1224 browser_controls_shrink_blink_size_); |
1216 tree_impl->set_top_controls_height(top_controls_height_); | 1225 tree_impl->set_top_controls_height(top_controls_height_); |
1217 tree_impl->set_bottom_controls_height(bottom_controls_height_); | 1226 tree_impl->set_bottom_controls_height(bottom_controls_height_); |
| 1227 tree_impl->set_scroll_boundary_behavior(scroll_boundary_behavior_); |
1218 tree_impl->PushBrowserControlsFromMainThread(top_controls_shown_ratio_); | 1228 tree_impl->PushBrowserControlsFromMainThread(top_controls_shown_ratio_); |
1219 tree_impl->elastic_overscroll()->PushFromMainThread(elastic_overscroll_); | 1229 tree_impl->elastic_overscroll()->PushFromMainThread(elastic_overscroll_); |
1220 if (tree_impl->IsActiveTree()) | 1230 if (tree_impl->IsActiveTree()) |
1221 tree_impl->elastic_overscroll()->PushPendingToActive(); | 1231 tree_impl->elastic_overscroll()->PushPendingToActive(); |
1222 | 1232 |
1223 tree_impl->set_painted_device_scale_factor(painted_device_scale_factor_); | 1233 tree_impl->set_painted_device_scale_factor(painted_device_scale_factor_); |
1224 | 1234 |
1225 tree_impl->SetRasterColorSpace(raster_color_space_); | 1235 tree_impl->SetRasterColorSpace(raster_color_space_); |
1226 | 1236 |
1227 tree_impl->set_content_source_id(content_source_id_); | 1237 tree_impl->set_content_source_id(content_source_id_); |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1438 void LayerTreeHost::SetNeedsDisplayOnAllLayers() { | 1448 void LayerTreeHost::SetNeedsDisplayOnAllLayers() { |
1439 for (auto* layer : *this) | 1449 for (auto* layer : *this) |
1440 layer->SetNeedsDisplay(); | 1450 layer->SetNeedsDisplay(); |
1441 } | 1451 } |
1442 | 1452 |
1443 void LayerTreeHost::SetHasCopyRequest(bool has_copy_request) { | 1453 void LayerTreeHost::SetHasCopyRequest(bool has_copy_request) { |
1444 has_copy_request_ = has_copy_request; | 1454 has_copy_request_ = has_copy_request; |
1445 } | 1455 } |
1446 | 1456 |
1447 } // namespace cc | 1457 } // namespace cc |
OLD | NEW |