OLD | NEW |
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 Loading... |
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 Loading... |
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 Loading... |
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 // TODO(pdr): Refactor this to be more efficient--likely a map where the value |
| 540 // is a pair of scrollbar layer ids instead of using a multimap. |
| 541 std::multimap<ElementId, int> element_id_to_scrollbar_layer_ids_; |
540 | 542 |
541 std::vector<PictureLayerImpl*> picture_layers_; | 543 std::vector<PictureLayerImpl*> picture_layers_; |
542 LayerImplList surface_layers_; | 544 LayerImplList surface_layers_; |
543 | 545 |
544 // List of visible layers for the most recently prepared frame. | 546 // List of visible layers for the most recently prepared frame. |
545 LayerImplList render_surface_layer_list_; | 547 LayerImplList render_surface_layer_list_; |
546 // After drawing the |render_surface_layer_list_| the areas in this region | 548 // After drawing the |render_surface_layer_list_| the areas in this region |
547 // would not be fully covered by opaque content. | 549 // would not be fully covered by opaque content. |
548 Region unoccluded_screen_space_region_; | 550 Region unoccluded_screen_space_region_; |
549 | 551 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 | 583 |
582 std::unique_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; | 584 std::unique_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; |
583 | 585 |
584 private: | 586 private: |
585 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 587 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
586 }; | 588 }; |
587 | 589 |
588 } // namespace cc | 590 } // namespace cc |
589 | 591 |
590 #endif // CC_TREES_LAYER_TREE_IMPL_H_ | 592 #endif // CC_TREES_LAYER_TREE_IMPL_H_ |
OLD | NEW |