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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 const AnimationPlayer* player() const { return m_player; } | 106 const AnimationPlayer* player() const { return m_player; } |
107 AnimationPlayer* player() { return m_player; } | 107 AnimationPlayer* player() { return m_player; } |
108 const Timing& specifiedTiming() const { return m_timing; } | 108 const Timing& specifiedTiming() const { return m_timing; } |
109 PassRefPtrWillBeRawPtr<AnimationNodeTiming> timing(); | 109 PassRefPtrWillBeRawPtr<AnimationNodeTiming> timing(); |
110 void updateSpecifiedTiming(const Timing&); | 110 void updateSpecifiedTiming(const Timing&); |
111 | 111 |
112 // This method returns time in ms as it is unused except via the API. | 112 // This method returns time in ms as it is unused except via the API. |
113 double localTime(bool& isNull) const { isNull = !m_player; return ensureCalc
ulated().localTime * 1000; } | 113 double localTime(bool& isNull) const { isNull = !m_player; return ensureCalc
ulated().localTime * 1000; } |
114 double currentIteration(bool& isNull) const { isNull = !ensureCalculated().i
sInEffect; return ensureCalculated().currentIteration; } | 114 double currentIteration(bool& isNull) const { isNull = !ensureCalculated().i
sInEffect; return ensureCalculated().currentIteration; } |
115 | 115 |
| 116 void setName(const String& name) { m_name = name; } |
| 117 const String& name() const { return m_name; } |
| 118 |
116 virtual void trace(Visitor*); | 119 virtual void trace(Visitor*); |
117 | 120 |
118 protected: | 121 protected: |
119 explicit AnimationNode(const Timing&, PassOwnPtrWillBeRawPtr<EventDelegate>
= nullptr); | 122 explicit AnimationNode(const Timing&, PassOwnPtrWillBeRawPtr<EventDelegate>
= nullptr); |
120 | 123 |
121 // When AnimationNode receives a new inherited time via updateInheritedTime | 124 // When AnimationNode receives a new inherited time via updateInheritedTime |
122 // it will (if necessary) recalculate timings and (if necessary) call | 125 // it will (if necessary) recalculate timings and (if necessary) call |
123 // updateChildrenAndEffects. | 126 // updateChildrenAndEffects. |
124 void updateInheritedTime(double inheritedTime, TimingUpdateReason) const; | 127 void updateInheritedTime(double inheritedTime, TimingUpdateReason) const; |
125 void invalidate() const { m_needsUpdate = true; }; | 128 void invalidate() const { m_needsUpdate = true; }; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 double timeFraction; | 160 double timeFraction; |
158 bool isCurrent; | 161 bool isCurrent; |
159 bool isInEffect; | 162 bool isInEffect; |
160 bool isInPlay; | 163 bool isInPlay; |
161 double localTime; | 164 double localTime; |
162 double timeToForwardsEffectChange; | 165 double timeToForwardsEffectChange; |
163 double timeToReverseEffectChange; | 166 double timeToReverseEffectChange; |
164 } m_calculated; | 167 } m_calculated; |
165 mutable bool m_needsUpdate; | 168 mutable bool m_needsUpdate; |
166 mutable double m_lastUpdateTime; | 169 mutable double m_lastUpdateTime; |
| 170 String m_name; |
167 | 171 |
168 const CalculatedTiming& ensureCalculated() const; | 172 const CalculatedTiming& ensureCalculated() const; |
169 }; | 173 }; |
170 | 174 |
171 } // namespace blink | 175 } // namespace blink |
172 | 176 |
173 #endif | 177 #endif |
OLD | NEW |