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

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

Issue 2824693002: Refactor LayerTreeImpl's scrollbar map to be keyed on element ids (Closed)
Patch Set: Created 3 years, 8 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
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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 bool IsSyncTree() const; 88 bool IsSyncTree() const;
89 LayerImpl* FindActiveTreeLayerById(int id); 89 LayerImpl* FindActiveTreeLayerById(int id);
90 LayerImpl* FindPendingTreeLayerById(int id); 90 LayerImpl* FindPendingTreeLayerById(int id);
91 bool PinchGestureActive() const; 91 bool PinchGestureActive() const;
92 BeginFrameArgs CurrentBeginFrameArgs() const; 92 BeginFrameArgs CurrentBeginFrameArgs() const;
93 base::TimeDelta CurrentBeginFrameInterval() const; 93 base::TimeDelta CurrentBeginFrameInterval() const;
94 gfx::Rect DeviceViewport() const; 94 gfx::Rect DeviceViewport() const;
95 gfx::Size DrawViewportSize() const; 95 gfx::Size DrawViewportSize() const;
96 const gfx::Rect ViewportRectForTilePriority() const; 96 const gfx::Rect ViewportRectForTilePriority() const;
97 std::unique_ptr<ScrollbarAnimationController> 97 std::unique_ptr<ScrollbarAnimationController>
98 CreateScrollbarAnimationController(int scroll_layer_id); 98 CreateScrollbarAnimationController(ElementId scroll_element_id);
99 void DidAnimateScrollOffset(); 99 void DidAnimateScrollOffset();
100 bool use_gpu_rasterization() const; 100 bool use_gpu_rasterization() const;
101 GpuRasterizationStatus GetGpuRasterizationStatus() const; 101 GpuRasterizationStatus GetGpuRasterizationStatus() const;
102 bool create_low_res_tiling() const; 102 bool create_low_res_tiling() const;
103 bool RequiresHighResToDraw() const; 103 bool RequiresHighResToDraw() const;
104 bool SmoothnessTakesPriority() const; 104 bool SmoothnessTakesPriority() const;
105 VideoFrameControllerClient* GetVideoFrameControllerClient() const; 105 VideoFrameControllerClient* GetVideoFrameControllerClient() const;
106 MutatorHost* mutator_host() const { 106 MutatorHost* mutator_host() const {
107 return layer_tree_host_impl_->mutator_host(); 107 return layer_tree_host_impl_->mutator_host();
108 } 108 }
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 bool IsUIResourceOpaque(UIResourceId uid) const; 388 bool IsUIResourceOpaque(UIResourceId uid) const;
389 389
390 void RegisterPictureLayerImpl(PictureLayerImpl* layer); 390 void RegisterPictureLayerImpl(PictureLayerImpl* layer);
391 void UnregisterPictureLayerImpl(PictureLayerImpl* layer); 391 void UnregisterPictureLayerImpl(PictureLayerImpl* layer);
392 const std::vector<PictureLayerImpl*>& picture_layers() const { 392 const std::vector<PictureLayerImpl*>& picture_layers() const {
393 return picture_layers_; 393 return picture_layers_;
394 } 394 }
395 395
396 void RegisterScrollbar(ScrollbarLayerImplBase* scrollbar_layer); 396 void RegisterScrollbar(ScrollbarLayerImplBase* scrollbar_layer);
397 void UnregisterScrollbar(ScrollbarLayerImplBase* scrollbar_layer); 397 void UnregisterScrollbar(ScrollbarLayerImplBase* scrollbar_layer);
398 ScrollbarSet ScrollbarsFor(int scroll_layer_id) const; 398 ScrollbarSet ScrollbarsFor(ElementId scroll_element_id) const;
399 399
400 void RegisterScrollLayer(LayerImpl* layer); 400 void RegisterScrollLayer(LayerImpl* layer);
401 void UnregisterScrollLayer(LayerImpl* layer); 401 void UnregisterScrollLayer(LayerImpl* layer);
402 402
403 void AddSurfaceLayer(LayerImpl* layer); 403 void AddSurfaceLayer(LayerImpl* layer);
404 void RemoveSurfaceLayer(LayerImpl* layer); 404 void RemoveSurfaceLayer(LayerImpl* layer);
405 const LayerImplList& SurfaceLayers() const { return surface_layers_; } 405 const LayerImplList& SurfaceLayers() const { return surface_layers_; }
406 406
407 LayerImpl* FindFirstScrollingLayerOrDrawnScrollbarThatIsHitByPoint( 407 LayerImpl* FindFirstScrollingLayerOrDrawnScrollbarThatIsHitByPoint(
408 const gfx::PointF& screen_space_point); 408 const gfx::PointF& screen_space_point);
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 std::unordered_map<ElementId, gfx::Transform, ElementIdHash> 525 std::unordered_map<ElementId, gfx::Transform, ElementIdHash>
526 element_id_to_transform_animations_; 526 element_id_to_transform_animations_;
527 std::unordered_map<ElementId, FilterOperations, ElementIdHash> 527 std::unordered_map<ElementId, FilterOperations, ElementIdHash>
528 element_id_to_filter_animations_; 528 element_id_to_filter_animations_;
529 529
530 // Maps from clip layer ids to scroll layer ids. Note that this only includes 530 // Maps from clip layer ids to scroll layer ids. Note that this only includes
531 // the subset of clip layers that act as scrolling containers. (This is 531 // the subset of clip layers that act as scrolling containers. (This is
532 // derived from LayerImpl::scroll_clip_layer_ and exists to avoid O(n) walks.) 532 // derived from LayerImpl::scroll_clip_layer_ and exists to avoid O(n) walks.)
533 std::unordered_map<int, int> clip_scroll_map_; 533 std::unordered_map<int, int> clip_scroll_map_;
534 534
535 // Maps scroll layer ids to scrollbar layer ids. For each scroll layer, there 535 // Maps scroll element ids to scrollbar layer ids. For each scroll layer,
536 // may be 1 or 2 scrollbar layers (for vertical and horizontal). (This is 536 // there may be 1 or 2 scrollbar layers (for vertical and horizontal). (This
537 // derived from ScrollbarLayerImplBase::scroll_layer_id_ and exists to avoid 537 // is derived from ScrollbarLayerImplBase::scroll_element_id_ and exists to
538 // O(n) walks.) 538 // avoid O(n) walks.)
539 std::multimap<int, int> scrollbar_map_; 539 std::multimap<ElementId, int> scrollbar_map_;
wkorman 2017/04/17 17:44:35 Suggestion, consider rename to something like elem
wkorman 2017/04/17 17:44:35 Future optimization potential -- similar to recent
pdr. 2017/04/19 18:02:18 Switched name from scrollbar_map_ to element_id_to
wkorman 2017/04/19 18:07:09 Yeah, definitely better as separate change.
540 540
541 std::vector<PictureLayerImpl*> picture_layers_; 541 std::vector<PictureLayerImpl*> picture_layers_;
542 LayerImplList surface_layers_; 542 LayerImplList surface_layers_;
543 543
544 // List of visible layers for the most recently prepared frame. 544 // List of visible layers for the most recently prepared frame.
545 LayerImplList render_surface_layer_list_; 545 LayerImplList render_surface_layer_list_;
546 // After drawing the |render_surface_layer_list_| the areas in this region 546 // After drawing the |render_surface_layer_list_| the areas in this region
547 // would not be fully covered by opaque content. 547 // would not be fully covered by opaque content.
548 Region unoccluded_screen_space_region_; 548 Region unoccluded_screen_space_region_;
549 549
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 581
582 std::unique_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; 582 std::unique_ptr<PendingPageScaleAnimation> pending_page_scale_animation_;
583 583
584 private: 584 private:
585 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); 585 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl);
586 }; 586 };
587 587
588 } // namespace cc 588 } // namespace cc
589 589
590 #endif // CC_TREES_LAYER_TREE_IMPL_H_ 590 #endif // CC_TREES_LAYER_TREE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698