Index: cc/trees/thread_proxy.cc |
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc |
index 2bf824711d0592ce946327514bba8d995533b276..38bb6191f4e3f857c1ce3c05afd2ec98695499d3 100644 |
--- a/cc/trees/thread_proxy.cc |
+++ b/cc/trees/thread_proxy.cc |
@@ -635,6 +635,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); |
} |
@@ -680,8 +688,24 @@ void ThreadProxy::BeginFrameOnMainThread( |
// callbacks will trigger another frame. |
animate_requested_ = false; |
- 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", |
danakj
2013/07/29 17:16:08
You have a trace event in ApplyScrollAndScale, and
|
+ this); |
+ } |
layer_tree_host_->ApplyScrollAndScale(*begin_frame_state->scroll_info); |
+ if (has_scrolls) { |
+ TRACE_EVENT_ASYNC_END0( |
+ "impl-scroll", |
+ "ThreadProxy::BeginFrameOnMainThread", |
+ this); |
+ } |
+ } |
if (!in_composite_and_readback_ && !layer_tree_host_->visible()) { |
commit_requested_ = false; |