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

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

Issue 1973083002: Use element id's for animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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
« no previous file with comments | « cc/test/layer_test_common.h ('k') | cc/trees/layer_tree_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 344
345 PropertyTrees* property_trees() { return &property_trees_; } 345 PropertyTrees* property_trees() { return &property_trees_; }
346 bool needs_meta_info_recomputation() { 346 bool needs_meta_info_recomputation() {
347 return needs_meta_info_recomputation_; 347 return needs_meta_info_recomputation_;
348 } 348 }
349 349
350 void SetLayerTreeMutator(std::unique_ptr<LayerTreeMutator> mutator); 350 void SetLayerTreeMutator(std::unique_ptr<LayerTreeMutator> mutator);
351 351
352 Layer* LayerById(int id) const; 352 Layer* LayerById(int id) const;
353 353
354 Layer* LayerByElementId(ElementId element_id) const;
355 void AddToElementMap(Layer* layer);
356 void RemoveFromElementMap(Layer* layer);
357
354 void AddLayerShouldPushProperties(Layer* layer); 358 void AddLayerShouldPushProperties(Layer* layer);
355 void RemoveLayerShouldPushProperties(Layer* layer); 359 void RemoveLayerShouldPushProperties(Layer* layer);
356 std::unordered_set<Layer*>& LayersThatShouldPushProperties(); 360 std::unordered_set<Layer*>& LayersThatShouldPushProperties();
357 bool LayerNeedsPushPropertiesForTesting(Layer* layer); 361 bool LayerNeedsPushPropertiesForTesting(Layer* layer);
358 362
359 void RegisterLayer(Layer* layer); 363 void RegisterLayer(Layer* layer);
360 void UnregisterLayer(Layer* layer); 364 void UnregisterLayer(Layer* layer);
361 // MutatorHostClient implementation. 365 // MutatorHostClient implementation.
362 bool IsElementInList(ElementId element_id, 366 bool IsElementInList(ElementId element_id,
363 ElementListType list_type) const override; 367 ElementListType list_type) const override;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 // expected input is a serialized remote LayerTreeHost. After deserializing 421 // expected input is a serialized remote LayerTreeHost. After deserializing
418 // the protobuf, the normal commit-flow should continue. 422 // the protobuf, the normal commit-flow should continue.
419 void FromProtobufForCommit(const proto::LayerTreeHost& proto); 423 void FromProtobufForCommit(const proto::LayerTreeHost& proto);
420 424
421 bool IsSingleThreaded() const; 425 bool IsSingleThreaded() const;
422 bool IsThreaded() const; 426 bool IsThreaded() const;
423 bool IsRemoteServer() const; 427 bool IsRemoteServer() const;
424 bool IsRemoteClient() const; 428 bool IsRemoteClient() const;
425 void BuildPropertyTreesForTesting(); 429 void BuildPropertyTreesForTesting();
426 430
431 void SetElementIdsForTesting();
432
427 ImageSerializationProcessor* image_serialization_processor() const { 433 ImageSerializationProcessor* image_serialization_processor() const {
428 return image_serialization_processor_; 434 return image_serialization_processor_;
429 } 435 }
430 436
431 EnginePictureCache* engine_picture_cache() const { 437 EnginePictureCache* engine_picture_cache() const {
432 return engine_picture_cache_ ? engine_picture_cache_.get() : nullptr; 438 return engine_picture_cache_ ? engine_picture_cache_.get() : nullptr;
433 } 439 }
434 440
435 ClientPictureCache* client_picture_cache() const { 441 ClientPictureCache* client_picture_cache() const {
436 return client_picture_cache_ ? client_picture_cache_.get() : nullptr; 442 return client_picture_cache_ ? client_picture_cache_.get() : nullptr;
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 std::unique_ptr<EnginePictureCache> engine_picture_cache_; 600 std::unique_ptr<EnginePictureCache> engine_picture_cache_;
595 std::unique_ptr<ClientPictureCache> client_picture_cache_; 601 std::unique_ptr<ClientPictureCache> client_picture_cache_;
596 602
597 std::vector<std::unique_ptr<SwapPromise>> swap_promise_list_; 603 std::vector<std::unique_ptr<SwapPromise>> swap_promise_list_;
598 std::set<SwapPromiseMonitor*> swap_promise_monitor_; 604 std::set<SwapPromiseMonitor*> swap_promise_monitor_;
599 605
600 PropertyTrees property_trees_; 606 PropertyTrees property_trees_;
601 607
602 using LayerIdMap = std::unordered_map<int, Layer*>; 608 using LayerIdMap = std::unordered_map<int, Layer*>;
603 LayerIdMap layer_id_map_; 609 LayerIdMap layer_id_map_;
610
611 using ElementLayersMap = std::unordered_map<ElementId, Layer*, ElementIdHash>;
612 ElementLayersMap element_layers_map_;
613
604 // Set of layers that need to push properties. 614 // Set of layers that need to push properties.
605 std::unordered_set<Layer*> layers_that_should_push_properties_; 615 std::unordered_set<Layer*> layers_that_should_push_properties_;
606 616
607 uint32_t surface_id_namespace_; 617 uint32_t surface_id_namespace_;
608 uint32_t next_surface_sequence_; 618 uint32_t next_surface_sequence_;
609 619
610 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost); 620 DISALLOW_COPY_AND_ASSIGN(LayerTreeHost);
611 }; 621 };
612 622
613 } // namespace cc 623 } // namespace cc
614 624
615 #endif // CC_TREES_LAYER_TREE_HOST_H_ 625 #endif // CC_TREES_LAYER_TREE_HOST_H_
OLDNEW
« no previous file with comments | « cc/test/layer_test_common.h ('k') | cc/trees/layer_tree_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698