| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 bool isInPlay() const { return ensureCalculated().isInPlay; } | 91 bool isInPlay() const { return ensureCalculated().isInPlay; } |
| 92 double currentIteration() const { return ensureCalculated().currentIteration
; } | 92 double currentIteration() const { return ensureCalculated().currentIteration
; } |
| 93 double timeFraction() const { return ensureCalculated().timeFraction; } | 93 double timeFraction() const { return ensureCalculated().timeFraction; } |
| 94 double timeToForwardsEffectChange() const { return ensureCalculated().timeTo
ForwardsEffectChange; } | 94 double timeToForwardsEffectChange() const { return ensureCalculated().timeTo
ForwardsEffectChange; } |
| 95 double timeToReverseEffectChange() const { return ensureCalculated().timeToR
everseEffectChange; } | 95 double timeToReverseEffectChange() const { return ensureCalculated().timeToR
everseEffectChange; } |
| 96 | 96 |
| 97 double iterationDuration() const; | 97 double iterationDuration() const; |
| 98 double activeDurationInternal() const; | 98 double activeDurationInternal() const; |
| 99 double endTimeInternal() const { return specifiedTiming().startDelay + activ
eDurationInternal() + specifiedTiming().endDelay; } | 99 double endTimeInternal() const { return specifiedTiming().startDelay + activ
eDurationInternal() + specifiedTiming().endDelay; } |
| 100 | 100 |
| 101 const Animation* animation() const; | 101 const Animation* animation() const { return m_animation; } |
| 102 Animation* animation(); | 102 Animation* animation() { return m_animation; } |
| 103 const Timing& specifiedTiming() const { return m_timing; } | 103 const Timing& specifiedTiming() const { return m_timing; } |
| 104 AnimationEffectTiming* timing(); | 104 AnimationEffectTiming* timing(); |
| 105 void updateSpecifiedTiming(const Timing&); | 105 void updateSpecifiedTiming(const Timing&); |
| 106 | 106 |
| 107 void computedTiming(ComputedTimingProperties&); | 107 void computedTiming(ComputedTimingProperties&); |
| 108 ComputedTimingProperties computedTiming(); | 108 ComputedTimingProperties computedTiming(); |
| 109 | 109 |
| 110 void setName(const String& name) { m_name = name; } | 110 void setName(const String& name) { m_name = name; } |
| 111 const String& name() const { return m_name; } | 111 const String& name() const { return m_name; } |
| 112 | 112 |
| 113 DECLARE_VIRTUAL_TRACE(); | 113 DECLARE_VIRTUAL_TRACE(); |
| 114 | 114 |
| 115 protected: | 115 protected: |
| 116 explicit AnimationEffect(const Timing&, EventDelegate* = nullptr); | 116 explicit AnimationEffect(const Timing&, EventDelegate* = nullptr); |
| 117 | 117 |
| 118 // When AnimationEffect receives a new inherited time via updateInheritedTim
e | 118 // When AnimationEffect receives a new inherited time via updateInheritedTim
e |
| 119 // it will (if necessary) recalculate timings and (if necessary) call | 119 // it will (if necessary) recalculate timings and (if necessary) call |
| 120 // updateChildrenAndEffects. | 120 // updateChildrenAndEffects. |
| 121 void updateInheritedTime(double, TimingUpdateReason) const; | 121 void updateInheritedTime(double inheritedTime, TimingUpdateReason) const; |
| 122 void invalidate() const { m_needsUpdate = true; } | 122 void invalidate() const { m_needsUpdate = true; } |
| 123 bool requiresIterationEvents() const; | 123 bool requiresIterationEvents() const { return m_eventDelegate && m_eventDele
gate->requiresIterationEvents(*this); } |
| 124 void clearEventDelegate(); | 124 void clearEventDelegate() { m_eventDelegate = nullptr; } |
| 125 | 125 |
| 126 virtual void attach(Animation*); | 126 virtual void attach(Animation* animation) |
| 127 virtual void detach(); | 127 { |
| 128 m_animation = animation; |
| 129 } |
| 130 |
| 131 virtual void detach() |
| 132 { |
| 133 ASSERT(m_animation); |
| 134 m_animation = nullptr; |
| 135 } |
| 128 | 136 |
| 129 double repeatedDuration() const; | 137 double repeatedDuration() const; |
| 130 | 138 |
| 131 virtual void updateChildrenAndEffects() const = 0; | 139 virtual void updateChildrenAndEffects() const = 0; |
| 132 virtual double intrinsicIterationDuration() const { return 0; } | 140 virtual double intrinsicIterationDuration() const { return 0; } |
| 133 virtual double calculateTimeToEffectChange(bool forwards, double localTime,
double timeToNextIteration) const = 0; | 141 virtual double calculateTimeToEffectChange(bool forwards, double localTime,
double timeToNextIteration) const = 0; |
| 134 virtual void specifiedTimingChanged() { } | 142 virtual void specifiedTimingChanged() { } |
| 135 | 143 |
| 136 Member<Animation> m_animation; | 144 Member<Animation> m_animation; |
| 137 Timing m_timing; | 145 Timing m_timing; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 152 mutable bool m_needsUpdate; | 160 mutable bool m_needsUpdate; |
| 153 mutable double m_lastUpdateTime; | 161 mutable double m_lastUpdateTime; |
| 154 String m_name; | 162 String m_name; |
| 155 | 163 |
| 156 const CalculatedTiming& ensureCalculated() const; | 164 const CalculatedTiming& ensureCalculated() const; |
| 157 }; | 165 }; |
| 158 | 166 |
| 159 } // namespace blink | 167 } // namespace blink |
| 160 | 168 |
| 161 #endif // AnimationEffect_h | 169 #endif // AnimationEffect_h |
| OLD | NEW |