Chromium Code Reviews| Index: cc/trees/layer_tree_impl.cc |
| diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc |
| index 5114fdcecca669bac2dd4d3f5395f9520d2eb1a9..90b8abcbe75430ae75166630b722ed96dd94eaee 100644 |
| --- a/cc/trees/layer_tree_impl.cc |
| +++ b/cc/trees/layer_tree_impl.cc |
| @@ -34,6 +34,21 @@ |
| #include "ui/gfx/geometry/vector2d_conversions.h" |
| namespace cc { |
| +namespace { |
| + |
| +template <typename Lambda> |
| +void ProcessLayersRecursive(LayerImpl* current, const Lambda& lambda) { |
|
enne (OOO)
2015/03/06 00:00:57
This isn't needed anymore, yeah?
vmpstr
2015/03/06 00:59:53
Whoops, removed.
|
| + DCHECK(current); |
| + lambda(current); |
| + if (current->mask_layer()) |
| + ProcessLayersRecursive(current->mask_layer(), lambda); |
| + if (current->replica_layer()) |
| + ProcessLayersRecursive(current->replica_layer(), lambda); |
| + for (size_t i = 0; i < current->children().size(); ++i) |
| + ProcessLayersRecursive(current->children()[i], lambda); |
| +} |
| + |
| +} // namespace |
| // This class exists to split the LayerScrollOffsetDelegate between the |
| // InnerViewportScrollLayer and the OuterViewportScrollLayer in a manner |
| @@ -135,6 +150,20 @@ void LayerTreeImpl::RecreateResources() { |
| } |
| } |
| +void LayerTreeImpl::GatherFrameTimingRequestIds( |
| + std::vector<int64_t>* request_ids) { |
| + if (!root_layer_) |
| + return; |
| + |
| + // TODO(vmpstr): Early out if there are no requests on any of the layers. For |
| + // that, we need to inform LayerTreeImpl whenever there are requests when we |
| + // get them. |
| + LayerTreeHostCommon::CallFunctionForSubtree( |
| + root_layer_.get(), [request_ids](LayerImpl* layer) { |
| + layer->GatherFrameTimingRequestIds(request_ids); |
| + }); |
| +} |
| + |
| void LayerTreeImpl::SetRootLayer(scoped_ptr<LayerImpl> layer) { |
| if (inner_viewport_scroll_layer_) |
| inner_viewport_scroll_layer_->SetScrollOffsetDelegate(NULL); |