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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 class UpdatedAnimationStyle { | 94 class UpdatedAnimationStyle { |
95 ALLOW_ONLY_INLINE_ALLOCATION(); | 95 ALLOW_ONLY_INLINE_ALLOCATION(); |
96 public: | 96 public: |
97 struct CompositableStyleSnapshot { | 97 struct CompositableStyleSnapshot { |
98 DISALLOW_ALLOCATION(); | 98 DISALLOW_ALLOCATION(); |
99 | 99 |
100 public: | 100 public: |
101 RefPtrWillBeMember<AnimatableValue> opacity; | 101 RefPtrWillBeMember<AnimatableValue> opacity; |
102 RefPtrWillBeMember<AnimatableValue> transform; | 102 RefPtrWillBeMember<AnimatableValue> transform; |
103 RefPtrWillBeMember<AnimatableValue> webkitFilter; | 103 RefPtrWillBeMember<AnimatableValue> webkitFilter; |
| 104 RefPtrWillBeMember<AnimatableValue> backdropFilter; |
104 | 105 |
105 DEFINE_INLINE_TRACE() | 106 DEFINE_INLINE_TRACE() |
106 { | 107 { |
107 visitor->trace(opacity); | 108 visitor->trace(opacity); |
108 visitor->trace(transform); | 109 visitor->trace(transform); |
109 visitor->trace(webkitFilter); | 110 visitor->trace(webkitFilter); |
| 111 visitor->trace(backdropFilter); |
110 } | 112 } |
111 }; | 113 }; |
112 | 114 |
113 UpdatedAnimationStyle() | 115 UpdatedAnimationStyle() |
114 { | 116 { |
115 } | 117 } |
116 | 118 |
117 UpdatedAnimationStyle(Animation* animation, KeyframeEffectModelBase* mod
el, const UpdatedAnimationStyle::CompositableStyleSnapshot& snapshot) | 119 UpdatedAnimationStyle(Animation* animation, KeyframeEffectModelBase* mod
el, const UpdatedAnimationStyle::CompositableStyleSnapshot& snapshot) |
118 : animation(animation) | 120 : animation(animation) |
119 , model(model) | 121 , model(model) |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 { | 203 { |
202 UpdatedAnimationStyle::CompositableStyleSnapshot snapshot; | 204 UpdatedAnimationStyle::CompositableStyleSnapshot snapshot; |
203 if (layoutObject) { | 205 if (layoutObject) { |
204 const ComputedStyle& oldStyle = layoutObject->styleRef(); | 206 const ComputedStyle& oldStyle = layoutObject->styleRef(); |
205 if (!CSSPropertyEquality::propertiesEqual(CSSPropertyOpacity, oldSty
le, newStyle) && model->affects(PropertyHandle(CSSPropertyOpacity))) | 207 if (!CSSPropertyEquality::propertiesEqual(CSSPropertyOpacity, oldSty
le, newStyle) && model->affects(PropertyHandle(CSSPropertyOpacity))) |
206 snapshot.opacity = CSSAnimatableValueFactory::create(CSSProperty
Opacity, newStyle); | 208 snapshot.opacity = CSSAnimatableValueFactory::create(CSSProperty
Opacity, newStyle); |
207 if (!CSSPropertyEquality::propertiesEqual(CSSPropertyTransform, oldS
tyle, newStyle) && model->affects(PropertyHandle(CSSPropertyTransform))) | 209 if (!CSSPropertyEquality::propertiesEqual(CSSPropertyTransform, oldS
tyle, newStyle) && model->affects(PropertyHandle(CSSPropertyTransform))) |
208 snapshot.transform = CSSAnimatableValueFactory::create(CSSProper
tyTransform, newStyle); | 210 snapshot.transform = CSSAnimatableValueFactory::create(CSSProper
tyTransform, newStyle); |
209 if (!CSSPropertyEquality::propertiesEqual(CSSPropertyWebkitFilter, o
ldStyle, newStyle) && model->affects(PropertyHandle(CSSPropertyWebkitFilter))) | 211 if (!CSSPropertyEquality::propertiesEqual(CSSPropertyWebkitFilter, o
ldStyle, newStyle) && model->affects(PropertyHandle(CSSPropertyWebkitFilter))) |
210 snapshot.webkitFilter = CSSAnimatableValueFactory::create(CSSPro
pertyWebkitFilter, newStyle); | 212 snapshot.webkitFilter = CSSAnimatableValueFactory::create(CSSPro
pertyWebkitFilter, newStyle); |
| 213 if (!CSSPropertyEquality::propertiesEqual(CSSPropertyBackdropFilter,
oldStyle, newStyle) && model->affects(PropertyHandle(CSSPropertyBackdropFilter)
)) |
| 214 snapshot.backdropFilter = CSSAnimatableValueFactory::create(CSSP
ropertyBackdropFilter, newStyle); |
211 } | 215 } |
212 | 216 |
213 m_animationsWithStyleUpdates.append(UpdatedAnimationStyle(animation, mod
el, snapshot)); | 217 m_animationsWithStyleUpdates.append(UpdatedAnimationStyle(animation, mod
el, snapshot)); |
214 } | 218 } |
215 | 219 |
216 void startTransition(CSSPropertyID id, const AnimatableValue* from, const An
imatableValue* to, PassRefPtrWillBeRawPtr<InertEffect> effect) | 220 void startTransition(CSSPropertyID id, const AnimatableValue* from, const An
imatableValue* to, PassRefPtrWillBeRawPtr<InertEffect> effect) |
217 { | 221 { |
218 effect->setName(getPropertyName(id)); | 222 effect->setName(getPropertyName(id)); |
219 NewTransition newTransition; | 223 NewTransition newTransition; |
220 newTransition.id = id; | 224 newTransition.id = id; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 ActiveInterpolationMap m_activeInterpolationsForTransitions; | 312 ActiveInterpolationMap m_activeInterpolationsForTransitions; |
309 }; | 313 }; |
310 | 314 |
311 } // namespace blink | 315 } // namespace blink |
312 | 316 |
313 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::NewAnimation); | 317 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::NewAnimation); |
314 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::UpdatedAnimation); | 318 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::UpdatedAnimation); |
315 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::UpdatedAnimationSty
le); | 319 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::UpdatedAnimationSty
le); |
316 | 320 |
317 #endif | 321 #endif |
OLD | NEW |