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_impl.h" | 5 #include "cc/trees/layer_tree_host_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 18 matching lines...) Expand all Loading... | |
29 #include "cc/base/math_util.h" | 29 #include "cc/base/math_util.h" |
30 #include "cc/benchmarks/benchmark_instrumentation.h" | 30 #include "cc/benchmarks/benchmark_instrumentation.h" |
31 #include "cc/debug/rendering_stats_instrumentation.h" | 31 #include "cc/debug/rendering_stats_instrumentation.h" |
32 #include "cc/debug/traced_value.h" | 32 #include "cc/debug/traced_value.h" |
33 #include "cc/input/browser_controls_offset_manager.h" | 33 #include "cc/input/browser_controls_offset_manager.h" |
34 #include "cc/input/main_thread_scrolling_reason.h" | 34 #include "cc/input/main_thread_scrolling_reason.h" |
35 #include "cc/input/page_scale_animation.h" | 35 #include "cc/input/page_scale_animation.h" |
36 #include "cc/input/scroll_elasticity_helper.h" | 36 #include "cc/input/scroll_elasticity_helper.h" |
37 #include "cc/input/scroll_state.h" | 37 #include "cc/input/scroll_state.h" |
38 #include "cc/input/scrollbar_animation_controller.h" | 38 #include "cc/input/scrollbar_animation_controller.h" |
39 #include "cc/input/scroller_size.h" | |
39 #include "cc/layers/append_quads_data.h" | 40 #include "cc/layers/append_quads_data.h" |
40 #include "cc/layers/heads_up_display_layer_impl.h" | 41 #include "cc/layers/heads_up_display_layer_impl.h" |
41 #include "cc/layers/layer_impl.h" | 42 #include "cc/layers/layer_impl.h" |
42 #include "cc/layers/layer_iterator.h" | 43 #include "cc/layers/layer_iterator.h" |
43 #include "cc/layers/painted_scrollbar_layer_impl.h" | 44 #include "cc/layers/painted_scrollbar_layer_impl.h" |
44 #include "cc/layers/render_surface_impl.h" | 45 #include "cc/layers/render_surface_impl.h" |
45 #include "cc/layers/scrollbar_layer_impl_base.h" | 46 #include "cc/layers/scrollbar_layer_impl_base.h" |
46 #include "cc/layers/surface_layer_impl.h" | 47 #include "cc/layers/surface_layer_impl.h" |
47 #include "cc/layers/viewport.h" | 48 #include "cc/layers/viewport.h" |
48 #include "cc/output/compositor_frame.h" | 49 #include "cc/output/compositor_frame.h" |
(...skipping 2706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2755 } | 2756 } |
2756 } | 2757 } |
2757 | 2758 |
2758 auto* scrolling_layer = FindScrollLayerForDeviceViewportPoint( | 2759 auto* scrolling_layer = FindScrollLayerForDeviceViewportPoint( |
2759 device_viewport_point, type, layer_impl, &scroll_on_main_thread, | 2760 device_viewport_point, type, layer_impl, &scroll_on_main_thread, |
2760 &scroll_status.main_thread_scrolling_reasons); | 2761 &scroll_status.main_thread_scrolling_reasons); |
2761 ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; | 2762 ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; |
2762 scrolling_node = | 2763 scrolling_node = |
2763 scrolling_layer ? scroll_tree.Node(scrolling_layer->scroll_tree_index()) | 2764 scrolling_layer ? scroll_tree.Node(scrolling_layer->scroll_tree_index()) |
2764 : nullptr; | 2765 : nullptr; |
2766 if (!scroll_on_main_thread && scrolling_node) { | |
bokan
2017/04/04 17:32:57
if you're going to avoid recording the viewport (a
| |
2767 if (IsWheelBasedScroll(type)) { | |
2768 UMA_HISTOGRAM_CUSTOM_COUNTS( | |
2769 "Event.Scroll.ScrollerSize.OnScroll_Wheel", | |
2770 scrolling_node->scroll_clip_layer_bounds.GetArea(), 1, | |
2771 kMaxScrollerSize, kBucketNum); | |
2772 } else { | |
2773 UMA_HISTOGRAM_CUSTOM_COUNTS( | |
2774 "Event.Scroll.ScrollerSize.OnScroll_Touch", | |
2775 scrolling_node->scroll_clip_layer_bounds.GetArea(), 1, | |
2776 kMaxScrollerSize, kBucketNum); | |
2777 } | |
2778 } | |
2765 } | 2779 } |
2766 | 2780 |
2767 if (scroll_on_main_thread) { | 2781 if (scroll_on_main_thread) { |
2768 RecordCompositorSlowScrollMetric(type, MAIN_THREAD); | 2782 RecordCompositorSlowScrollMetric(type, MAIN_THREAD); |
2769 | 2783 |
2770 scroll_status.thread = SCROLL_ON_MAIN_THREAD; | 2784 scroll_status.thread = SCROLL_ON_MAIN_THREAD; |
2771 return scroll_status; | 2785 return scroll_status; |
2772 } else if (scrolling_node) { | 2786 } else if (scrolling_node) { |
2773 scroll_affects_scroll_handler_ = active_tree_->have_scroll_event_handlers(); | 2787 scroll_affects_scroll_handler_ = active_tree_->have_scroll_event_handlers(); |
2774 } | 2788 } |
(...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4255 } | 4269 } |
4256 | 4270 |
4257 void LayerTreeHostImpl::UpdateScrollSourceInfo(bool is_wheel_scroll) { | 4271 void LayerTreeHostImpl::UpdateScrollSourceInfo(bool is_wheel_scroll) { |
4258 if (is_wheel_scroll) | 4272 if (is_wheel_scroll) |
4259 has_scrolled_by_wheel_ = true; | 4273 has_scrolled_by_wheel_ = true; |
4260 else | 4274 else |
4261 has_scrolled_by_touch_ = true; | 4275 has_scrolled_by_touch_ = true; |
4262 } | 4276 } |
4263 | 4277 |
4264 } // namespace cc | 4278 } // namespace cc |
OLD | NEW |