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

Unified Diff: cc/trees/layer_tree_impl.h

Issue 1973083002: Use element id's for animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: get element id's from scroll node data directly. 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 48bb194e7c267b897dff9c0ac05d3ffed8d73717..a80eb0686a8d7055493f87b4745d351af097adb6 100644
--- a/cc/trees/layer_tree_impl.h
+++ b/cc/trees/layer_tree_impl.h
@@ -153,19 +153,8 @@ class CC_EXPORT LayerTreeImpl {
LayerListReverseIterator<LayerImpl> rbegin();
LayerListReverseIterator<LayerImpl> rend();
- struct CC_EXPORT ElementLayers {
- // Transform and opacity mutations apply to this layer.
- LayerImpl* main = nullptr;
- // Scroll mutations apply to this layer.
- LayerImpl* scroll = nullptr;
- };
-
- void AddToElementMap(LayerImpl* layer);
- void RemoveFromElementMap(LayerImpl* layer);
-
void AddToOpacityAnimationsMap(int id, float opacity);
- ElementLayers GetMutableLayers(uint64_t element_id);
int source_frame_number() const { return source_frame_number_; }
void set_source_frame_number(int frame_number) {
source_frame_number_ = frame_number;
@@ -263,6 +252,8 @@ class CC_EXPORT LayerTreeImpl {
return top_controls_shown_ratio_.get();
}
+ void SetElementIdsForTesting();
+
// Updates draw properties and render surface layer list, as well as tile
// priorities. Returns false if it was unable to update. Updating lcd
// text may cause invalidations, so should only be done after a commit.
@@ -300,6 +291,13 @@ class CC_EXPORT LayerTreeImpl {
LayerImpl* LayerById(int id) const;
+ // TODO(vollick): this is deprecated. It is used by
+ // animation/compositor-worker to look up layers to mutate, but in future, we
+ // will update property trees.
+ LayerImpl* LayerByElementId(ElementId element_id) const;
+ void AddToElementMap(LayerImpl* layer);
+ void RemoveFromElementMap(LayerImpl* layer);
+
void AddLayerShouldPushProperties(LayerImpl* layer);
void RemoveLayerShouldPushProperties(LayerImpl* layer);
std::unordered_set<LayerImpl*>& LayersThatShouldPushProperties();
@@ -516,7 +514,7 @@ class CC_EXPORT LayerTreeImpl {
// 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_;
+ std::unordered_map<ElementId, LayerImpl*, ElementIdHash> element_layers_map_;
std::unordered_map<int, float> opacity_animations_map_;

Powered by Google App Engine
This is Rietveld 408576698