| 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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 | 341 |
| 342 PropertyTrees* property_trees() { return &property_trees_; } | 342 PropertyTrees* property_trees() { return &property_trees_; } |
| 343 bool needs_meta_info_recomputation() { | 343 bool needs_meta_info_recomputation() { |
| 344 return needs_meta_info_recomputation_; | 344 return needs_meta_info_recomputation_; |
| 345 } | 345 } |
| 346 | 346 |
| 347 void SetLayerTreeMutator(std::unique_ptr<LayerTreeMutator> mutator); | 347 void SetLayerTreeMutator(std::unique_ptr<LayerTreeMutator> mutator); |
| 348 | 348 |
| 349 Layer* LayerById(int id) const; | 349 Layer* LayerById(int id) const; |
| 350 | 350 |
| 351 Layer* LayerByElementId(ElementId element_id) const; |
| 352 void AddToElementMap(Layer* layer); |
| 353 void RemoveFromElementMap(Layer* layer); |
| 354 |
| 351 void AddLayerShouldPushProperties(Layer* layer); | 355 void AddLayerShouldPushProperties(Layer* layer); |
| 352 void RemoveLayerShouldPushProperties(Layer* layer); | 356 void RemoveLayerShouldPushProperties(Layer* layer); |
| 353 std::unordered_set<Layer*>& LayersThatShouldPushProperties(); | 357 std::unordered_set<Layer*>& LayersThatShouldPushProperties(); |
| 354 bool LayerNeedsPushPropertiesForTesting(Layer* layer); | 358 bool LayerNeedsPushPropertiesForTesting(Layer* layer); |
| 355 | 359 |
| 356 void RegisterLayer(Layer* layer); | 360 void RegisterLayer(Layer* layer); |
| 357 void UnregisterLayer(Layer* layer); | 361 void UnregisterLayer(Layer* layer); |
| 358 // MutatorHostClient implementation. | 362 // MutatorHostClient implementation. |
| 359 bool IsElementInList(ElementId element_id, | 363 bool IsElementInList(ElementId element_id, |
| 360 ElementListType list_type) const override; | 364 ElementListType list_type) const override; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 // expected input is a serialized remote LayerTreeHost. After deserializing | 418 // expected input is a serialized remote LayerTreeHost. After deserializing |
| 415 // the protobuf, the normal commit-flow should continue. | 419 // the protobuf, the normal commit-flow should continue. |
| 416 void FromProtobufForCommit(const proto::LayerTreeHost& proto); | 420 void FromProtobufForCommit(const proto::LayerTreeHost& proto); |
| 417 | 421 |
| 418 bool IsSingleThreaded() const; | 422 bool IsSingleThreaded() const; |
| 419 bool IsThreaded() const; | 423 bool IsThreaded() const; |
| 420 bool IsRemoteServer() const; | 424 bool IsRemoteServer() const; |
| 421 bool IsRemoteClient() const; | 425 bool IsRemoteClient() const; |
| 422 void BuildPropertyTreesForTesting(); | 426 void BuildPropertyTreesForTesting(); |
| 423 | 427 |
| 428 void SetElementIdsForTesting(); |
| 429 |
| 424 ImageSerializationProcessor* image_serialization_processor() const { | 430 ImageSerializationProcessor* image_serialization_processor() const { |
| 425 return image_serialization_processor_; | 431 return image_serialization_processor_; |
| 426 } | 432 } |
| 427 | 433 |
| 428 void ReportFixedRasterScaleUseCounters( | 434 void ReportFixedRasterScaleUseCounters( |
| 429 bool has_fixed_raster_scale_blurry_content, | 435 bool has_fixed_raster_scale_blurry_content, |
| 430 bool has_fixed_raster_scale_potential_performance_regression); | 436 bool has_fixed_raster_scale_potential_performance_regression); |
| 431 | 437 |
| 432 protected: | 438 protected: |
| 433 LayerTreeHost(InitParams* params, CompositorMode mode); | 439 LayerTreeHost(InitParams* params, CompositorMode mode); |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 | 590 |
| 585 ImageSerializationProcessor* image_serialization_processor_; | 591 ImageSerializationProcessor* image_serialization_processor_; |
| 586 | 592 |
| 587 std::vector<std::unique_ptr<SwapPromise>> swap_promise_list_; | 593 std::vector<std::unique_ptr<SwapPromise>> swap_promise_list_; |
| 588 std::set<SwapPromiseMonitor*> swap_promise_monitor_; | 594 std::set<SwapPromiseMonitor*> swap_promise_monitor_; |
| 589 | 595 |
| 590 PropertyTrees property_trees_; | 596 PropertyTrees property_trees_; |
| 591 | 597 |
| 592 using LayerIdMap = std::unordered_map<int, Layer*>; | 598 using LayerIdMap = std::unordered_map<int, Layer*>; |
| 593 LayerIdMap layer_id_map_; | 599 LayerIdMap layer_id_map_; |
| 600 |
| 601 using ElementLayersMap = std::unordered_map<ElementId, Layer*, ElementIdHash>; |
| 602 ElementLayersMap element_layers_map_; |
| 603 |
| 594 // Set of layers that need to push properties. | 604 // Set of layers that need to push properties. |
| 595 std::unordered_set<Layer*> layers_that_should_push_properties_; | 605 std::unordered_set<Layer*> layers_that_should_push_properties_; |
| 596 | 606 |
| 597 uint32_t surface_id_namespace_; | 607 uint32_t surface_id_namespace_; |
| 598 uint32_t next_surface_sequence_; | 608 uint32_t next_surface_sequence_; |
| 599 | 609 |
| 600 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); | 610 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); |
| 601 }; | 611 }; |
| 602 | 612 |
| 603 } // namespace cc | 613 } // namespace cc |
| 604 | 614 |
| 605 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 615 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
| OLD | NEW |