| 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/clip_node.h" | 45 #include "cc/trees/clip_node.h" |
| 45 #include "cc/trees/draw_property_utils.h" | 46 #include "cc/trees/draw_property_utils.h" |
| 46 #include "cc/trees/effect_node.h" | 47 #include "cc/trees/effect_node.h" |
| 47 #include "cc/trees/layer_tree_host_client.h" | 48 #include "cc/trees/layer_tree_host_client.h" |
| (...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1008 } | 1009 } |
| 1009 | 1010 |
| 1010 void LayerTreeHost::SetBrowserControlsShownRatio(float ratio) { | 1011 void LayerTreeHost::SetBrowserControlsShownRatio(float ratio) { |
| 1011 if (top_controls_shown_ratio_ == ratio) | 1012 if (top_controls_shown_ratio_ == ratio) |
| 1012 return; | 1013 return; |
| 1013 | 1014 |
| 1014 top_controls_shown_ratio_ = ratio; | 1015 top_controls_shown_ratio_ = ratio; |
| 1015 SetNeedsCommit(); | 1016 SetNeedsCommit(); |
| 1016 } | 1017 } |
| 1017 | 1018 |
| 1019 void LayerTreeHost::SetScrollBoundaryBehavior( |
| 1020 const ScrollBoundaryBehavior& behavior) { |
| 1021 if (scroll_boundary_behavior_ == behavior) |
| 1022 return; |
| 1023 scroll_boundary_behavior_ = behavior; |
| 1024 SetNeedsCommit(); |
| 1025 } |
| 1026 |
| 1018 void LayerTreeHost::SetPageScaleFactorAndLimits(float page_scale_factor, | 1027 void LayerTreeHost::SetPageScaleFactorAndLimits(float page_scale_factor, |
| 1019 float min_page_scale_factor, | 1028 float min_page_scale_factor, |
| 1020 float max_page_scale_factor) { | 1029 float max_page_scale_factor) { |
| 1021 if (page_scale_factor_ == page_scale_factor && | 1030 if (page_scale_factor_ == page_scale_factor && |
| 1022 min_page_scale_factor_ == min_page_scale_factor && | 1031 min_page_scale_factor_ == min_page_scale_factor && |
| 1023 max_page_scale_factor_ == max_page_scale_factor) | 1032 max_page_scale_factor_ == max_page_scale_factor) |
| 1024 return; | 1033 return; |
| 1025 | 1034 |
| 1026 page_scale_factor_ = page_scale_factor; | 1035 page_scale_factor_ = page_scale_factor; |
| 1027 min_page_scale_factor_ = min_page_scale_factor; | 1036 min_page_scale_factor_ = min_page_scale_factor; |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1260 | 1269 |
| 1261 tree_impl->RegisterSelection(selection_); | 1270 tree_impl->RegisterSelection(selection_); |
| 1262 | 1271 |
| 1263 tree_impl->PushPageScaleFromMainThread( | 1272 tree_impl->PushPageScaleFromMainThread( |
| 1264 page_scale_factor_, min_page_scale_factor_, max_page_scale_factor_); | 1273 page_scale_factor_, min_page_scale_factor_, max_page_scale_factor_); |
| 1265 | 1274 |
| 1266 tree_impl->set_browser_controls_shrink_blink_size( | 1275 tree_impl->set_browser_controls_shrink_blink_size( |
| 1267 browser_controls_shrink_blink_size_); | 1276 browser_controls_shrink_blink_size_); |
| 1268 tree_impl->set_top_controls_height(top_controls_height_); | 1277 tree_impl->set_top_controls_height(top_controls_height_); |
| 1269 tree_impl->set_bottom_controls_height(bottom_controls_height_); | 1278 tree_impl->set_bottom_controls_height(bottom_controls_height_); |
| 1279 tree_impl->set_scroll_boundary_behavior(scroll_boundary_behavior_); |
| 1270 tree_impl->PushBrowserControlsFromMainThread(top_controls_shown_ratio_); | 1280 tree_impl->PushBrowserControlsFromMainThread(top_controls_shown_ratio_); |
| 1271 tree_impl->elastic_overscroll()->PushMainToPending(elastic_overscroll_); | 1281 tree_impl->elastic_overscroll()->PushMainToPending(elastic_overscroll_); |
| 1272 if (tree_impl->IsActiveTree()) | 1282 if (tree_impl->IsActiveTree()) |
| 1273 tree_impl->elastic_overscroll()->PushPendingToActive(); | 1283 tree_impl->elastic_overscroll()->PushPendingToActive(); |
| 1274 | 1284 |
| 1275 tree_impl->set_painted_device_scale_factor(painted_device_scale_factor_); | 1285 tree_impl->set_painted_device_scale_factor(painted_device_scale_factor_); |
| 1276 | 1286 |
| 1277 tree_impl->SetRasterColorSpace(raster_color_space_); | 1287 tree_impl->SetRasterColorSpace(raster_color_space_); |
| 1278 | 1288 |
| 1279 tree_impl->set_content_source_id(content_source_id_); | 1289 tree_impl->set_content_source_id(content_source_id_); |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1484 | 1494 |
| 1485 void LayerTreeHost::SetHasCopyRequest(bool has_copy_request) { | 1495 void LayerTreeHost::SetHasCopyRequest(bool has_copy_request) { |
| 1486 has_copy_request_ = has_copy_request; | 1496 has_copy_request_ = has_copy_request; |
| 1487 } | 1497 } |
| 1488 | 1498 |
| 1489 void LayerTreeHost::RequestBeginMainFrameNotExpected(bool new_state) { | 1499 void LayerTreeHost::RequestBeginMainFrameNotExpected(bool new_state) { |
| 1490 proxy_->RequestBeginMainFrameNotExpected(new_state); | 1500 proxy_->RequestBeginMainFrameNotExpected(new_state); |
| 1491 } | 1501 } |
| 1492 | 1502 |
| 1493 } // namespace cc | 1503 } // namespace cc |
| OLD | NEW |