Index: cc/trees/thread_proxy.cc |
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc |
index 39cdceb91420f9d1040c3f7e542a7c1fddd1c775..7a7261490ef0dd5932953c00fd579fe220f33f20 100644 |
--- a/cc/trees/thread_proxy.cc |
+++ b/cc/trees/thread_proxy.cc |
@@ -667,6 +667,14 @@ void ThreadProxy::ScheduledActionSendBeginFrameToMainThread() { |
begin_frame_state->scroll_info = |
layer_tree_host_impl_->ProcessScrollDeltas(); |
+ if (!begin_frame_state->scroll_info->scrolls.empty()) { |
+ TRACE_EVENT_INSTANT0( |
+ "impl-scroll", |
+ "ThreadProxy::ScheduledActionSendBeginFrameToMainThread received scroll" |
+ " deltas", |
+ TRACE_EVENT_SCOPE_THREAD); |
+ } |
+ |
if (!layer_tree_host_impl_->settings().impl_side_painting) { |
DCHECK_GT(layer_tree_host_impl_->memory_allocation_limit_bytes(), 0u); |
} |
@@ -726,8 +734,24 @@ void ThreadProxy::BeginFrameOnMainThread( |
return; |
} |
- if (begin_frame_state) |
+ if (begin_frame_state) { |
+ const bool has_scrolls = !begin_frame_state->scroll_info->scrolls.empty(); |
+ if (has_scrolls) { |
+ // We use async events here because we want to conditionally trace. This |
+ // is too spammy otherwise. |
+ TRACE_EVENT_ASYNC_BEGIN0( |
+ "impl-scroll", |
+ "ThreadProxy::BeginFrameOnMainThread", |
+ this); |
+ } |
layer_tree_host_->ApplyScrollAndScale(*begin_frame_state->scroll_info); |
+ if (has_scrolls) { |
+ TRACE_EVENT_ASYNC_END0( |
+ "impl-scroll", |
+ "ThreadProxy::BeginFrameOnMainThread", |
+ this); |
+ } |
+ } |
layer_tree_host_->WillBeginFrame(); |