| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CSSAnimationUpdate_h | 5 #ifndef CSSAnimationUpdate_h |
| 6 #define CSSAnimationUpdate_h | 6 #define CSSAnimationUpdate_h |
| 7 | 7 |
| 8 #include "core/animation/AnimationStack.h" | 8 #include "core/animation/AnimationStack.h" |
| 9 #include "core/animation/InertEffect.h" | 9 #include "core/animation/InertEffect.h" |
| 10 #include "core/animation/Interpolation.h" | 10 #include "core/animation/Interpolation.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 // This class stores the CSS Animations/Transitions information we use during a
style recalc. | 25 // This class stores the CSS Animations/Transitions information we use during a
style recalc. |
| 26 // This includes updates to animations/transitions as well as the Interpolations
to be applied. | 26 // This includes updates to animations/transitions as well as the Interpolations
to be applied. |
| 27 class CSSAnimationUpdate final { | 27 class CSSAnimationUpdate final { |
| 28 DISALLOW_NEW(); | 28 DISALLOW_NEW(); |
| 29 WTF_MAKE_NONCOPYABLE(CSSAnimationUpdate); | 29 WTF_MAKE_NONCOPYABLE(CSSAnimationUpdate); |
| 30 public: | 30 public: |
| 31 class NewAnimation { | 31 class NewAnimation { |
| 32 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 32 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 33 public: | 33 public: |
| 34 NewAnimation(AtomicString name, size_t nameIndex, const InertEffect& eff
ect, Timing timing, PassRefPtrWillBeRawPtr<StyleRuleKeyframes> styleRule) | 34 NewAnimation(AtomicString name, size_t nameIndex, const InertEffect& eff
ect, Timing timing, RawPtr<StyleRuleKeyframes> styleRule) |
| 35 : name(name) | 35 : name(name) |
| 36 , nameIndex(nameIndex) | 36 , nameIndex(nameIndex) |
| 37 , effect(effect) | 37 , effect(effect) |
| 38 , timing(timing) | 38 , timing(timing) |
| 39 , styleRule(styleRule) | 39 , styleRule(styleRule) |
| 40 , styleRuleVersion(this->styleRule->version()) | 40 , styleRuleVersion(this->styleRule->version()) |
| 41 { | 41 { |
| 42 } | 42 } |
| 43 | 43 |
| 44 DEFINE_INLINE_TRACE() | 44 DEFINE_INLINE_TRACE() |
| 45 { | 45 { |
| 46 visitor->trace(effect); | 46 visitor->trace(effect); |
| 47 visitor->trace(styleRule); | 47 visitor->trace(styleRule); |
| 48 } | 48 } |
| 49 | 49 |
| 50 AtomicString name; | 50 AtomicString name; |
| 51 size_t nameIndex; | 51 size_t nameIndex; |
| 52 Member<const InertEffect> effect; | 52 Member<const InertEffect> effect; |
| 53 Timing timing; | 53 Timing timing; |
| 54 RefPtrWillBeMember<StyleRuleKeyframes> styleRule; | 54 Member<StyleRuleKeyframes> styleRule; |
| 55 unsigned styleRuleVersion; | 55 unsigned styleRuleVersion; |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 class UpdatedAnimation { | 58 class UpdatedAnimation { |
| 59 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 59 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 60 public: | 60 public: |
| 61 UpdatedAnimation(size_t index, Animation* animation, const InertEffect&
effect, Timing specifiedTiming, PassRefPtrWillBeRawPtr<StyleRuleKeyframes> style
Rule) | 61 UpdatedAnimation(size_t index, Animation* animation, const InertEffect&
effect, Timing specifiedTiming, RawPtr<StyleRuleKeyframes> styleRule) |
| 62 : index(index) | 62 : index(index) |
| 63 , animation(animation) | 63 , animation(animation) |
| 64 , effect(&effect) | 64 , effect(&effect) |
| 65 , specifiedTiming(specifiedTiming) | 65 , specifiedTiming(specifiedTiming) |
| 66 , styleRule(styleRule) | 66 , styleRule(styleRule) |
| 67 , styleRuleVersion(this->styleRule->version()) | 67 , styleRuleVersion(this->styleRule->version()) |
| 68 { | 68 { |
| 69 } | 69 } |
| 70 | 70 |
| 71 DEFINE_INLINE_TRACE() | 71 DEFINE_INLINE_TRACE() |
| 72 { | 72 { |
| 73 visitor->trace(animation); | 73 visitor->trace(animation); |
| 74 visitor->trace(effect); | 74 visitor->trace(effect); |
| 75 visitor->trace(styleRule); | 75 visitor->trace(styleRule); |
| 76 } | 76 } |
| 77 | 77 |
| 78 size_t index; | 78 size_t index; |
| 79 Member<Animation> animation; | 79 Member<Animation> animation; |
| 80 Member<const InertEffect> effect; | 80 Member<const InertEffect> effect; |
| 81 Timing specifiedTiming; | 81 Timing specifiedTiming; |
| 82 RefPtrWillBeMember<StyleRuleKeyframes> styleRule; | 82 Member<StyleRuleKeyframes> styleRule; |
| 83 unsigned styleRuleVersion; | 83 unsigned styleRuleVersion; |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 CSSAnimationUpdate() | 86 CSSAnimationUpdate() |
| 87 { | 87 { |
| 88 } | 88 } |
| 89 | 89 |
| 90 ~CSSAnimationUpdate() | 90 ~CSSAnimationUpdate() |
| 91 { | 91 { |
| 92 } | 92 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 113 m_newTransitions.clear(); | 113 m_newTransitions.clear(); |
| 114 m_activeInterpolationsForAnimations.clear(); | 114 m_activeInterpolationsForAnimations.clear(); |
| 115 m_activeInterpolationsForTransitions.clear(); | 115 m_activeInterpolationsForTransitions.clear(); |
| 116 m_cancelledAnimationIndices.clear(); | 116 m_cancelledAnimationIndices.clear(); |
| 117 m_animationIndicesWithPauseToggled.clear(); | 117 m_animationIndicesWithPauseToggled.clear(); |
| 118 m_cancelledTransitions.clear(); | 118 m_cancelledTransitions.clear(); |
| 119 m_finishedTransitions.clear(); | 119 m_finishedTransitions.clear(); |
| 120 m_updatedCompositorKeyframes.clear(); | 120 m_updatedCompositorKeyframes.clear(); |
| 121 } | 121 } |
| 122 | 122 |
| 123 void startAnimation(const AtomicString& animationName, size_t nameIndex, con
st InertEffect& effect, const Timing& timing, PassRefPtrWillBeRawPtr<StyleRuleKe
yframes> styleRule) | 123 void startAnimation(const AtomicString& animationName, size_t nameIndex, con
st InertEffect& effect, const Timing& timing, RawPtr<StyleRuleKeyframes> styleRu
le) |
| 124 { | 124 { |
| 125 m_newAnimations.append(NewAnimation(animationName, nameIndex, effect, ti
ming, styleRule)); | 125 m_newAnimations.append(NewAnimation(animationName, nameIndex, effect, ti
ming, styleRule)); |
| 126 } | 126 } |
| 127 // Returns whether animation has been suppressed and should be filtered duri
ng style application. | 127 // Returns whether animation has been suppressed and should be filtered duri
ng style application. |
| 128 bool isSuppressedAnimation(const Animation* animation) const { return m_supp
ressedAnimations.contains(animation); } | 128 bool isSuppressedAnimation(const Animation* animation) const { return m_supp
ressedAnimations.contains(animation); } |
| 129 void cancelAnimation(size_t index, const Animation& animation) | 129 void cancelAnimation(size_t index, const Animation& animation) |
| 130 { | 130 { |
| 131 m_cancelledAnimationIndices.append(index); | 131 m_cancelledAnimationIndices.append(index); |
| 132 m_suppressedAnimations.add(&animation); | 132 m_suppressedAnimations.add(&animation); |
| 133 } | 133 } |
| 134 void toggleAnimationIndexPaused(size_t index) | 134 void toggleAnimationIndexPaused(size_t index) |
| 135 { | 135 { |
| 136 m_animationIndicesWithPauseToggled.append(index); | 136 m_animationIndicesWithPauseToggled.append(index); |
| 137 } | 137 } |
| 138 void updateAnimation(size_t index, Animation* animation, const InertEffect&
effect, const Timing& specifiedTiming, | 138 void updateAnimation(size_t index, Animation* animation, const InertEffect&
effect, const Timing& specifiedTiming, |
| 139 PassRefPtrWillBeRawPtr<StyleRuleKeyframes> styleRule) | 139 RawPtr<StyleRuleKeyframes> styleRule) |
| 140 { | 140 { |
| 141 m_animationsWithUpdates.append(UpdatedAnimation(index, animation, effect
, specifiedTiming, styleRule)); | 141 m_animationsWithUpdates.append(UpdatedAnimation(index, animation, effect
, specifiedTiming, styleRule)); |
| 142 m_suppressedAnimations.add(animation); | 142 m_suppressedAnimations.add(animation); |
| 143 } | 143 } |
| 144 void updateCompositorKeyframes(Animation* animation) | 144 void updateCompositorKeyframes(Animation* animation) |
| 145 { | 145 { |
| 146 m_updatedCompositorKeyframes.append(animation); | 146 m_updatedCompositorKeyframes.append(animation); |
| 147 } | 147 } |
| 148 | 148 |
| 149 void startTransition(CSSPropertyID id, const AnimatableValue* from, const An
imatableValue* to, PassRefPtr<AnimatableValue> reversingAdjustedStartValue, doub
le reversingShorteningFactor, const InertEffect& effect) | 149 void startTransition(CSSPropertyID id, const AnimatableValue* from, const An
imatableValue* to, PassRefPtr<AnimatableValue> reversingAdjustedStartValue, doub
le reversingShorteningFactor, const InertEffect& effect) |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 | 239 |
| 240 friend class PendingAnimationUpdate; | 240 friend class PendingAnimationUpdate; |
| 241 }; | 241 }; |
| 242 | 242 |
| 243 } // namespace blink | 243 } // namespace blink |
| 244 | 244 |
| 245 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::NewAnimation); | 245 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::NewAnimation); |
| 246 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::UpdatedAnimation); | 246 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::UpdatedAnimation); |
| 247 | 247 |
| 248 #endif | 248 #endif |
| OLD | NEW |