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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 { | 72 { |
73 m_pendingUpdate.clear(); | 73 m_pendingUpdate.clear(); |
74 } | 74 } |
75 void maybeApplyPendingUpdate(Element*); | 75 void maybeApplyPendingUpdate(Element*); |
76 bool isEmpty() const { return m_animations.isEmpty() && m_transitions.isEmpt
y() && m_pendingUpdate.isEmpty(); } | 76 bool isEmpty() const { return m_animations.isEmpty() && m_transitions.isEmpt
y() && m_pendingUpdate.isEmpty(); } |
77 void cancel(); | 77 void cancel(); |
78 | 78 |
79 DECLARE_TRACE(); | 79 DECLARE_TRACE(); |
80 | 80 |
81 private: | 81 private: |
82 class RunningAnimation final : public RefCountedWillBeGarbageCollectedFinali
zed<RunningAnimation> { | 82 class RunningAnimation final : public GarbageCollectedFinalized<RunningAnima
tion> { |
83 public: | 83 public: |
84 RunningAnimation(PassRefPtrWillBeRawPtr<Animation> animation, CSSAnimati
onUpdate::NewAnimation newAnimation) | 84 RunningAnimation(Animation* animation, CSSAnimationUpdate::NewAnimation
newAnimation) |
85 : animation(animation) | 85 : animation(animation) |
86 , specifiedTiming(newAnimation.timing) | 86 , specifiedTiming(newAnimation.timing) |
87 , styleRule(newAnimation.styleRule) | 87 , styleRule(newAnimation.styleRule) |
88 , styleRuleVersion(newAnimation.styleRuleVersion) | 88 , styleRuleVersion(newAnimation.styleRuleVersion) |
89 { | 89 { |
90 } | 90 } |
91 | 91 |
92 void update(CSSAnimationUpdate::UpdatedAnimation update) | 92 void update(CSSAnimationUpdate::UpdatedAnimation update) |
93 { | 93 { |
94 styleRule = update.styleRule; | 94 styleRule = update.styleRule; |
95 styleRuleVersion = update.styleRuleVersion; | 95 styleRuleVersion = update.styleRuleVersion; |
96 specifiedTiming = update.specifiedTiming; | 96 specifiedTiming = update.specifiedTiming; |
97 } | 97 } |
98 | 98 |
99 DEFINE_INLINE_TRACE() | 99 DEFINE_INLINE_TRACE() |
100 { | 100 { |
101 visitor->trace(animation); | 101 visitor->trace(animation); |
102 visitor->trace(styleRule); | 102 visitor->trace(styleRule); |
103 } | 103 } |
104 | 104 |
105 RefPtrWillBeMember<Animation> animation; | 105 Member<Animation> animation; |
106 Timing specifiedTiming; | 106 Timing specifiedTiming; |
107 RefPtrWillBeMember<StyleRuleKeyframes> styleRule; | 107 RefPtrWillBeMember<StyleRuleKeyframes> styleRule; |
108 unsigned styleRuleVersion; | 108 unsigned styleRuleVersion; |
109 }; | 109 }; |
110 | 110 |
111 struct RunningTransition { | 111 struct RunningTransition { |
112 ALLOW_ONLY_INLINE_ALLOCATION(); | 112 ALLOW_ONLY_INLINE_ALLOCATION(); |
113 public: | 113 public: |
114 DEFINE_INLINE_TRACE() | 114 DEFINE_INLINE_TRACE() |
115 { | 115 { |
116 visitor->trace(animation); | 116 visitor->trace(animation); |
117 visitor->trace(from); | 117 visitor->trace(from); |
118 visitor->trace(to); | 118 visitor->trace(to); |
119 } | 119 } |
120 | 120 |
121 RefPtrWillBeMember<Animation> animation; | 121 Member<Animation> animation; |
122 RawPtrWillBeMember<const AnimatableValue> from; | 122 RawPtrWillBeMember<const AnimatableValue> from; |
123 RawPtrWillBeMember<const AnimatableValue> to; | 123 RawPtrWillBeMember<const AnimatableValue> to; |
124 }; | 124 }; |
125 | 125 |
126 using AnimationMap = WillBeHeapHashMap<AtomicString, RefPtrWillBeMember<Runn
ingAnimation>>; | 126 using AnimationMap = HeapHashMap<AtomicString, Member<RunningAnimation>>; |
127 AnimationMap m_animations; | 127 AnimationMap m_animations; |
128 | 128 |
129 using TransitionMap = WillBeHeapHashMap<CSSPropertyID, RunningTransition>; | 129 using TransitionMap = HeapHashMap<CSSPropertyID, RunningTransition>; |
130 TransitionMap m_transitions; | 130 TransitionMap m_transitions; |
131 | 131 |
132 CSSAnimationUpdate m_pendingUpdate; | 132 CSSAnimationUpdate m_pendingUpdate; |
133 | 133 |
134 ActiveInterpolationMap m_previousActiveInterpolationsForAnimations; | 134 ActiveInterpolationMap m_previousActiveInterpolationsForAnimations; |
135 | 135 |
136 static void calculateAnimationUpdate(CSSAnimationUpdate&, const Element* ani
matingElement, Element&, const ComputedStyle&, ComputedStyle* parentStyle, Style
Resolver*); | 136 static void calculateAnimationUpdate(CSSAnimationUpdate&, const Element* ani
matingElement, Element&, const ComputedStyle&, ComputedStyle* parentStyle, Style
Resolver*); |
137 static void calculateTransitionUpdate(CSSAnimationUpdate&, const Element* an
imatingElement, const ComputedStyle&); | 137 static void calculateTransitionUpdate(CSSAnimationUpdate&, const Element* an
imatingElement, const ComputedStyle&); |
138 static void calculateTransitionUpdateForProperty(CSSPropertyID, const CSSTra
nsitionData&, size_t transitionIndex, const ComputedStyle& oldStyle, const Compu
tedStyle&, const TransitionMap* activeTransitions, CSSAnimationUpdate&, const El
ement*); | 138 static void calculateTransitionUpdateForProperty(CSSPropertyID, const CSSTra
nsitionData&, size_t transitionIndex, const ComputedStyle& oldStyle, const Compu
tedStyle&, const TransitionMap* activeTransitions, CSSAnimationUpdate&, const El
ement*); |
139 | 139 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 185 |
186 RawPtrWillBeMember<Element> m_transitionTarget; | 186 RawPtrWillBeMember<Element> m_transitionTarget; |
187 const CSSPropertyID m_property; | 187 const CSSPropertyID m_property; |
188 AnimationEffect::Phase m_previousPhase; | 188 AnimationEffect::Phase m_previousPhase; |
189 }; | 189 }; |
190 }; | 190 }; |
191 | 191 |
192 } // namespace blink | 192 } // namespace blink |
193 | 193 |
194 #endif | 194 #endif |
OLD | NEW |