Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: cc/trees/layer_tree_impl.h

Issue 2894673008: Refactor scrollbar maps from multimap & std::set to simpler flat_{map, set} (Closed)
Patch Set: DCHECK_EQ Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/layers/scrollbar_layer_impl_base.h ('k') | cc/trees/layer_tree_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_TREES_LAYER_TREE_IMPL_H_ 5 #ifndef CC_TREES_LAYER_TREE_IMPL_H_
6 #define CC_TREES_LAYER_TREE_IMPL_H_ 6 #define CC_TREES_LAYER_TREE_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 std::unordered_map<ElementId, gfx::Transform, ElementIdHash> 571 std::unordered_map<ElementId, gfx::Transform, ElementIdHash>
572 element_id_to_transform_animations_; 572 element_id_to_transform_animations_;
573 std::unordered_map<ElementId, FilterOperations, ElementIdHash> 573 std::unordered_map<ElementId, FilterOperations, ElementIdHash>
574 element_id_to_filter_animations_; 574 element_id_to_filter_animations_;
575 575
576 // Maps from clip layer ids to scroll layer ids. Note that this only includes 576 // Maps from clip layer ids to scroll layer ids. Note that this only includes
577 // the subset of clip layers that act as scrolling containers. (This is 577 // the subset of clip layers that act as scrolling containers. (This is
578 // derived from LayerImpl::scroll_clip_layer_ and exists to avoid O(n) walks.) 578 // derived from LayerImpl::scroll_clip_layer_ and exists to avoid O(n) walks.)
579 std::unordered_map<int, int> clip_scroll_map_; 579 std::unordered_map<int, int> clip_scroll_map_;
580 580
581 // Maps scroll element ids to scrollbar layer ids. For each scroll layer, 581 struct ScrollbarLayerIds {
582 // there may be 1 or 2 scrollbar layers (for vertical and horizontal). (This 582 int horizontal = Layer::INVALID_ID;
583 // is derived from ScrollbarLayerImplBase::scroll_element_id_ and exists to 583 int vertical = Layer::INVALID_ID;
584 // avoid O(n) walks.) 584 };
585 // TODO(pdr): Refactor this to be more efficient--likely a map where the value 585 // Each scroll layer can have up to two scrollbar layers (vertical and
586 // is a pair of scrollbar layer ids instead of using a multimap. 586 // horizontal). This mapping is maintained as part of scrollbar registration.
587 std::multimap<ElementId, int> element_id_to_scrollbar_layer_ids_; 587 base::flat_map<ElementId, ScrollbarLayerIds>
588 element_id_to_scrollbar_layer_ids_;
588 589
589 std::vector<PictureLayerImpl*> picture_layers_; 590 std::vector<PictureLayerImpl*> picture_layers_;
590 LayerImplList surface_layers_; 591 LayerImplList surface_layers_;
591 592
592 // List of render surfaces for the most recently prepared frame. 593 // List of render surfaces for the most recently prepared frame.
593 RenderSurfaceList render_surface_list_; 594 RenderSurfaceList render_surface_list_;
594 // After drawing the |render_surface_list_| the areas in this region 595 // After drawing the |render_surface_list_| the areas in this region
595 // would not be fully covered by opaque content. 596 // would not be fully covered by opaque content.
596 Region unoccluded_screen_space_region_; 597 Region unoccluded_screen_space_region_;
597 598
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 // lifecycle states. See: |LayerTreeLifecycle|. 634 // lifecycle states. See: |LayerTreeLifecycle|.
634 LayerTreeLifecycle lifecycle_; 635 LayerTreeLifecycle lifecycle_;
635 636
636 private: 637 private:
637 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); 638 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl);
638 }; 639 };
639 640
640 } // namespace cc 641 } // namespace cc
641 642
642 #endif // CC_TREES_LAYER_TREE_IMPL_H_ 643 #endif // CC_TREES_LAYER_TREE_IMPL_H_
OLDNEW
« no previous file with comments | « cc/layers/scrollbar_layer_impl_base.h ('k') | cc/trees/layer_tree_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698