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

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: 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_impl.h
diff --git a/cc/trees/layer_tree_impl.h b/cc/trees/layer_tree_impl.h
index c671e31b83b5776ca25afe362111794f77d0e9fe..b928ff2bd7e1759b97dbc5418f4280a902c50abf 100644
--- a/cc/trees/layer_tree_impl.h
+++ b/cc/trees/layer_tree_impl.h
@@ -168,9 +168,11 @@ class CC_EXPORT LayerTreeImpl {
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;
@@ -304,6 +306,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);
@@ -529,11 +534,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