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

Unified 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: Let CC clients generate their own ElementIds locally. 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 side-by-side diff with in-line comments
Download patch
Index: cc/trees/layer_tree_host.h
diff --git a/cc/trees/layer_tree_host.h b/cc/trees/layer_tree_host.h
index 8a522d6008657323ffcc81ab6c04d90ad7b9bce4..4aa6f7c6a2497efd47a1209ffe9f98ee0eed1169 100644
--- a/cc/trees/layer_tree_host.h
+++ b/cc/trees/layer_tree_host.h
@@ -347,6 +347,8 @@ class CC_EXPORT LayerTreeHost : public MutatorHostClient {
}
Layer* LayerById(int id) const;
+ Layer* LayerForElementId(ElementId element_id) const;
+ Layer* ScrollLayerForElementId(ElementId element_id) const;
void AddLayerShouldPushProperties(Layer* layer);
void RemoveLayerShouldPushProperties(Layer* layer);
@@ -355,6 +357,9 @@ class CC_EXPORT LayerTreeHost : public MutatorHostClient {
void RegisterLayer(Layer* layer);
void UnregisterLayer(Layer* layer);
+ void RegisterLayerForElementId(Layer* layer);
+ void UnregisterLayerForElementId(Layer* layer);
+
// MutatorHostClient implementation.
bool IsElementInList(ElementId element_id,
ElementListType list_type) const override;
@@ -579,6 +584,16 @@ class CC_EXPORT LayerTreeHost : public MutatorHostClient {
using LayerIdMap = std::unordered_map<int, Layer*>;
LayerIdMap layer_id_map_;
+
+ struct ElementLayers {
+ // Transform, filter and opacity mutations apply to this layer.
+ Layer* main = nullptr;
+ // Scroll mutations apply to this layer.
+ Layer* scroll = nullptr;
+ };
+ using ElementIdToLayerMap = std::unordered_map<ElementId, ElementLayers>;
+ ElementIdToLayerMap element_id_to_layer_map_;
+
// Set of layers that need to push properties.
std::unordered_set<Layer*> layers_that_should_push_properties_;

Powered by Google App Engine
This is Rietveld 408576698