| 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 | 106 |
| 107 CSSPropertyID id; | 107 CSSPropertyID id; |
| 108 RawPtrWillBeMember<const AnimatableValue> from; | 108 RawPtrWillBeMember<const AnimatableValue> from; |
| 109 RawPtrWillBeMember<const AnimatableValue> to; | 109 RawPtrWillBeMember<const AnimatableValue> to; |
| 110 RefPtr<InertAnimation> animation; | 110 RefPtr<InertAnimation> animation; |
| 111 }; | 111 }; |
| 112 typedef WillBePersistentHeapHashMap<CSSPropertyID, NewTransition> NewTransit
ionMap; | 112 typedef WillBePersistentHeapHashMap<CSSPropertyID, NewTransition> NewTransit
ionMap; |
| 113 const NewTransitionMap& newTransitions() const { return m_newTransitions; } | 113 const NewTransitionMap& newTransitions() const { return m_newTransitions; } |
| 114 const HashSet<CSSPropertyID>& cancelledTransitions() const { return m_cancel
ledTransitions; } | 114 const HashSet<CSSPropertyID>& cancelledTransitions() const { return m_cancel
ledTransitions; } |
| 115 | 115 |
| 116 void adoptActiveInterpolationsForAnimations(HashMap<CSSPropertyID, RefPtr<In
terpolation> >& newMap) { newMap.swap(m_activeInterpolationsForAnimations); } | 116 void adoptActiveInterpolationsForAnimations(WillBeHeapHashMap<CSSPropertyID,
RefPtrWillBeMember<Interpolation> >& newMap) { newMap.swap(m_activeInterpolatio
nsForAnimations); } |
| 117 void adoptActiveInterpolationsForTransitions(HashMap<CSSPropertyID, RefPtr<I
nterpolation> >& newMap) { newMap.swap(m_activeInterpolationsForTransitions); } | 117 void adoptActiveInterpolationsForTransitions(WillBeHeapHashMap<CSSPropertyID
, RefPtrWillBeMember<Interpolation> >& newMap) { newMap.swap(m_activeInterpolati
onsForTransitions); } |
| 118 const HashMap<CSSPropertyID, RefPtr<Interpolation> >& activeInterpolationsFo
rAnimations() const { return m_activeInterpolationsForAnimations; } | 118 const WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation> >&
activeInterpolationsForAnimations() const { return m_activeInterpolationsForAnim
ations; } |
| 119 const HashMap<CSSPropertyID, RefPtr<Interpolation> >& activeInterpolationsFo
rTransitions() const { return m_activeInterpolationsForTransitions; } | 119 const WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation> >&
activeInterpolationsForTransitions() const { return m_activeInterpolationsForTra
nsitions; } |
| 120 HashMap<CSSPropertyID, RefPtr<Interpolation> >& activeInterpolationsForAnima
tions() { return m_activeInterpolationsForAnimations; } | 120 WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation> >& active
InterpolationsForAnimations() { return m_activeInterpolationsForAnimations; } |
| 121 | 121 |
| 122 bool isEmpty() const | 122 bool isEmpty() const |
| 123 { | 123 { |
| 124 return m_newAnimations.isEmpty() | 124 return m_newAnimations.isEmpty() |
| 125 && m_cancelledAnimationNames.isEmpty() | 125 && m_cancelledAnimationNames.isEmpty() |
| 126 && m_cancelledAnimationAnimationPlayers.isEmpty() | 126 && m_cancelledAnimationAnimationPlayers.isEmpty() |
| 127 && m_animationsWithPauseToggled.isEmpty() | 127 && m_animationsWithPauseToggled.isEmpty() |
| 128 && m_newTransitions.isEmpty() | 128 && m_newTransitions.isEmpty() |
| 129 && m_cancelledTransitions.isEmpty() | 129 && m_cancelledTransitions.isEmpty() |
| 130 && m_activeInterpolationsForAnimations.isEmpty() | 130 && m_activeInterpolationsForAnimations.isEmpty() |
| 131 && m_activeInterpolationsForTransitions.isEmpty(); | 131 && m_activeInterpolationsForTransitions.isEmpty(); |
| 132 } | 132 } |
| 133 private: | 133 private: |
| 134 // Order is significant since it defines the order in which new animations | 134 // Order is significant since it defines the order in which new animations |
| 135 // will be started. Note that there may be multiple animations present | 135 // will be started. Note that there may be multiple animations present |
| 136 // with the same name, due to the way in which we split up animations with | 136 // with the same name, due to the way in which we split up animations with |
| 137 // incomplete keyframes. | 137 // incomplete keyframes. |
| 138 Vector<NewAnimation> m_newAnimations; | 138 Vector<NewAnimation> m_newAnimations; |
| 139 Vector<AtomicString> m_cancelledAnimationNames; | 139 Vector<AtomicString> m_cancelledAnimationNames; |
| 140 HashSet<const AnimationPlayer*> m_cancelledAnimationAnimationPlayers; | 140 HashSet<const AnimationPlayer*> m_cancelledAnimationAnimationPlayers; |
| 141 Vector<AtomicString> m_animationsWithPauseToggled; | 141 Vector<AtomicString> m_animationsWithPauseToggled; |
| 142 | 142 |
| 143 NewTransitionMap m_newTransitions; | 143 NewTransitionMap m_newTransitions; |
| 144 HashSet<CSSPropertyID> m_cancelledTransitions; | 144 HashSet<CSSPropertyID> m_cancelledTransitions; |
| 145 | 145 |
| 146 HashMap<CSSPropertyID, RefPtr<Interpolation> > m_activeInterpolationsForAnim
ations; | 146 WillBePersistentHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation>
> m_activeInterpolationsForAnimations; |
| 147 HashMap<CSSPropertyID, RefPtr<Interpolation> > m_activeInterpolationsForTran
sitions; | 147 WillBePersistentHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation>
> m_activeInterpolationsForTransitions; |
| 148 }; | 148 }; |
| 149 | 149 |
| 150 class CSSAnimations FINAL { | 150 class CSSAnimations FINAL { |
| 151 public: | 151 public: |
| 152 // FIXME: This method is only used here and in the legacy animations | 152 // FIXME: This method is only used here and in the legacy animations |
| 153 // implementation. It should be made private or file-scope when the legacy | 153 // implementation. It should be made private or file-scope when the legacy |
| 154 // engine is removed. | 154 // engine is removed. |
| 155 static const StyleRuleKeyframes* matchScopedKeyframesRule(StyleResolver*, co
nst Element*, const StringImpl*); | 155 static const StyleRuleKeyframes* matchScopedKeyframesRule(StyleResolver*, co
nst Element*, const StringImpl*); |
| 156 | 156 |
| 157 static bool isAnimatableProperty(CSSPropertyID); | 157 static bool isAnimatableProperty(CSSPropertyID); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 182 | 182 |
| 183 Animation* transition; // The TransitionTimeline keeps the AnimationPlay
ers alive | 183 Animation* transition; // The TransitionTimeline keeps the AnimationPlay
ers alive |
| 184 RawPtrWillBeMember<const AnimatableValue> from; | 184 RawPtrWillBeMember<const AnimatableValue> from; |
| 185 RawPtrWillBeMember<const AnimatableValue> to; | 185 RawPtrWillBeMember<const AnimatableValue> to; |
| 186 }; | 186 }; |
| 187 typedef WillBePersistentHeapHashMap<CSSPropertyID, RunningTransition> Transi
tionMap; | 187 typedef WillBePersistentHeapHashMap<CSSPropertyID, RunningTransition> Transi
tionMap; |
| 188 AnimationMap m_animations; | 188 AnimationMap m_animations; |
| 189 TransitionMap m_transitions; | 189 TransitionMap m_transitions; |
| 190 OwnPtr<CSSAnimationUpdate> m_pendingUpdate; | 190 OwnPtr<CSSAnimationUpdate> m_pendingUpdate; |
| 191 | 191 |
| 192 HashMap<CSSPropertyID, RefPtr<Interpolation> > m_previousActiveInterpolation
sForAnimations; | 192 WillBePersistentHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation>
> m_previousActiveInterpolationsForAnimations; |
| 193 | 193 |
| 194 static void calculateAnimationUpdate(CSSAnimationUpdate*, Element*, const El
ement& parentElement, const RenderStyle&, RenderStyle* parentStyle, StyleResolve
r*); | 194 static void calculateAnimationUpdate(CSSAnimationUpdate*, Element*, const El
ement& parentElement, const RenderStyle&, RenderStyle* parentStyle, StyleResolve
r*); |
| 195 static void calculateTransitionUpdate(CSSAnimationUpdate*, const Element*, c
onst RenderStyle&); | 195 static void calculateTransitionUpdate(CSSAnimationUpdate*, const Element*, c
onst RenderStyle&); |
| 196 static void calculateTransitionUpdateForProperty(CSSPropertyID, const CSSAni
mationData*, const RenderStyle& oldStyle, const RenderStyle&, const TransitionMa
p* activeTransitions, CSSAnimationUpdate*, const Element*); | 196 static void calculateTransitionUpdateForProperty(CSSPropertyID, const CSSAni
mationData*, const RenderStyle& oldStyle, const RenderStyle&, const TransitionMa
p* activeTransitions, CSSAnimationUpdate*, const Element*); |
| 197 | 197 |
| 198 static void calculateAnimationActiveInterpolations(CSSAnimationUpdate*, cons
t Element*); | 198 static void calculateAnimationActiveInterpolations(CSSAnimationUpdate*, cons
t Element*); |
| 199 static void calculateTransitionActiveInterpolations(CSSAnimationUpdate*, con
st Element*); | 199 static void calculateTransitionActiveInterpolations(CSSAnimationUpdate*, con
st Element*); |
| 200 | 200 |
| 201 class AnimationEventDelegate FINAL : public TimedItem::EventDelegate { | 201 class AnimationEventDelegate FINAL : public TimedItem::EventDelegate { |
| 202 public: | 202 public: |
| (...skipping 19 matching lines...) Expand all Loading... |
| 222 virtual void onEventCondition(const TimedItem*, bool isFirstSample, Time
dItem::Phase previousPhase, double previousIteration) OVERRIDE; | 222 virtual void onEventCondition(const TimedItem*, bool isFirstSample, Time
dItem::Phase previousPhase, double previousIteration) OVERRIDE; |
| 223 private: | 223 private: |
| 224 Element* m_target; | 224 Element* m_target; |
| 225 const CSSPropertyID m_property; | 225 const CSSPropertyID m_property; |
| 226 }; | 226 }; |
| 227 }; | 227 }; |
| 228 | 228 |
| 229 } // namespace WebCore | 229 } // namespace WebCore |
| 230 | 230 |
| 231 #endif | 231 #endif |
| OLD | NEW |