Chromium Code Reviews| Index: cc/trees/layer_tree_impl.h |
| diff --git a/cc/trees/layer_tree_impl.h b/cc/trees/layer_tree_impl.h |
| index 46f57fda5b625c775e9c8d0bb1647948137ce6c7..f3bf09e2c68ff761aebeac5b892ed20b2318f997 100644 |
| --- a/cc/trees/layer_tree_impl.h |
| +++ b/cc/trees/layer_tree_impl.h |
| @@ -578,13 +578,15 @@ class CC_EXPORT LayerTreeImpl { |
| // derived from LayerImpl::scroll_clip_layer_ and exists to avoid O(n) walks.) |
| std::unordered_map<int, int> clip_scroll_map_; |
| - // Maps scroll element ids to scrollbar layer ids. For each scroll layer, |
| - // there may be 1 or 2 scrollbar layers (for vertical and horizontal). (This |
| - // is derived from ScrollbarLayerImplBase::scroll_element_id_ and exists to |
| - // avoid O(n) walks.) |
| - // TODO(pdr): Refactor this to be more efficient--likely a map where the value |
| - // is a pair of scrollbar layer ids instead of using a multimap. |
| - std::multimap<ElementId, int> element_id_to_scrollbar_layer_ids_; |
| + struct ScrollbarLayerIds { |
| + int horizontal = Layer::INVALID_ID; |
| + int vertical = Layer::INVALID_ID; |
| + }; |
| + // Each scroll layer can have up to two scrollbar layers (vertical and |
| + // horizontal). This mapping is derived from ScrollbarLayerImplBase's |
|
wkorman
2017/05/20 01:46:29
Suggest removing "This mapping..." since code/clas
pdr.
2017/05/22 16:20:40
Done
|
| + // scroll_element_id_ and updated in RegisterScrollbar/UnregisterScrollbar. |
| + base::flat_map<ElementId, ScrollbarLayerIds> |
| + element_id_to_scrollbar_layer_ids_; |
| std::vector<PictureLayerImpl*> picture_layers_; |
| LayerImplList surface_layers_; |