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

Unified Diff: cc/trees/layer_tree_impl.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, 8 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_impl.h
diff --git a/cc/trees/layer_tree_impl.h b/cc/trees/layer_tree_impl.h
index 15d0a4034a36980bc65857dff1aee69b9954792d..7bfb0cb01dc25dec0584cf2a0b666057a7d4c4a0 100644
--- a/cc/trees/layer_tree_impl.h
+++ b/cc/trees/layer_tree_impl.h
@@ -164,15 +164,17 @@ class CC_EXPORT LayerTreeImpl {
// TODO(thakis): Consider marking this CC_EXPORT once we understand
// http://crbug.com/575700 better.
struct ElementLayers {
- // Transform and opacity mutations apply to this layer.
+ // Transform, filter and opacity mutations apply to this layer.
LayerImpl* main = nullptr;
// Scroll mutations apply to this layer.
LayerImpl* scroll = nullptr;
};
+ void RegisterLayerForElementId(LayerImpl* layer);
+ void UnregisterLayerForElementId(LayerImpl* layer);
void AddToElementMap(LayerImpl* layer);
void RemoveFromElementMap(LayerImpl* layer);
- ElementLayers GetMutableLayers(uint64_t element_id);
+ ElementLayers GetMutableLayers(ElementId element_id);
int source_frame_number() const { return source_frame_number_; }
void set_source_frame_number(int frame_number) {
source_frame_number_ = frame_number;
@@ -306,6 +308,9 @@ class CC_EXPORT LayerTreeImpl {
gfx::Rect RootScrollLayerDeviceViewportBounds() const;
LayerImpl* LayerById(int id) const;
+ LayerImpl* LayerForElementId(ElementId element_id) const;
+ LayerImpl* ScrollLayerForElementId(ElementId element_id) const;
+ bool HasAnyLayerForElementId(ElementId element_id) const;
void AddLayerShouldPushProperties(LayerImpl* layer);
void RemoveLayerShouldPushProperties(LayerImpl* layer);
@@ -531,11 +536,15 @@ class CC_EXPORT LayerTreeImpl {
std::unique_ptr<OwnedLayerImplList> layers_;
LayerImplMap layer_id_map_;
+
+ using ElementIdToLayerMap = std::unordered_map<ElementId, ElementLayers>;
+ ElementIdToLayerMap element_id_to_layer_map_;
+ // TODO(loyso): Unify it with element_id_to_layer_map_.
+ std::unordered_map<ElementId, ElementLayers> element_layers_map_;
+
// Set of layers that need to push properties.
std::unordered_set<LayerImpl*> layers_that_should_push_properties_;
- std::unordered_map<uint64_t, ElementLayers> element_layers_map_;
-
// Maps from clip layer ids to scroll layer ids. Note that this only includes
// the subset of clip layers that act as scrolling containers. (This is
// derived from LayerImpl::scroll_clip_layer_ and exists to avoid O(n) walks.)

Powered by Google App Engine
This is Rietveld 408576698