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/Interpolation.h" | 8 #include "core/animation/Interpolation.h" |
9 #include "core/animation/KeyframeEffectModel.h" | 9 #include "core/animation/KeyframeEffectModel.h" |
10 #include "core/animation/css/CSSAnimatableValueFactory.h" | 10 #include "core/animation/css/CSSAnimatableValueFactory.h" |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 void toggleAnimationPaused(const AtomicString& name) | 144 void toggleAnimationPaused(const AtomicString& name) |
145 { | 145 { |
146 m_animationsWithPauseToggled.append(name); | 146 m_animationsWithPauseToggled.append(name); |
147 } | 147 } |
148 void updateAnimation(const AtomicString& name, AnimationPlayer* player, Pass
RefPtrWillBeRawPtr<InertAnimation> animation, const Timing& specifiedTiming, | 148 void updateAnimation(const AtomicString& name, AnimationPlayer* player, Pass
RefPtrWillBeRawPtr<InertAnimation> animation, const Timing& specifiedTiming, |
149 PassRefPtrWillBeRawPtr<StyleRuleKeyframes> styleRule) | 149 PassRefPtrWillBeRawPtr<StyleRuleKeyframes> styleRule) |
150 { | 150 { |
151 m_animationsWithUpdates.append(UpdatedAnimation(name, player, animation,
specifiedTiming, styleRule)); | 151 m_animationsWithUpdates.append(UpdatedAnimation(name, player, animation,
specifiedTiming, styleRule)); |
152 m_suppressedAnimationPlayers.add(player); | 152 m_suppressedAnimationPlayers.add(player); |
153 } | 153 } |
154 void updateAnimationStyle(AnimationPlayer* player, KeyframeEffectModelBase*
effect, LayoutObject* renderer, const LayoutStyle& newStyle) | 154 void updateAnimationStyle(AnimationPlayer* player, KeyframeEffectModelBase*
effect, LayoutObject* renderer, const ComputedStyle& newStyle) |
155 { | 155 { |
156 UpdatedAnimationStyle::CompositableStyleSnapshot snapshot; | 156 UpdatedAnimationStyle::CompositableStyleSnapshot snapshot; |
157 if (renderer) { | 157 if (renderer) { |
158 const LayoutStyle& oldStyle = renderer->styleRef(); | 158 const ComputedStyle& oldStyle = renderer->styleRef(); |
159 if (!CSSPropertyEquality::propertiesEqual(CSSPropertyOpacity, oldSty
le, newStyle) && effect->affects(CSSPropertyOpacity)) | 159 if (!CSSPropertyEquality::propertiesEqual(CSSPropertyOpacity, oldSty
le, newStyle) && effect->affects(CSSPropertyOpacity)) |
160 snapshot.opacity = CSSAnimatableValueFactory::create(CSSProperty
Opacity, newStyle); | 160 snapshot.opacity = CSSAnimatableValueFactory::create(CSSProperty
Opacity, newStyle); |
161 if (!CSSPropertyEquality::propertiesEqual(CSSPropertyTransform, oldS
tyle, newStyle) && effect->affects(CSSPropertyTransform)) | 161 if (!CSSPropertyEquality::propertiesEqual(CSSPropertyTransform, oldS
tyle, newStyle) && effect->affects(CSSPropertyTransform)) |
162 snapshot.transform = CSSAnimatableValueFactory::create(CSSProper
tyTransform, newStyle); | 162 snapshot.transform = CSSAnimatableValueFactory::create(CSSProper
tyTransform, newStyle); |
163 if (!CSSPropertyEquality::propertiesEqual(CSSPropertyWebkitFilter, o
ldStyle, newStyle) && effect->affects(CSSPropertyWebkitFilter)) | 163 if (!CSSPropertyEquality::propertiesEqual(CSSPropertyWebkitFilter, o
ldStyle, newStyle) && effect->affects(CSSPropertyWebkitFilter)) |
164 snapshot.webkitFilter = CSSAnimatableValueFactory::create(CSSPro
pertyWebkitFilter, newStyle); | 164 snapshot.webkitFilter = CSSAnimatableValueFactory::create(CSSPro
pertyWebkitFilter, newStyle); |
165 } | 165 } |
166 | 166 |
167 m_animationsWithStyleUpdates.append(UpdatedAnimationStyle(player, effect
, snapshot)); | 167 m_animationsWithStyleUpdates.append(UpdatedAnimationStyle(player, effect
, snapshot)); |
168 } | 168 } |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation>> m_active
InterpolationsForAnimations; | 252 WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation>> m_active
InterpolationsForAnimations; |
253 WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation>> m_active
InterpolationsForTransitions; | 253 WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation>> m_active
InterpolationsForTransitions; |
254 }; | 254 }; |
255 | 255 |
256 } // namespace blink | 256 } // namespace blink |
257 | 257 |
258 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::NewAnimation); | 258 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::NewAnimation); |
259 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::UpdatedAnimation); | 259 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::UpdatedAnimation); |
260 | 260 |
261 #endif | 261 #endif |
OLD | NEW |