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

Side by Side Diff: Source/core/animation/CompositorAnimations.cpp

Issue 851693007: Prepare for responsive CSS animations. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 10 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 /* 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 || (affectsTransform && attachedPlayer->affects(targetElement, CSSPr opertyTransform)) 112 || (affectsTransform && attachedPlayer->affects(targetElement, CSSPr opertyTransform))
113 || (affectsFilter && attachedPlayer->affects(targetElement, CSSPrope rtyWebkitFilter))) 113 || (affectsFilter && attachedPlayer->affects(targetElement, CSSPrope rtyWebkitFilter)))
114 return true; 114 return true;
115 } 115 }
116 116
117 return false; 117 return false;
118 } 118 }
119 119
120 } 120 }
121 121
122 CSSPropertyID CompositorAnimations::CompositableProperties[3] = {
123 CSSPropertyOpacity, CSSPropertyTransform, CSSPropertyWebkitFilter
124 };
125
122 bool CompositorAnimations::getAnimatedBoundingBox(FloatBox& box, const Animation Effect& effect, double minValue, double maxValue) const 126 bool CompositorAnimations::getAnimatedBoundingBox(FloatBox& box, const Animation Effect& effect, double minValue, double maxValue) const
123 { 127 {
124 const KeyframeEffectModelBase& keyframeEffect = toKeyframeEffectModelBase(ef fect); 128 const KeyframeEffectModelBase& keyframeEffect = toKeyframeEffectModelBase(ef fect);
125 129
126 PropertySet properties = keyframeEffect.properties(); 130 PropertySet properties = keyframeEffect.properties();
127 131
128 if (properties.isEmpty()) 132 if (properties.isEmpty())
129 return true; 133 return true;
130 134
131 minValue = std::min(minValue, 0.0); 135 minValue = std::min(minValue, 0.0);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 190
187 PropertySet properties = keyframeEffect.properties(); 191 PropertySet properties = keyframeEffect.properties();
188 if (properties.isEmpty()) 192 if (properties.isEmpty())
189 return false; 193 return false;
190 194
191 for (const auto& property : properties) { 195 for (const auto& property : properties) {
192 const PropertySpecificKeyframeVector& keyframes = keyframeEffect.getProp ertySpecificKeyframes(property); 196 const PropertySpecificKeyframeVector& keyframes = keyframeEffect.getProp ertySpecificKeyframes(property);
193 ASSERT(keyframes.size() >= 2); 197 ASSERT(keyframes.size() >= 2);
194 for (const auto& keyframe : keyframes) { 198 for (const auto& keyframe : keyframes) {
195 // FIXME: Determine candidacy based on the CSSValue instead of a sna pshot AnimatableValue. 199 // FIXME: Determine candidacy based on the CSSValue instead of a sna pshot AnimatableValue.
196 if (keyframe->composite() != AnimationEffect::CompositeReplace || !k eyframe->getAnimatableValue()) 200 bool isNeutralKeyframe = keyframe->isStringPropertySpecificKeyframe( ) && !toStringPropertySpecificKeyframe(keyframe.get())->value() && keyframe->com posite() == AnimationEffect::CompositeAdd;
201 if ((keyframe->composite() != AnimationEffect::CompositeReplace && ! isNeutralKeyframe) || !keyframe->getAnimatableValue())
197 return false; 202 return false;
198 203
199 switch (property) { 204 switch (property) {
200 case CSSPropertyOpacity: 205 case CSSPropertyOpacity:
201 break; 206 break;
202 case CSSPropertyTransform: 207 case CSSPropertyTransform:
203 if (toAnimatableTransform(keyframe->getAnimatableValue().get())- >transformOperations().dependsOnBoxSize()) 208 if (toAnimatableTransform(keyframe->getAnimatableValue().get())- >transformOperations().dependsOnBoxSize())
204 return false; 209 return false;
205 break; 210 break;
206 case CSSPropertyWebkitFilter: { 211 case CSSPropertyWebkitFilter: {
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 break; 621 break;
617 default: 622 default:
618 ASSERT_NOT_REACHED(); 623 ASSERT_NOT_REACHED();
619 } 624 }
620 animations.append(animation.release()); 625 animations.append(animation.release());
621 } 626 }
622 ASSERT(!animations.isEmpty()); 627 ASSERT(!animations.isEmpty());
623 } 628 }
624 629
625 } // namespace blink 630 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698