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