Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(835)

Side by Side Diff: cc/trees/layer_tree_host.h

Issue 1944623002: CC Animation: Use ElementId to attach CC animation players. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@erasedomids
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 SurfaceSequence CreateSurfaceSequence(); 342 SurfaceSequence CreateSurfaceSequence();
343 343
344 void SetAuthoritativeVSyncInterval(const base::TimeDelta& interval); 344 void SetAuthoritativeVSyncInterval(const base::TimeDelta& interval);
345 345
346 PropertyTrees* property_trees() { return &property_trees_; } 346 PropertyTrees* property_trees() { return &property_trees_; }
347 bool needs_meta_info_recomputation() { 347 bool needs_meta_info_recomputation() {
348 return needs_meta_info_recomputation_; 348 return needs_meta_info_recomputation_;
349 } 349 }
350 350
351 Layer* LayerById(int id) const; 351 Layer* LayerById(int id) const;
352 Layer* LayerForElementId(ElementId element_id) const;
353 Layer* ScrollLayerForElementId(ElementId element_id) const;
352 354
353 void AddLayerShouldPushProperties(Layer* layer); 355 void AddLayerShouldPushProperties(Layer* layer);
354 void RemoveLayerShouldPushProperties(Layer* layer); 356 void RemoveLayerShouldPushProperties(Layer* layer);
355 std::unordered_set<Layer*>& LayersThatShouldPushProperties(); 357 std::unordered_set<Layer*>& LayersThatShouldPushProperties();
356 bool LayerNeedsPushPropertiesForTesting(Layer* layer); 358 bool LayerNeedsPushPropertiesForTesting(Layer* layer);
357 359
358 void RegisterLayer(Layer* layer); 360 void RegisterLayer(Layer* layer);
359 void UnregisterLayer(Layer* layer); 361 void UnregisterLayer(Layer* layer);
362 void RegisterLayerForElementId(Layer* layer);
363 void UnregisterLayerForElementId(Layer* layer);
364
360 // MutatorHostClient implementation. 365 // MutatorHostClient implementation.
361 bool IsElementInList(ElementId element_id, 366 bool IsElementInList(ElementId element_id,
362 ElementListType list_type) const override; 367 ElementListType list_type) const override;
363 void SetMutatorsNeedCommit() override; 368 void SetMutatorsNeedCommit() override;
364 void SetMutatorsNeedRebuildPropertyTrees() override; 369 void SetMutatorsNeedRebuildPropertyTrees() override;
365 void SetElementFilterMutated(ElementId element_id, 370 void SetElementFilterMutated(ElementId element_id,
366 ElementListType list_type, 371 ElementListType list_type,
367 const FilterOperations& filters) override; 372 const FilterOperations& filters) override;
368 void SetElementOpacityMutated(ElementId element_id, 373 void SetElementOpacityMutated(ElementId element_id,
369 ElementListType list_type, 374 ElementListType list_type,
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 579
575 ImageSerializationProcessor* image_serialization_processor_; 580 ImageSerializationProcessor* image_serialization_processor_;
576 581
577 std::vector<std::unique_ptr<SwapPromise>> swap_promise_list_; 582 std::vector<std::unique_ptr<SwapPromise>> swap_promise_list_;
578 std::set<SwapPromiseMonitor*> swap_promise_monitor_; 583 std::set<SwapPromiseMonitor*> swap_promise_monitor_;
579 584
580 PropertyTrees property_trees_; 585 PropertyTrees property_trees_;
581 586
582 using LayerIdMap = std::unordered_map<int, Layer*>; 587 using LayerIdMap = std::unordered_map<int, Layer*>;
583 LayerIdMap layer_id_map_; 588 LayerIdMap layer_id_map_;
589
590 struct ElementLayers {
591 // Transform, filter and opacity mutations apply to this layer.
592 Layer* main = nullptr;
593 // Scroll mutations apply to this layer.
594 Layer* scroll = nullptr;
595 };
596 using ElementIdToLayerMap = std::unordered_map<ElementId, ElementLayers>;
597 ElementIdToLayerMap element_id_to_layer_map_;
598
584 // Set of layers that need to push properties. 599 // Set of layers that need to push properties.
585 std::unordered_set<Layer*> layers_that_should_push_properties_; 600 std::unordered_set<Layer*> layers_that_should_push_properties_;
586 601
587 uint32_t surface_id_namespace_; 602 uint32_t surface_id_namespace_;
588 uint32_t next_surface_sequence_; 603 uint32_t next_surface_sequence_;
589 604
590 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); 605 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost);
591 }; 606 };
592 607
593 } // namespace cc 608 } // namespace cc
594 609
595 #endif // CC_TREES_LAYER_TREE_HOST_H_ 610 #endif // CC_TREES_LAYER_TREE_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698