| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_HOST_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_H_ |
| 6 #define CC_TREES_LAYER_TREE_HOST_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 | 340 |
| 341 void set_surface_id_namespace(uint32_t id_namespace); | 341 void set_surface_id_namespace(uint32_t id_namespace); |
| 342 SurfaceSequence CreateSurfaceSequence(); | 342 SurfaceSequence CreateSurfaceSequence(); |
| 343 | 343 |
| 344 PropertyTrees* property_trees() { return &property_trees_; } | 344 PropertyTrees* property_trees() { return &property_trees_; } |
| 345 bool needs_meta_info_recomputation() { | 345 bool needs_meta_info_recomputation() { |
| 346 return needs_meta_info_recomputation_; | 346 return needs_meta_info_recomputation_; |
| 347 } | 347 } |
| 348 | 348 |
| 349 Layer* LayerById(int id) const; | 349 Layer* LayerById(int id) const; |
| 350 Layer* LayerForElementId(ElementId element_id) const; |
| 351 Layer* ScrollLayerForElementId(ElementId element_id) const; |
| 350 | 352 |
| 351 void AddLayerShouldPushProperties(Layer* layer); | 353 void AddLayerShouldPushProperties(Layer* layer); |
| 352 void RemoveLayerShouldPushProperties(Layer* layer); | 354 void RemoveLayerShouldPushProperties(Layer* layer); |
| 353 std::unordered_set<Layer*>& LayersThatShouldPushProperties(); | 355 std::unordered_set<Layer*>& LayersThatShouldPushProperties(); |
| 354 bool LayerNeedsPushPropertiesForTesting(Layer* layer); | 356 bool LayerNeedsPushPropertiesForTesting(Layer* layer); |
| 355 | 357 |
| 356 void RegisterLayer(Layer* layer); | 358 void RegisterLayer(Layer* layer); |
| 357 void UnregisterLayer(Layer* layer); | 359 void UnregisterLayer(Layer* layer); |
| 360 void RegisterLayerForElementId(Layer* layer); |
| 361 void UnregisterLayerForElementId(Layer* layer); |
| 362 |
| 358 // MutatorHostClient implementation. | 363 // MutatorHostClient implementation. |
| 359 bool IsElementInList(ElementId element_id, | 364 bool IsElementInList(ElementId element_id, |
| 360 ElementListType list_type) const override; | 365 ElementListType list_type) const override; |
| 361 void SetMutatorsNeedCommit() override; | 366 void SetMutatorsNeedCommit() override; |
| 362 void SetMutatorsNeedRebuildPropertyTrees() override; | 367 void SetMutatorsNeedRebuildPropertyTrees() override; |
| 363 void SetElementFilterMutated(ElementId element_id, | 368 void SetElementFilterMutated(ElementId element_id, |
| 364 ElementListType list_type, | 369 ElementListType list_type, |
| 365 const FilterOperations& filters) override; | 370 const FilterOperations& filters) override; |
| 366 void SetElementOpacityMutated(ElementId element_id, | 371 void SetElementOpacityMutated(ElementId element_id, |
| 367 ElementListType list_type, | 372 ElementListType list_type, |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 | 577 |
| 573 ImageSerializationProcessor* image_serialization_processor_; | 578 ImageSerializationProcessor* image_serialization_processor_; |
| 574 | 579 |
| 575 std::vector<std::unique_ptr<SwapPromise>> swap_promise_list_; | 580 std::vector<std::unique_ptr<SwapPromise>> swap_promise_list_; |
| 576 std::set<SwapPromiseMonitor*> swap_promise_monitor_; | 581 std::set<SwapPromiseMonitor*> swap_promise_monitor_; |
| 577 | 582 |
| 578 PropertyTrees property_trees_; | 583 PropertyTrees property_trees_; |
| 579 | 584 |
| 580 using LayerIdMap = std::unordered_map<int, Layer*>; | 585 using LayerIdMap = std::unordered_map<int, Layer*>; |
| 581 LayerIdMap layer_id_map_; | 586 LayerIdMap layer_id_map_; |
| 587 |
| 588 struct ElementLayers { |
| 589 // Transform, filter and opacity mutations apply to this layer. |
| 590 Layer* main = nullptr; |
| 591 // Scroll mutations apply to this layer. |
| 592 Layer* scroll = nullptr; |
| 593 }; |
| 594 using ElementIdToLayerMap = std::unordered_map<ElementId, ElementLayers>; |
| 595 ElementIdToLayerMap element_id_to_layer_map_; |
| 596 |
| 582 // Set of layers that need to push properties. | 597 // Set of layers that need to push properties. |
| 583 std::unordered_set<Layer*> layers_that_should_push_properties_; | 598 std::unordered_set<Layer*> layers_that_should_push_properties_; |
| 584 | 599 |
| 585 uint32_t surface_id_namespace_; | 600 uint32_t surface_id_namespace_; |
| 586 uint32_t next_surface_sequence_; | 601 uint32_t next_surface_sequence_; |
| 587 | 602 |
| 588 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 603 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
| 589 }; | 604 }; |
| 590 | 605 |
| 591 } // namespace cc | 606 } // namespace cc |
| 592 | 607 |
| 593 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 608 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
| OLD | NEW |