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

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

Issue 2773893003: Record size of scroller that user scrolls (Closed)
Patch Set: bug fix 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
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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 DEFINE_SCOPED_UMA_HISTOGRAM_TIMER(PendingTreeDurationHistogramTimer, 161 DEFINE_SCOPED_UMA_HISTOGRAM_TIMER(PendingTreeDurationHistogramTimer,
162 "Scheduling.%s.PendingTreeDuration"); 162 "Scheduling.%s.PendingTreeDuration");
163 163
164 LayerTreeHostImpl::FrameData::FrameData() 164 LayerTreeHostImpl::FrameData::FrameData()
165 : render_surface_layer_list(nullptr), 165 : render_surface_layer_list(nullptr),
166 has_no_damage(false), 166 has_no_damage(false),
167 may_contain_video(false) {} 167 may_contain_video(false) {}
168 168
169 LayerTreeHostImpl::FrameData::~FrameData() {} 169 LayerTreeHostImpl::FrameData::~FrameData() {}
170 170
171 std::pair<const int, const int>
172 LayerTreeHostImpl::m_pairForScrollerSizeHistograms =
173 std::make_pair(200000, 50);
tdresser 2017/03/30 14:41:35 Name this so it's clearer what this contains. What
174
171 std::unique_ptr<LayerTreeHostImpl> LayerTreeHostImpl::Create( 175 std::unique_ptr<LayerTreeHostImpl> LayerTreeHostImpl::Create(
172 const LayerTreeSettings& settings, 176 const LayerTreeSettings& settings,
173 LayerTreeHostImplClient* client, 177 LayerTreeHostImplClient* client,
174 TaskRunnerProvider* task_runner_provider, 178 TaskRunnerProvider* task_runner_provider,
175 RenderingStatsInstrumentation* rendering_stats_instrumentation, 179 RenderingStatsInstrumentation* rendering_stats_instrumentation,
176 TaskGraphRunner* task_graph_runner, 180 TaskGraphRunner* task_graph_runner,
177 std::unique_ptr<MutatorHost> mutator_host, 181 std::unique_ptr<MutatorHost> mutator_host,
178 int id, 182 int id,
179 scoped_refptr<base::SequencedTaskRunner> image_worker_task_runner) { 183 scoped_refptr<base::SequencedTaskRunner> image_worker_task_runner) {
180 return base::WrapUnique(new LayerTreeHostImpl( 184 return base::WrapUnique(new LayerTreeHostImpl(
(...skipping 2563 matching lines...) Expand 10 before | Expand all | Expand 10 after
2744 } 2748 }
2745 } 2749 }
2746 2750
2747 auto* scrolling_layer = FindScrollLayerForDeviceViewportPoint( 2751 auto* scrolling_layer = FindScrollLayerForDeviceViewportPoint(
2748 device_viewport_point, type, layer_impl, &scroll_on_main_thread, 2752 device_viewport_point, type, layer_impl, &scroll_on_main_thread,
2749 &scroll_status.main_thread_scrolling_reasons); 2753 &scroll_status.main_thread_scrolling_reasons);
2750 ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; 2754 ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree;
2751 scrolling_node = 2755 scrolling_node =
2752 scrolling_layer ? scroll_tree.Node(scrolling_layer->scroll_tree_index()) 2756 scrolling_layer ? scroll_tree.Node(scrolling_layer->scroll_tree_index())
2753 : nullptr; 2757 : nullptr;
2758 if (!scroll_on_main_thread && scrolling_node) {
2759 if (IsWheelBasedScroll(type)) {
2760 UMA_HISTOGRAM_CUSTOM_COUNTS(
2761 "Event.Scroll.ScrollerSize.OnScroll_Wheel",
2762 scrolling_node->scroll_clip_layer_bounds.GetArea(), 1,
2763 m_pairForScrollerSizeHistograms.first,
2764 m_pairForScrollerSizeHistograms.second);
2765 } else {
2766 UMA_HISTOGRAM_CUSTOM_COUNTS(
2767 "Event.Scroll.ScrollerSize.OnScroll_Touch",
2768 scrolling_node->scroll_clip_layer_bounds.GetArea(), 1,
2769 m_pairForScrollerSizeHistograms.first,
2770 m_pairForScrollerSizeHistograms.second);
2771 }
2772 }
2754 } 2773 }
2755 2774
2756 if (scroll_on_main_thread) { 2775 if (scroll_on_main_thread) {
2757 RecordCompositorSlowScrollMetric(type, MAIN_THREAD); 2776 RecordCompositorSlowScrollMetric(type, MAIN_THREAD);
2758 2777
2759 scroll_status.thread = SCROLL_ON_MAIN_THREAD; 2778 scroll_status.thread = SCROLL_ON_MAIN_THREAD;
2760 return scroll_status; 2779 return scroll_status;
2761 } else if (scrolling_node) { 2780 } else if (scrolling_node) {
2762 scroll_affects_scroll_handler_ = active_tree_->have_scroll_event_handlers(); 2781 scroll_affects_scroll_handler_ = active_tree_->have_scroll_event_handlers();
2763 } 2782 }
(...skipping 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after
4275 worker_context_visibility_ = 4294 worker_context_visibility_ =
4276 worker_context->CacheController()->ClientBecameVisible(); 4295 worker_context->CacheController()->ClientBecameVisible();
4277 } else { 4296 } else {
4278 worker_context->CacheController()->ClientBecameNotVisible( 4297 worker_context->CacheController()->ClientBecameNotVisible(
4279 std::move(worker_context_visibility_)); 4298 std::move(worker_context_visibility_));
4280 } 4299 }
4281 } 4300 }
4282 } 4301 }
4283 4302
4284 } // namespace cc 4303 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698