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

Unified Diff: cc/animation/animation_host.h

Issue 2538973002: CC Animation: Make AnimationPlayer to be a unit of activation. (Closed)
Patch Set: Move ScrollOffsetAnimationWasInterrupted to AnimationPlayer Created 4 years 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') | cc/animation/animation_host.cc » ('J')
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 49adfe5f24976fb61e0af43c51cf9db24b64aaa9..e91b55e0f09757da8b91cdb5a339cd4307cb357c 100644
--- a/cc/animation/animation_host.h
+++ b/cc/animation/animation_host.h
@@ -7,6 +7,7 @@
#include <memory>
#include <unordered_map>
+#include <vector>
#include "base/macros.h"
#include "base/memory/ptr_util.h"
@@ -49,6 +50,7 @@ class CC_ANIMATION_EXPORT AnimationHost
std::unordered_map<ElementId,
scoped_refptr<ElementAnimations>,
ElementIdHash>;
+ using PlayersList = std::vector<scoped_refptr<AnimationPlayer>>;
static std::unique_ptr<AnimationHost> CreateMainInstance();
static std::unique_ptr<AnimationHost> CreateForTesting(
@@ -169,15 +171,15 @@ class CC_ANIMATION_EXPORT AnimationHost
// This should only be called from the main thread.
ScrollOffsetAnimations& scroll_offset_animations() const;
- // Registers the given element animations as active. An active element
- // animations is one that has a running animation that needs to be ticked.
- void DidActivateElementAnimations(ElementAnimations* element_animations);
+ // Registers the given animation player as active. An active animation
+ // player is one that has a running animation that needs to be ticked.
+ void ActivateAnimationPlayer(scoped_refptr<AnimationPlayer> player);
- // Unregisters the given element animations. When this happens, the
- // element animations will no longer be ticked (since it's not active).
- void DidDeactivateElementAnimations(ElementAnimations* element_animations);
+ // Unregisters the given animation player. When this happens, the
+ // animation player will no longer be ticked (since it's not active).
+ void DeactivateAnimationPlayer(scoped_refptr<AnimationPlayer> player);
- const ElementToAnimationsMap& active_element_animations_for_testing() const;
+ const PlayersList& active_players_for_testing() const;
const ElementToAnimationsMap& all_element_animations_for_testing() const;
private:
@@ -190,7 +192,7 @@ class CC_ANIMATION_EXPORT AnimationHost
void EraseTimeline(scoped_refptr<AnimationTimeline> timeline);
ElementToAnimationsMap element_to_animations_map_;
- ElementToAnimationsMap active_element_to_animations_map_;
+ PlayersList active_players_;
// 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') | cc/animation/animation_host.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698