OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 public: | 67 public: |
68 // Note that logic in CSSAnimations depends on the order of these values. | 68 // Note that logic in CSSAnimations depends on the order of these values. |
69 enum Phase { | 69 enum Phase { |
70 PhaseBefore, | 70 PhaseBefore, |
71 PhaseActive, | 71 PhaseActive, |
72 PhaseAfter, | 72 PhaseAfter, |
73 PhaseNone, | 73 PhaseNone, |
74 }; | 74 }; |
75 | 75 |
76 class EventDelegate : public NoBaseWillBeGarbageCollectedFinalized<EventDele
gate> { | 76 class EventDelegate : public NoBaseWillBeGarbageCollectedFinalized<EventDele
gate> { |
| 77 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(EventDelegate); |
77 public: | 78 public: |
78 virtual ~EventDelegate() { } | 79 virtual ~EventDelegate() { } |
79 virtual bool requiresIterationEvents(const AnimationEffect&) = 0; | 80 virtual bool requiresIterationEvents(const AnimationEffect&) = 0; |
80 virtual void onEventCondition(const AnimationEffect&) = 0; | 81 virtual void onEventCondition(const AnimationEffect&) = 0; |
81 DEFINE_INLINE_VIRTUAL_TRACE() { } | 82 DEFINE_INLINE_VIRTUAL_TRACE() { } |
82 }; | 83 }; |
83 | 84 |
84 virtual ~AnimationEffect() { } | 85 virtual ~AnimationEffect() { } |
85 | 86 |
86 virtual bool isAnimation() const { return false; } | 87 virtual bool isAnimation() const { return false; } |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 virtual void specifiedTimingChanged() { } | 144 virtual void specifiedTimingChanged() { } |
144 | 145 |
145 // FIXME: m_parent and m_startTime are placeholders, they depend on timing g
roups. | 146 // FIXME: m_parent and m_startTime are placeholders, they depend on timing g
roups. |
146 RawPtrWillBeMember<AnimationEffect> m_parent; | 147 RawPtrWillBeMember<AnimationEffect> m_parent; |
147 const double m_startTime; | 148 const double m_startTime; |
148 RawPtrWillBeMember<Animation> m_animation; | 149 RawPtrWillBeMember<Animation> m_animation; |
149 Timing m_timing; | 150 Timing m_timing; |
150 OwnPtrWillBeMember<EventDelegate> m_eventDelegate; | 151 OwnPtrWillBeMember<EventDelegate> m_eventDelegate; |
151 | 152 |
152 mutable struct CalculatedTiming { | 153 mutable struct CalculatedTiming { |
| 154 DISALLOW_ALLOCATION(); |
153 Phase phase; | 155 Phase phase; |
154 double currentIteration; | 156 double currentIteration; |
155 double timeFraction; | 157 double timeFraction; |
156 bool isCurrent; | 158 bool isCurrent; |
157 bool isInEffect; | 159 bool isInEffect; |
158 bool isInPlay; | 160 bool isInPlay; |
159 double localTime; | 161 double localTime; |
160 double timeToForwardsEffectChange; | 162 double timeToForwardsEffectChange; |
161 double timeToReverseEffectChange; | 163 double timeToReverseEffectChange; |
162 } m_calculated; | 164 } m_calculated; |
163 mutable bool m_needsUpdate; | 165 mutable bool m_needsUpdate; |
164 mutable double m_lastUpdateTime; | 166 mutable double m_lastUpdateTime; |
165 String m_name; | 167 String m_name; |
166 | 168 |
167 const CalculatedTiming& ensureCalculated() const; | 169 const CalculatedTiming& ensureCalculated() const; |
168 }; | 170 }; |
169 | 171 |
170 } // namespace blink | 172 } // namespace blink |
171 | 173 |
172 #endif // AnimationEffect_h | 174 #endif // AnimationEffect_h |
OLD | NEW |