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

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

Issue 19266007: Web Animations: Introduce ActiveAnimations and AnimationStack (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased. Created 7 years, 5 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 | « Source/core/animation/Player.cpp ('k') | Source/core/animation/TimedItem.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/TimedItem.h
diff --git a/Source/core/animation/TimedItem.h b/Source/core/animation/TimedItem.h
index 9e32eb7b06048028651c692c7dddc1eabb6e04fd..30cff62d10b47871baf0bca2e913514f5504189b 100644
--- a/Source/core/animation/TimedItem.h
+++ b/Source/core/animation/TimedItem.h
@@ -36,6 +36,8 @@
namespace WebCore {
+class Player;
+
static inline bool isNull(double value)
{
return std::isnan(value);
@@ -47,6 +49,7 @@ static inline double nullValue()
}
class TimedItem : public RefCounted<TimedItem> {
+ friend class Player; // Calls attach/detach, updateInheritedTime.
public:
virtual ~TimedItem() { }
@@ -60,6 +63,7 @@ public:
double currentIteration() const { return ensureCalculated().currentIteration; }
double activeDuration() const { return ensureCalculated().activeDuration; }
double timeFraction() const { return ensureCalculated().timeFraction; }
+ Player* player() const { return m_player; }
protected:
TimedItem(const Timing&);
@@ -70,14 +74,21 @@ protected:
void updateInheritedTime(double inheritedTime) const;
virtual void updateChildrenAndEffects(bool wasActiveOrInEffect) const = 0;
virtual double intrinsicIterationDuration() const { return 0; };
-
- friend class Player; // Calls updateInheritedTime.
+ virtual void willDetach() = 0;
private:
+ void attach(Player* player) { m_player = player; };
+ void detach()
+ {
+ ASSERT(m_player);
+ willDetach();
+ m_player = 0;
+ };
+
// FIXME: m_parent and m_startTime are placeholders, they depend on timing groups.
TimedItem* const m_parent;
const double m_startTime;
-
+ Player* m_player;
Timing m_specified;
// FIXME: Should be versioned by monotonic value on player.
« no previous file with comments | « Source/core/animation/Player.cpp ('k') | Source/core/animation/TimedItem.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698