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

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

Issue 2773893003: Record size of scroller that user scrolls (Closed)
Patch Set: nit Created 3 years, 8 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
« no previous file with comments | « cc/input/scroller_size_metrics.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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
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_metrics.h"
39 #include "cc/layers/append_quads_data.h" 40 #include "cc/layers/append_quads_data.h"
40 #include "cc/layers/effect_tree_layer_list_iterator.h" 41 #include "cc/layers/effect_tree_layer_list_iterator.h"
41 #include "cc/layers/heads_up_display_layer_impl.h" 42 #include "cc/layers/heads_up_display_layer_impl.h"
42 #include "cc/layers/layer_impl.h" 43 #include "cc/layers/layer_impl.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 2712 matching lines...) Expand 10 before | Expand all | Expand 10 after
2761 scroll_status.thread = SCROLL_UNKNOWN; 2762 scroll_status.thread = SCROLL_UNKNOWN;
2762 scroll_status.main_thread_scrolling_reasons = 2763 scroll_status.main_thread_scrolling_reasons =
2763 MainThreadScrollingReason::kFailedHitTest; 2764 MainThreadScrollingReason::kFailedHitTest;
2764 return scroll_status; 2765 return scroll_status;
2765 } 2766 }
2766 } 2767 }
2767 2768
2768 scrolling_node = FindScrollNodeForDeviceViewportPoint( 2769 scrolling_node = FindScrollNodeForDeviceViewportPoint(
2769 device_viewport_point, type, layer_impl, &scroll_on_main_thread, 2770 device_viewport_point, type, layer_impl, &scroll_on_main_thread,
2770 &scroll_status.main_thread_scrolling_reasons); 2771 &scroll_status.main_thread_scrolling_reasons);
2772 if (!scroll_on_main_thread && scrolling_node &&
2773 (settings_.is_layer_tree_for_subframe ||
2774 (!scrolling_node->scrolls_outer_viewport &&
2775 !scrolling_node->scrolls_inner_viewport))) {
2776 if (IsWheelBasedScroll(type)) {
2777 UMA_HISTOGRAM_CUSTOM_COUNTS(
2778 "Event.Scroll.ScrollerSize.OnScroll_Wheel",
2779 scrolling_node->scroll_clip_layer_bounds.GetArea(), 1,
2780 kScrollerSizeLargestBucket, kScrollerSizeBucketCount);
2781 } else {
2782 UMA_HISTOGRAM_CUSTOM_COUNTS(
2783 "Event.Scroll.ScrollerSize.OnScroll_Touch",
2784 scrolling_node->scroll_clip_layer_bounds.GetArea(), 1,
2785 kScrollerSizeLargestBucket, kScrollerSizeBucketCount);
2786 }
2787 }
2771 } 2788 }
2772 2789
2773 if (scroll_on_main_thread) { 2790 if (scroll_on_main_thread) {
2774 RecordCompositorSlowScrollMetric(type, MAIN_THREAD); 2791 RecordCompositorSlowScrollMetric(type, MAIN_THREAD);
2775 2792
2776 scroll_status.thread = SCROLL_ON_MAIN_THREAD; 2793 scroll_status.thread = SCROLL_ON_MAIN_THREAD;
2777 return scroll_status; 2794 return scroll_status;
2778 } else if (scrolling_node) { 2795 } else if (scrolling_node) {
2779 scroll_affects_scroll_handler_ = active_tree_->have_scroll_event_handlers(); 2796 scroll_affects_scroll_handler_ = active_tree_->have_scroll_event_handlers();
2780 } 2797 }
(...skipping 1497 matching lines...) Expand 10 before | Expand all | Expand 10 after
4278 } 4295 }
4279 4296
4280 void LayerTreeHostImpl::UpdateScrollSourceInfo(bool is_wheel_scroll) { 4297 void LayerTreeHostImpl::UpdateScrollSourceInfo(bool is_wheel_scroll) {
4281 if (is_wheel_scroll) 4298 if (is_wheel_scroll)
4282 has_scrolled_by_wheel_ = true; 4299 has_scrolled_by_wheel_ = true;
4283 else 4300 else
4284 has_scrolled_by_touch_ = true; 4301 has_scrolled_by_touch_ = true;
4285 } 4302 }
4286 4303
4287 } // namespace cc 4304 } // namespace cc
OLDNEW
« no previous file with comments | « cc/input/scroller_size_metrics.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698