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

Unified Diff: cc/animation/animation_host.h

Issue 1921583003: CC Animation: Let MutatorHostClient deals with elements instead of layers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@elementid
Patch Set: Rename methods in ElementAnimations 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
« no previous file with comments | « no previous file | cc/animation/animation_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/animation/animation_host.h
diff --git a/cc/animation/animation_host.h b/cc/animation/animation_host.h
index 88e7e7720d6e8aa2db5efeb20666f8724d171a1c..49f25b7d96c74590ffcaae5daae813451c835afc 100644
--- a/cc/animation/animation_host.h
+++ b/cc/animation/animation_host.h
@@ -42,8 +42,8 @@ enum class ThreadInstance { MAIN, IMPL };
// LayerTreeMutatorsClient interface.
class CC_EXPORT AnimationHost {
public:
- using LayerToElementAnimationsMap =
- std::unordered_map<int, scoped_refptr<ElementAnimations>>;
+ using ElementToAnimationsMap =
+ std::unordered_map<ElementId, scoped_refptr<ElementAnimations>>;
static std::unique_ptr<AnimationHost> Create(ThreadInstance thread_instance);
~AnimationHost();
@@ -54,13 +54,14 @@ class CC_EXPORT AnimationHost {
void ClearTimelines();
- void RegisterLayer(ElementId element_id, LayerTreeType tree_type);
- void UnregisterLayer(ElementId element_id, LayerTreeType tree_type);
+ void RegisterElement(ElementId element_id, ElementListType list_type);
+ void UnregisterElement(ElementId element_id, ElementListType list_type);
- void RegisterPlayerForLayer(ElementId element_id, AnimationPlayer* player);
- void UnregisterPlayerForLayer(ElementId element_id, AnimationPlayer* player);
+ void RegisterPlayerForElement(ElementId element_id, AnimationPlayer* player);
+ void UnregisterPlayerForElement(ElementId element_id,
+ AnimationPlayer* player);
- scoped_refptr<ElementAnimations> GetElementAnimationsForLayerId(
+ scoped_refptr<ElementAnimations> GetElementAnimationsForElementId(
ElementId element_id) const;
// Parent LayerTreeHost or LayerTreeHostImpl.
@@ -90,18 +91,18 @@ class CC_EXPORT AnimationHost {
bool ScrollOffsetAnimationWasInterrupted(ElementId element_id) const;
bool IsAnimatingFilterProperty(ElementId element_id,
- LayerTreeType tree_type) const;
+ ElementListType list_type) const;
bool IsAnimatingOpacityProperty(ElementId element_id,
- LayerTreeType tree_type) const;
+ ElementListType list_type) const;
bool IsAnimatingTransformProperty(ElementId element_id,
- LayerTreeType tree_type) const;
+ ElementListType list_type) const;
bool HasPotentiallyRunningFilterAnimation(ElementId element_id,
- LayerTreeType tree_type) const;
+ ElementListType list_type) const;
bool HasPotentiallyRunningOpacityAnimation(ElementId element_id,
- LayerTreeType tree_type) const;
+ ElementListType list_type) const;
bool HasPotentiallyRunningTransformAnimation(ElementId element_id,
- LayerTreeType tree_type) const;
+ ElementListType list_type) const;
bool HasAnyAnimationTargetingProperty(ElementId element_id,
TargetProperty::Type property) const;
@@ -123,14 +124,14 @@ class CC_EXPORT AnimationHost {
gfx::BoxF* bounds) const;
bool HasOnlyTranslationTransforms(ElementId element_id,
- LayerTreeType tree_type) const;
+ ElementListType list_type) const;
bool AnimationsPreserveAxisAlignment(ElementId element_id) const;
bool MaximumTargetScale(ElementId element_id,
- LayerTreeType tree_type,
+ ElementListType list_type,
float* max_scale) const;
bool AnimationStartScale(ElementId element_id,
- LayerTreeType tree_type,
+ ElementListType list_type,
float* start_scale) const;
bool HasAnyAnimation(ElementId element_id) const;
@@ -160,9 +161,8 @@ class CC_EXPORT AnimationHost {
// Unregisters the given ElementAnimations as alive.
void UnregisterElementAnimations(ElementAnimations* element_animations);
- const LayerToElementAnimationsMap& active_element_animations_for_testing()
- const;
- const LayerToElementAnimationsMap& all_element_animations_for_testing() const;
+ const ElementToAnimationsMap& active_element_animations_for_testing() const;
+ const ElementToAnimationsMap& all_element_animations_for_testing() const;
bool animation_waiting_for_deletion() const {
return animation_waiting_for_deletion_;
@@ -178,8 +178,8 @@ class CC_EXPORT AnimationHost {
void EraseTimeline(scoped_refptr<AnimationTimeline> timeline);
- LayerToElementAnimationsMap layer_to_element_animations_map_;
- LayerToElementAnimationsMap active_element_animations_map_;
+ ElementToAnimationsMap element_to_animations_map_;
+ ElementToAnimationsMap active_element_to_animations_map_;
// A list of all timelines which this host owns.
using IdToTimelineMap =
« no previous file with comments | « no previous file | cc/animation/animation_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698