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

Unified Diff: cc/animation/animation_host.h

Issue 1814103002: CC Animation: Use unordered_map instead of vector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use move semantics on insertions. Created 4 years, 9 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 02f37e96558e378f4a8715d2411916b56e1d9705..e7f4ae684d64922ba5d8428d982f90cb6e65fe97 100644
--- a/cc/animation/animation_host.h
+++ b/cc/animation/animation_host.h
@@ -6,7 +6,6 @@
#define CC_ANIMATION_ANIMATION_HOST_H_
#include <unordered_map>
-#include <vector>
#include "base/macros.h"
#include "base/memory/ref_counted.h"
@@ -34,8 +33,6 @@ class LayerTreeHost;
enum class ThreadInstance { MAIN, IMPL };
-typedef std::vector<scoped_refptr<AnimationTimeline>> AnimationTimelineList;
-
// An AnimationHost contains all the state required to play animations.
// Specifically, it owns all the AnimationTimelines objects.
// There is just one AnimationHost for LayerTreeHost on main renderer thread
@@ -161,8 +158,7 @@ class CC_EXPORT AnimationHost {
void RemoveTimelinesFromImplThread(AnimationHost* host_impl) const;
void PushPropertiesToImplThread(AnimationHost* host_impl);
- void EraseTimelines(AnimationTimelineList::iterator begin,
- AnimationTimelineList::iterator end);
+ void EraseTimeline(scoped_refptr<AnimationTimeline> timeline);
// TODO(loyso): For now AnimationPlayers share LayerAnimationController object
// if they are attached to the same element(layer). Note that Element can
@@ -171,7 +167,11 @@ class CC_EXPORT AnimationHost {
std::unordered_map<int, scoped_ptr<ElementAnimations>>;
LayerToElementAnimationsMap layer_to_element_animations_map_;
- AnimationTimelineList timelines_;
+ // A list of all timelines which this host owns.
+ using IdToTimelineMap =
+ std::unordered_map<int, scoped_refptr<AnimationTimeline>>;
+ IdToTimelineMap id_to_timeline_map_;
+
scoped_ptr<AnimationRegistrar> animation_registrar_;
MutatorHostClient* mutator_host_client_;
« 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