Chromium Code Reviews| Index: cc/trees/layer_tree_host.cc |
| diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc |
| index 9956f4c7359887d8c3fa44f720f6c7177abf780d..ea87e3041b5703329e2ac492b8465715bca56014 100644 |
| --- a/cc/trees/layer_tree_host.cc |
| +++ b/cc/trees/layer_tree_host.cc |
| @@ -995,6 +995,18 @@ void LayerTreeHost::ApplyScrollAndScale(const ScrollAndScaleSet& info) { |
| if (!root_layer_.get()) |
| return; |
| + const bool has_scrolls = |
| + !info.scrolls.empty() || info.page_scale_delta != 1.0f; |
| + |
| + if (has_scrolls) { |
| + // We use async events here because we want to conditionally trace. This |
| + // is too spammy otherwise. |
| + TRACE_EVENT_ASYNC_BEGIN0( |
|
dsinclair
2013/08/08 17:30:14
Why not TRACE_EVENT_BEGIN0 and END0 below?
|
| + "impl-scroll", |
| + "LayerTreeHost::ApplyScrollAndScale", |
| + this); |
| + } |
| + |
| gfx::Vector2d root_scroll_delta; |
| Layer* root_scroll_layer = FindFirstScrollableLayer(root_layer_.get()); |
| @@ -1027,6 +1039,13 @@ void LayerTreeHost::ApplyScrollAndScale(const ScrollAndScaleSet& info) { |
| ApplyPageScaleDeltaFromImplSide(info.page_scale_delta); |
| client_->ApplyScrollAndScale(root_scroll_delta, info.page_scale_delta); |
| } |
| + |
| + if (has_scrolls) { |
| + TRACE_EVENT_ASYNC_END0( |
| + "impl-scroll", |
| + "LayerTreeHost::ApplyScrollAndScale", |
| + this); |
| + } |
| } |
| void LayerTreeHost::StartRateLimiter(WebKit::WebGraphicsContext3D* context3d) { |