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

Unified Diff: Source/core/animation/AnimationPlayer.h

Issue 210703002: Web Animations: Sort Animations in the AnimationStack (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix compile? :| Created 6 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 | Source/core/animation/AnimationPlayer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/AnimationPlayer.h
diff --git a/Source/core/animation/AnimationPlayer.h b/Source/core/animation/AnimationPlayer.h
index afe87adf3fedef0f9610b98f6cb368d852a959d6..e8b79ba703ce94f39fd465026292a92e015d2863 100644
--- a/Source/core/animation/AnimationPlayer.h
+++ b/Source/core/animation/AnimationPlayer.h
@@ -97,7 +97,25 @@ public:
void cancelAnimationOnCompositor();
bool hasActiveAnimationsOnCompositor();
- static bool hasLowerPriority(AnimationPlayer*, AnimationPlayer*);
+ class SortInfo {
+ public:
+ friend class AnimationPlayer;
+ bool operator<(const SortInfo& other) const;
+ private:
+ SortInfo(unsigned sequenceNumber, double startTime)
+ : m_sequenceNumber(sequenceNumber)
+ , m_startTime(startTime)
+ { }
+ unsigned m_sequenceNumber;
+ double m_startTime;
+ };
+
+ const SortInfo& sortInfo() const { return m_sortInfo; }
+
+ static bool hasLowerPriority(AnimationPlayer* player1, AnimationPlayer* player2)
+ {
+ return player1->sortInfo() < player2->sortInfo();
+ }
private:
AnimationPlayer(DocumentTimeline&, TimedItem*);
@@ -113,6 +131,8 @@ private:
double m_holdTime;
double m_storedTimeLag;
+ SortInfo m_sortInfo;
+
RefPtr<TimedItem> m_content;
// FIXME: We should keep the timeline alive and have this as non-null
// but this is tricky to do without Oilpan
@@ -125,8 +145,6 @@ private:
// This indicates timing information relevant to the player has changed by
// means other than the ordinary progression of time
bool m_outdated;
-
- unsigned m_sequenceNumber;
};
} // namespace
« no previous file with comments | « no previous file | Source/core/animation/AnimationPlayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698