| 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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 LayerImpl* LayerById(int id) const; | 352 LayerImpl* LayerById(int id) const; |
| 353 | 353 |
| 354 int LayerIdByElementId(ElementId element_id) const; | 354 int LayerIdByElementId(ElementId element_id) const; |
| 355 // TODO(jaydasika): this is deprecated. It is used by | 355 // TODO(jaydasika): this is deprecated. It is used by |
| 356 // animation/compositor-worker to look up layers to mutate, but in future, we | 356 // animation/compositor-worker to look up layers to mutate, but in future, we |
| 357 // will update property trees. | 357 // will update property trees. |
| 358 LayerImpl* LayerByElementId(ElementId element_id) const; | 358 LayerImpl* LayerByElementId(ElementId element_id) const; |
| 359 void AddToElementMap(LayerImpl* layer); | 359 void AddToElementMap(LayerImpl* layer); |
| 360 void RemoveFromElementMap(LayerImpl* layer); | 360 void RemoveFromElementMap(LayerImpl* layer); |
| 361 | 361 |
| 362 void SetSurfaceLayerIds(const std::vector<SurfaceId>& surface_layer_ids); |
| 363 const std::vector<SurfaceId>& SurfaceLayerIds() const; |
| 364 void ClearSurfaceLayerIds(); |
| 365 |
| 362 void AddLayerShouldPushProperties(LayerImpl* layer); | 366 void AddLayerShouldPushProperties(LayerImpl* layer); |
| 363 void RemoveLayerShouldPushProperties(LayerImpl* layer); | 367 void RemoveLayerShouldPushProperties(LayerImpl* layer); |
| 364 std::unordered_set<LayerImpl*>& LayersThatShouldPushProperties(); | 368 std::unordered_set<LayerImpl*>& LayersThatShouldPushProperties(); |
| 365 bool LayerNeedsPushPropertiesForTesting(LayerImpl* layer); | 369 bool LayerNeedsPushPropertiesForTesting(LayerImpl* layer); |
| 366 | 370 |
| 367 // These should be called by LayerImpl's ctor/dtor. | 371 // These should be called by LayerImpl's ctor/dtor. |
| 368 void RegisterLayer(LayerImpl* layer); | 372 void RegisterLayer(LayerImpl* layer); |
| 369 void UnregisterLayer(LayerImpl* layer); | 373 void UnregisterLayer(LayerImpl* layer); |
| 370 | 374 |
| 371 // These manage ownership of the LayerImpl. | 375 // These manage ownership of the LayerImpl. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 return picture_layers_; | 442 return picture_layers_; |
| 439 } | 443 } |
| 440 | 444 |
| 441 void RegisterScrollbar(ScrollbarLayerImplBase* scrollbar_layer); | 445 void RegisterScrollbar(ScrollbarLayerImplBase* scrollbar_layer); |
| 442 void UnregisterScrollbar(ScrollbarLayerImplBase* scrollbar_layer); | 446 void UnregisterScrollbar(ScrollbarLayerImplBase* scrollbar_layer); |
| 443 ScrollbarSet ScrollbarsFor(ElementId scroll_element_id) const; | 447 ScrollbarSet ScrollbarsFor(ElementId scroll_element_id) const; |
| 444 | 448 |
| 445 void RegisterScrollLayer(LayerImpl* layer); | 449 void RegisterScrollLayer(LayerImpl* layer); |
| 446 void UnregisterScrollLayer(LayerImpl* layer); | 450 void UnregisterScrollLayer(LayerImpl* layer); |
| 447 | 451 |
| 448 void AddSurfaceLayer(LayerImpl* layer); | |
| 449 void RemoveSurfaceLayer(LayerImpl* layer); | |
| 450 const LayerImplList& SurfaceLayers() const { return surface_layers_; } | |
| 451 | |
| 452 LayerImpl* FindFirstScrollingLayerOrDrawnScrollbarThatIsHitByPoint( | 452 LayerImpl* FindFirstScrollingLayerOrDrawnScrollbarThatIsHitByPoint( |
| 453 const gfx::PointF& screen_space_point); | 453 const gfx::PointF& screen_space_point); |
| 454 | 454 |
| 455 LayerImpl* FindLayerThatIsHitByPoint(const gfx::PointF& screen_space_point); | 455 LayerImpl* FindLayerThatIsHitByPoint(const gfx::PointF& screen_space_point); |
| 456 | 456 |
| 457 LayerImpl* FindLayerThatIsHitByPointInTouchHandlerRegion( | 457 LayerImpl* FindLayerThatIsHitByPointInTouchHandlerRegion( |
| 458 const gfx::PointF& screen_space_point); | 458 const gfx::PointF& screen_space_point); |
| 459 | 459 |
| 460 void RegisterSelection(const LayerSelection& selection); | 460 void RegisterSelection(const LayerSelection& selection); |
| 461 | 461 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 | 580 |
| 581 struct ScrollbarLayerIds { | 581 struct ScrollbarLayerIds { |
| 582 int horizontal = Layer::INVALID_ID; | 582 int horizontal = Layer::INVALID_ID; |
| 583 int vertical = Layer::INVALID_ID; | 583 int vertical = Layer::INVALID_ID; |
| 584 }; | 584 }; |
| 585 // Each scroll layer can have up to two scrollbar layers (vertical and | 585 // Each scroll layer can have up to two scrollbar layers (vertical and |
| 586 // horizontal). This mapping is maintained as part of scrollbar registration. | 586 // horizontal). This mapping is maintained as part of scrollbar registration. |
| 587 base::flat_map<ElementId, ScrollbarLayerIds> | 587 base::flat_map<ElementId, ScrollbarLayerIds> |
| 588 element_id_to_scrollbar_layer_ids_; | 588 element_id_to_scrollbar_layer_ids_; |
| 589 | 589 |
| 590 std::vector<SurfaceId> surface_layer_ids_; |
| 591 |
| 590 std::vector<PictureLayerImpl*> picture_layers_; | 592 std::vector<PictureLayerImpl*> picture_layers_; |
| 591 LayerImplList surface_layers_; | |
| 592 | 593 |
| 593 // List of render surfaces for the most recently prepared frame. | 594 // List of render surfaces for the most recently prepared frame. |
| 594 RenderSurfaceList render_surface_list_; | 595 RenderSurfaceList render_surface_list_; |
| 595 // After drawing the |render_surface_list_| the areas in this region | 596 // After drawing the |render_surface_list_| the areas in this region |
| 596 // would not be fully covered by opaque content. | 597 // would not be fully covered by opaque content. |
| 597 Region unoccluded_screen_space_region_; | 598 Region unoccluded_screen_space_region_; |
| 598 | 599 |
| 599 bool viewport_size_invalid_; | 600 bool viewport_size_invalid_; |
| 600 bool needs_update_draw_properties_; | 601 bool needs_update_draw_properties_; |
| 601 | 602 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 // lifecycle states. See: |LayerTreeLifecycle|. | 635 // lifecycle states. See: |LayerTreeLifecycle|. |
| 635 LayerTreeLifecycle lifecycle_; | 636 LayerTreeLifecycle lifecycle_; |
| 636 | 637 |
| 637 private: | 638 private: |
| 638 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 639 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
| 639 }; | 640 }; |
| 640 | 641 |
| 641 } // namespace cc | 642 } // namespace cc |
| 642 | 643 |
| 643 #endif // CC_TREES_LAYER_TREE_IMPL_H_ | 644 #endif // CC_TREES_LAYER_TREE_IMPL_H_ |
| OLD | NEW |