Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(514)

Side by Side Diff: Source/core/animation/css/CSSAnimationUpdate.h

Issue 1299323005: blink: Add backdrop-filter support (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: removed some todos Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/Interpolation.h" 9 #include "core/animation/Interpolation.h"
10 #include "core/animation/KeyframeEffectModel.h" 10 #include "core/animation/KeyframeEffectModel.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 class UpdatedAnimationStyle { 96 class UpdatedAnimationStyle {
97 ALLOW_ONLY_INLINE_ALLOCATION(); 97 ALLOW_ONLY_INLINE_ALLOCATION();
98 public: 98 public:
99 struct CompositableStyleSnapshot { 99 struct CompositableStyleSnapshot {
100 DISALLOW_ALLOCATION(); 100 DISALLOW_ALLOCATION();
101 101
102 public: 102 public:
103 RefPtrWillBeMember<AnimatableValue> opacity; 103 RefPtrWillBeMember<AnimatableValue> opacity;
104 RefPtrWillBeMember<AnimatableValue> transform; 104 RefPtrWillBeMember<AnimatableValue> transform;
105 RefPtrWillBeMember<AnimatableValue> webkitFilter; 105 RefPtrWillBeMember<AnimatableValue> webkitFilter;
106 RefPtrWillBeMember<AnimatableValue> backdropFilter;
106 107
107 DEFINE_INLINE_TRACE() 108 DEFINE_INLINE_TRACE()
108 { 109 {
109 visitor->trace(opacity); 110 visitor->trace(opacity);
110 visitor->trace(transform); 111 visitor->trace(transform);
111 visitor->trace(webkitFilter); 112 visitor->trace(webkitFilter);
113 visitor->trace(backdropFilter);
112 } 114 }
113 }; 115 };
114 116
115 UpdatedAnimationStyle() 117 UpdatedAnimationStyle()
116 { 118 {
117 } 119 }
118 120
119 UpdatedAnimationStyle(Animation* animation, KeyframeEffectModelBase* mod el, const UpdatedAnimationStyle::CompositableStyleSnapshot& snapshot) 121 UpdatedAnimationStyle(Animation* animation, KeyframeEffectModelBase* mod el, const UpdatedAnimationStyle::CompositableStyleSnapshot& snapshot)
120 : animation(animation) 122 : animation(animation)
121 , model(model) 123 , model(model)
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 { 163 {
162 UpdatedAnimationStyle::CompositableStyleSnapshot snapshot; 164 UpdatedAnimationStyle::CompositableStyleSnapshot snapshot;
163 if (layoutObject) { 165 if (layoutObject) {
164 const ComputedStyle& oldStyle = layoutObject->styleRef(); 166 const ComputedStyle& oldStyle = layoutObject->styleRef();
165 if (!CSSPropertyEquality::propertiesEqual(CSSPropertyOpacity, oldSty le, newStyle) && model->affects(PropertyHandle(CSSPropertyOpacity))) 167 if (!CSSPropertyEquality::propertiesEqual(CSSPropertyOpacity, oldSty le, newStyle) && model->affects(PropertyHandle(CSSPropertyOpacity)))
166 snapshot.opacity = CSSAnimatableValueFactory::create(CSSProperty Opacity, newStyle); 168 snapshot.opacity = CSSAnimatableValueFactory::create(CSSProperty Opacity, newStyle);
167 if (!CSSPropertyEquality::propertiesEqual(CSSPropertyTransform, oldS tyle, newStyle) && model->affects(PropertyHandle(CSSPropertyTransform))) 169 if (!CSSPropertyEquality::propertiesEqual(CSSPropertyTransform, oldS tyle, newStyle) && model->affects(PropertyHandle(CSSPropertyTransform)))
168 snapshot.transform = CSSAnimatableValueFactory::create(CSSProper tyTransform, newStyle); 170 snapshot.transform = CSSAnimatableValueFactory::create(CSSProper tyTransform, newStyle);
169 if (!CSSPropertyEquality::propertiesEqual(CSSPropertyWebkitFilter, o ldStyle, newStyle) && model->affects(PropertyHandle(CSSPropertyWebkitFilter))) 171 if (!CSSPropertyEquality::propertiesEqual(CSSPropertyWebkitFilter, o ldStyle, newStyle) && model->affects(PropertyHandle(CSSPropertyWebkitFilter)))
170 snapshot.webkitFilter = CSSAnimatableValueFactory::create(CSSPro pertyWebkitFilter, newStyle); 172 snapshot.webkitFilter = CSSAnimatableValueFactory::create(CSSPro pertyWebkitFilter, newStyle);
173 if (!CSSPropertyEquality::propertiesEqual(CSSPropertyBackdropFilter, oldStyle, newStyle) && model->affects(PropertyHandle(CSSPropertyBackdropFilter) ))
174 snapshot.backdropFilter = CSSAnimatableValueFactory::create(CSSP ropertyBackdropFilter, newStyle);
171 } 175 }
172 176
173 m_animationsWithStyleUpdates.append(UpdatedAnimationStyle(animation, mod el, snapshot)); 177 m_animationsWithStyleUpdates.append(UpdatedAnimationStyle(animation, mod el, snapshot));
174 } 178 }
175 179
176 void startTransition(CSSPropertyID id, const AnimatableValue* from, const An imatableValue* to, PassRefPtrWillBeRawPtr<InertEffect> effect) 180 void startTransition(CSSPropertyID id, const AnimatableValue* from, const An imatableValue* to, PassRefPtrWillBeRawPtr<InertEffect> effect)
177 { 181 {
178 effect->setName(getPropertyName(id)); 182 effect->setName(getPropertyName(id));
179 NewTransition newTransition; 183 NewTransition newTransition;
180 newTransition.id = id; 184 newTransition.id = id;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 ActiveInterpolationMap m_activeInterpolationsForTransitions; 261 ActiveInterpolationMap m_activeInterpolationsForTransitions;
258 }; 262 };
259 263
260 } // namespace blink 264 } // namespace blink
261 265
262 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::NewAnimation); 266 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::NewAnimation);
263 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::UpdatedAnimation); 267 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::UpdatedAnimation);
264 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::UpdatedAnimationSty le); 268 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::CSSAnimationUpdate::UpdatedAnimationSty le);
265 269
266 #endif 270 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698