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

Side by Side Diff: Source/core/animation/css/CSSAnimations.cpp

Issue 814083003: Update animation when changes in animation keyframes are detected. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase again Created 5 years, 11 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 break; 83 break;
84 } 84 }
85 return property; 85 return property;
86 } 86 }
87 87
88 static void resolveKeyframes(StyleResolver* resolver, const Element* animatingEl ement, Element& element, const RenderStyle& style, RenderStyle* parentStyle, con st AtomicString& name, TimingFunction* defaultTimingFunction, 88 static void resolveKeyframes(StyleResolver* resolver, const Element* animatingEl ement, Element& element, const RenderStyle& style, RenderStyle* parentStyle, con st AtomicString& name, TimingFunction* defaultTimingFunction,
89 AnimatableValueKeyframeVector& keyframes) 89 AnimatableValueKeyframeVector& keyframes)
90 { 90 {
91 // When the animating element is null, use its parent for scoping purposes. 91 // When the animating element is null, use its parent for scoping purposes.
92 const Element* elementForScoping = animatingElement ? animatingElement : &el ement; 92 const Element* elementForScoping = animatingElement ? animatingElement : &el ement;
93 const StyleRuleKeyframes* keyframesRule = resolver->findKeyframesRule(elemen tForScoping, name); 93 const StyleRuleKeyframes* keyframesRule = resolver->findKeyframesRule(elemen tForScoping, name).get();
94 if (!keyframesRule) 94 if (!keyframesRule)
95 return; 95 return;
96 96
97 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleKeyframe>>& styleKeyframe s = keyframesRule->keyframes(); 97 const WillBeHeapVector<RefPtrWillBeMember<StyleRuleKeyframe>>& styleKeyframe s = keyframesRule->keyframes();
98 98
99 // Construct and populate the style for each keyframe 99 // Construct and populate the style for each keyframe
100 PropertySet specifiedPropertiesForUseCounter; 100 PropertySet specifiedPropertiesForUseCounter;
101 for (size_t i = 0; i < styleKeyframes.size(); ++i) { 101 for (size_t i = 0; i < styleKeyframes.size(); ++i) {
102 const StyleRuleKeyframe* styleKeyframe = styleKeyframes[i].get(); 102 const StyleRuleKeyframe* styleKeyframe = styleKeyframes[i].get();
103 RefPtr<RenderStyle> keyframeStyle = resolver->styleForKeyframe(element, style, parentStyle, styleKeyframe, name); 103 RefPtr<RenderStyle> keyframeStyle = resolver->styleForKeyframe(element, style, parentStyle, styleKeyframe, name);
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 203
204 } // namespace 204 } // namespace
205 205
206 CSSAnimations::CSSAnimations() 206 CSSAnimations::CSSAnimations()
207 { 207 {
208 } 208 }
209 209
210 const AtomicString CSSAnimations::getAnimationNameForInspector(const AnimationPl ayer& player) 210 const AtomicString CSSAnimations::getAnimationNameForInspector(const AnimationPl ayer& player)
211 { 211 {
212 for (const auto& it : m_animations) { 212 for (const auto& it : m_animations) {
213 if (it.value->sequenceNumber() == player.sequenceNumber()) 213 if (it.value.player->sequenceNumber() == player.sequenceNumber())
214 return it.key; 214 return it.key;
215 } 215 }
216 return nullAtom; 216 return nullAtom;
217 } 217 }
218 218
219 PassOwnPtrWillBeRawPtr<CSSAnimationUpdate> CSSAnimations::calculateUpdate(const Element* animatingElement, Element& element, const RenderStyle& style, RenderSty le* parentStyle, StyleResolver* resolver) 219 PassOwnPtrWillBeRawPtr<CSSAnimationUpdate> CSSAnimations::calculateUpdate(const Element* animatingElement, Element& element, const RenderStyle& style, RenderSty le* parentStyle, StyleResolver* resolver)
220 { 220 {
221 OwnPtrWillBeRawPtr<CSSAnimationUpdate> update = adoptPtrWillBeNoop(new CSSAn imationUpdate()); 221 OwnPtrWillBeRawPtr<CSSAnimationUpdate> update = adoptPtrWillBeNoop(new CSSAn imationUpdate());
222 calculateAnimationUpdate(update.get(), animatingElement, element, style, par entStyle, resolver); 222 calculateAnimationUpdate(update.get(), animatingElement, element, style, par entStyle, resolver);
223 calculateAnimationActiveInterpolations(update.get(), animatingElement, eleme nt.document().timeline().currentTimeInternal()); 223 calculateAnimationActiveInterpolations(update.get(), animatingElement, eleme nt.document().timeline().currentTimeInternal());
224 calculateTransitionUpdate(update.get(), animatingElement, style); 224 calculateTransitionUpdate(update.get(), animatingElement, style);
225 calculateTransitionActiveInterpolations(update.get(), animatingElement, elem ent.document().timeline().currentTimeInternal()); 225 calculateTransitionActiveInterpolations(update.get(), animatingElement, elem ent.document().timeline().currentTimeInternal());
226 return update->isEmpty() ? nullptr : update.release(); 226 return update->isEmpty() ? nullptr : update.release();
227 } 227 }
228 228
229 void CSSAnimations::calculateAnimationUpdate(CSSAnimationUpdate* update, const E lement* animatingElement, Element& element, const RenderStyle& style, RenderStyl e* parentStyle, StyleResolver* resolver) 229 void CSSAnimations::calculateAnimationUpdate(CSSAnimationUpdate* update, const E lement* animatingElement, Element& element, const RenderStyle& style, RenderStyl e* parentStyle, StyleResolver* resolver)
230 { 230 {
231 const ActiveAnimations* activeAnimations = animatingElement ? animatingEleme nt->activeAnimations() : nullptr; 231 const ActiveAnimations* activeAnimations = animatingElement ? animatingEleme nt->activeAnimations() : nullptr;
232 232
233 #if !ENABLE(ASSERT) 233 #if !ENABLE(ASSERT)
234 // If we're in an animation style change, no animations can have started, be en cancelled or changed play state. 234 // If we're in an animation style change, no animations can have started, be en cancelled or changed play state.
235 // When ASSERT is enabled, we verify this optimization. 235 // When ASSERT is enabled, we verify this optimization.
236 if (activeAnimations && activeAnimations->isAnimationStyleChange()) 236 if (activeAnimations && activeAnimations->isAnimationStyleChange())
237 return; 237 return;
238 #endif 238 #endif
239 239
240 const CSSAnimationData* animationData = style.animations(); 240 const CSSAnimationData* animationData = style.animations();
241 const CSSAnimations* cssAnimations = activeAnimations ? &activeAnimations->c ssAnimations() : nullptr; 241 const CSSAnimations* cssAnimations = activeAnimations ? &activeAnimations->c ssAnimations() : nullptr;
242 const Element* elementForScoping = animatingElement ? animatingElement : &el ement;
242 243
243 HashSet<AtomicString> inactive; 244 HashSet<AtomicString> inactive;
244 if (cssAnimations) { 245 if (cssAnimations) {
245 for (const auto& entry : cssAnimations->m_animations) 246 for (const auto& entry : cssAnimations->m_animations)
246 inactive.add(entry.key); 247 inactive.add(entry.key);
247 } 248 }
248 249
249 if (style.display() != NONE) { 250 if (style.display() != NONE) {
250 for (size_t i = 0; animationData && i < animationData->nameList().size() ; ++i) { 251 for (size_t i = 0; animationData && i < animationData->nameList().size() ; ++i) {
251 AtomicString animationName(animationData->nameList()[i]); 252 AtomicString animationName(animationData->nameList()[i]);
252 if (animationName == CSSAnimationData::initialName()) 253 if (animationName == CSSAnimationData::initialName())
253 continue; 254 continue;
254 255
255 const bool isPaused = CSSTimingData::getRepeated(animationData->play StateList(), i) == AnimPlayStatePaused; 256 const bool isPaused = CSSTimingData::getRepeated(animationData->play StateList(), i) == AnimPlayStatePaused;
256 257
257 Timing timing = animationData->convertToTiming(i); 258 Timing timing = animationData->convertToTiming(i);
259 Timing specifiedTiming = timing;
258 RefPtr<TimingFunction> keyframeTimingFunction = timing.timingFunctio n; 260 RefPtr<TimingFunction> keyframeTimingFunction = timing.timingFunctio n;
259 timing.timingFunction = Timing::defaults().timingFunction; 261 timing.timingFunction = Timing::defaults().timingFunction;
260 262
263 RefPtrWillBeRawPtr<StyleRuleKeyframes> keyframesRule = resolver->fin dKeyframesRule(elementForScoping, animationName);
264 if (!keyframesRule)
265 continue; // Cancel the animation if there's no style rule for i t.
266
261 if (cssAnimations) { 267 if (cssAnimations) {
262 AnimationMap::const_iterator existing(cssAnimations->m_animation s.find(animationName)); 268 AnimationMap::const_iterator existing(cssAnimations->m_animation s.find(animationName));
263 if (existing != cssAnimations->m_animations.end()) { 269 if (existing != cssAnimations->m_animations.end()) {
264 inactive.remove(animationName); 270 inactive.remove(animationName);
265 271
266 AnimationPlayer* player = existing->value.get(); 272 const RunningAnimation& runningAnimation = existing->value;
273 AnimationPlayer* player = runningAnimation.player.get();
267 274
268 // FIXME: Should handle changes in the timing function. 275 ASSERT(keyframesRule);
269 if (timing != player->source()->specifiedTiming()) { 276 if (keyframesRule != runningAnimation.styleRule || keyframes Rule->styleChangeCounter() != runningAnimation.styleChangeCounter || runningAnim ation.specifiedTiming != specifiedTiming) {
270 ASSERT(!activeAnimations || !activeAnimations->isAnimati onStyleChange());
271
272 AnimatableValueKeyframeVector resolvedKeyframes; 277 AnimatableValueKeyframeVector resolvedKeyframes;
273 resolveKeyframes(resolver, animatingElement, element, st yle, parentStyle, animationName, keyframeTimingFunction.get(), resolvedKeyframes ); 278 resolveKeyframes(resolver, animatingElement, element, st yle, parentStyle, animationName, keyframeTimingFunction.get(), resolvedKeyframes );
274 279
275 update->updateAnimationTiming(player, InertAnimation::cr eate(AnimatableValueKeyframeEffectModel::create(resolvedKeyframes), 280 update->updateAnimation(animationName, player, InertAnim ation::create(AnimatableValueKeyframeEffectModel::create(resolvedKeyframes),
276 timing, isPaused, player->currentTimeInternal()), ti ming); 281 timing, isPaused, player->currentTimeInternal()), sp ecifiedTiming, keyframesRule);
277 } 282 }
278 283
279 if (isPaused != player->paused()) { 284 if (isPaused != player->paused()) {
280 ASSERT(!activeAnimations || !activeAnimations->isAnimati onStyleChange()); 285 ASSERT(!activeAnimations || !activeAnimations->isAnimati onStyleChange());
281 update->toggleAnimationPaused(animationName); 286 update->toggleAnimationPaused(animationName);
282 } 287 }
283 288
284 continue; 289 continue;
285 } 290 }
286 } 291 }
287 292
288 AnimatableValueKeyframeVector resolvedKeyframes; 293 AnimatableValueKeyframeVector resolvedKeyframes;
289 resolveKeyframes(resolver, animatingElement, element, style, parentS tyle, animationName, keyframeTimingFunction.get(), resolvedKeyframes); 294 resolveKeyframes(resolver, animatingElement, element, style, parentS tyle, animationName, keyframeTimingFunction.get(), resolvedKeyframes);
290 if (!resolvedKeyframes.isEmpty()) { 295 if (!resolvedKeyframes.isEmpty()) {
291 ASSERT(!activeAnimations || !activeAnimations->isAnimationStyleC hange()); 296 ASSERT(!activeAnimations || !activeAnimations->isAnimationStyleC hange());
292 update->startAnimation(animationName, InertAnimation::create(Ani matableValueKeyframeEffectModel::create(resolvedKeyframes), timing, isPaused, 0) ); 297 update->startAnimation(animationName, InertAnimation::create(Ani matableValueKeyframeEffectModel::create(resolvedKeyframes), timing, isPaused, 0) , specifiedTiming, keyframesRule);
293 } 298 }
294 } 299 }
295 } 300 }
296 301
297 ASSERT(inactive.isEmpty() || cssAnimations); 302 ASSERT(inactive.isEmpty() || cssAnimations);
298 for (const AtomicString& animationName : inactive) { 303 for (const AtomicString& animationName : inactive) {
299 ASSERT(!activeAnimations || !activeAnimations->isAnimationStyleChange()) ; 304 ASSERT(!activeAnimations || !activeAnimations->isAnimationStyleChange()) ;
300 update->cancelAnimation(animationName, *cssAnimations->m_animations.get( animationName)); 305 update->cancelAnimation(animationName, *cssAnimations->m_animations.get( animationName).player);
301 } 306 }
302 } 307 }
303 308
304 void CSSAnimations::maybeApplyPendingUpdate(Element* element) 309 void CSSAnimations::maybeApplyPendingUpdate(Element* element)
305 { 310 {
306 if (!m_pendingUpdate) { 311 if (!m_pendingUpdate) {
307 m_previousActiveInterpolationsForAnimations.clear(); 312 m_previousActiveInterpolationsForAnimations.clear();
308 return; 313 return;
309 } 314 }
310 315
311 OwnPtrWillBeRawPtr<CSSAnimationUpdate> update = m_pendingUpdate.release(); 316 OwnPtrWillBeRawPtr<CSSAnimationUpdate> update = m_pendingUpdate.release();
312 317
313 m_previousActiveInterpolationsForAnimations.swap(update->activeInterpolation sForAnimations()); 318 m_previousActiveInterpolationsForAnimations.swap(update->activeInterpolation sForAnimations());
314 319
315 // FIXME: cancelling, pausing, unpausing animations all query compositingSta te, which is not necessarily up to date here 320 // FIXME: cancelling, pausing, unpausing animations all query compositingSta te, which is not necessarily up to date here
316 // since we call this from recalc style. 321 // since we call this from recalc style.
317 // https://code.google.com/p/chromium/issues/detail?id=339847 322 // https://code.google.com/p/chromium/issues/detail?id=339847
318 DisableCompositingQueryAsserts disabler; 323 DisableCompositingQueryAsserts disabler;
319 324
320 for (const AtomicString& animationName : update->cancelledAnimationNames()) { 325 for (const AtomicString& animationName : update->cancelledAnimationNames()) {
321 RefPtrWillBeRawPtr<AnimationPlayer> player = m_animations.take(animation Name); 326 RefPtrWillBeRawPtr<AnimationPlayer> player = m_animations.take(animation Name).player;
322 player->cancel(); 327 player->cancel();
323 player->update(TimingUpdateOnDemand); 328 player->update(TimingUpdateOnDemand);
324 } 329 }
325 330
326 for (const AtomicString& animationName : update->animationsWithPauseToggled( )) { 331 for (const AtomicString& animationName : update->animationsWithPauseToggled( )) {
327 AnimationPlayer* player = m_animations.get(animationName); 332 AnimationPlayer* player = m_animations.get(animationName).player.get();
328 if (player->paused()) 333 if (player->paused())
329 player->unpause(); 334 player->unpause();
330 else 335 else
331 player->pause(); 336 player->pause();
332 if (player->outdated()) 337 if (player->outdated())
333 player->update(TimingUpdateOnDemand); 338 player->update(TimingUpdateOnDemand);
334 } 339 }
335 340
336 for (const auto& timingUpdate : update->animationsWithTimingUpdates()) { 341 for (const auto& entry : update->animationsWithUpdates()) {
337 timingUpdate.player->source()->updateSpecifiedTiming(timingUpdate.newTim ing); 342 Animation* animation = toAnimation(entry.player->source());
338 timingUpdate.player->update(TimingUpdateOnDemand); 343
344 animation->setEffect(entry.animation->effect());
345 animation->updateSpecifiedTiming(entry.animation->specifiedTiming());
346
347 auto& runningAnimation = m_animations.find(entry.name)->value;
348 runningAnimation.styleRule = entry.styleRule;
esprehn 2015/01/29 04:23:19 maybe a method on RunningAnimation like update(ent
shend 2015/01/30 00:03:10 Done.
349 runningAnimation.styleChangeCounter = entry.styleChangeCounter;
350 runningAnimation.specifiedTiming = entry.specifiedTiming;
339 } 351 }
340 352
341 for (const auto& entry : update->newAnimations()) { 353 for (const auto& entry : update->newAnimations()) {
342 const InertAnimation* inertAnimation = entry.animation.get(); 354 const InertAnimation* inertAnimation = entry.animation.get();
343 OwnPtrWillBeRawPtr<AnimationEventDelegate> eventDelegate = adoptPtrWillB eNoop(new AnimationEventDelegate(element, entry.name)); 355 OwnPtrWillBeRawPtr<AnimationEventDelegate> eventDelegate = adoptPtrWillB eNoop(new AnimationEventDelegate(element, entry.name));
344 RefPtrWillBeRawPtr<Animation> animation = Animation::create(element, ine rtAnimation->effect(), inertAnimation->specifiedTiming(), Animation::DefaultPrio rity, eventDelegate.release()); 356 RefPtrWillBeRawPtr<Animation> animation = Animation::create(element, ine rtAnimation->effect(), inertAnimation->specifiedTiming(), Animation::DefaultPrio rity, eventDelegate.release());
345 animation->setName(inertAnimation->name()); 357 animation->setName(inertAnimation->name());
346 RefPtrWillBeRawPtr<AnimationPlayer> player = element->document().timelin e().play(animation.get()); 358 RefPtrWillBeRawPtr<AnimationPlayer> player = element->document().timelin e().play(animation.get());
347 if (inertAnimation->paused()) 359 if (inertAnimation->paused())
348 player->pause(); 360 player->pause();
349 player->update(TimingUpdateOnDemand); 361 player->update(TimingUpdateOnDemand);
350 m_animations.set(entry.name, player.get()); 362
363 RunningAnimation runningAnimation;
esprehn 2015/01/29 04:23:19 RunningAnimation runningAnimation(player, entry) a
shend 2015/01/30 00:03:10 Done.
364 runningAnimation.player = player;
365 runningAnimation.specifiedTiming = entry.timing;
366 runningAnimation.styleRule = entry.styleRule;
367 runningAnimation.styleChangeCounter = entry.styleChangeCounter;
368
369 m_animations.set(entry.name, runningAnimation);
351 } 370 }
352 371
353 // Transitions that are run on the compositor only update main-thread state 372 // Transitions that are run on the compositor only update main-thread state
354 // lazily. However, we need the new state to know what the from state shoud 373 // lazily. However, we need the new state to know what the from state shoud
355 // be when transitions are retargeted. Instead of triggering complete style 374 // be when transitions are retargeted. Instead of triggering complete style
356 // recalculation, we find these cases by searching for new transitions that 375 // recalculation, we find these cases by searching for new transitions that
357 // have matching cancelled animation property IDs on the compositor. 376 // have matching cancelled animation property IDs on the compositor.
358 WillBeHeapHashMap<CSSPropertyID, std::pair<RefPtrWillBeMember<Animation>, do uble>> retargetedCompositorTransitions; 377 WillBeHeapHashMap<CSSPropertyID, std::pair<RefPtrWillBeMember<Animation>, do uble>> retargetedCompositorTransitions;
359 for (CSSPropertyID id : update->cancelledTransitions()) { 378 for (CSSPropertyID id : update->cancelledTransitions()) {
360 ASSERT(m_transitions.contains(id)); 379 ASSERT(m_transitions.contains(id));
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 // ASSERT(player.playStateInternal() == AnimationPlayer::Finishe d || !(activeAnimations && activeAnimations->isAnimationStyleChange())); 549 // ASSERT(player.playStateInternal() == AnimationPlayer::Finishe d || !(activeAnimations && activeAnimations->isAnimationStyleChange()));
531 update->cancelTransition(id); 550 update->cancelTransition(id);
532 } 551 }
533 } 552 }
534 } 553 }
535 } 554 }
536 555
537 void CSSAnimations::cancel() 556 void CSSAnimations::cancel()
538 { 557 {
539 for (const auto& entry : m_animations) { 558 for (const auto& entry : m_animations) {
540 entry.value->cancel(); 559 entry.value.player->cancel();
541 entry.value->update(TimingUpdateOnDemand); 560 entry.value.player->update(TimingUpdateOnDemand);
542 } 561 }
543 562
544 for (const auto& entry : m_transitions) { 563 for (const auto& entry : m_transitions) {
545 entry.value.player->cancel(); 564 entry.value.player->cancel();
546 entry.value.player->update(TimingUpdateOnDemand); 565 entry.value.player->update(TimingUpdateOnDemand);
547 } 566 }
548 567
549 m_animations.clear(); 568 m_animations.clear();
550 m_transitions.clear(); 569 m_transitions.clear();
551 m_pendingUpdate = nullptr; 570 m_pendingUpdate = nullptr;
552 } 571 }
553 572
554 void CSSAnimations::calculateAnimationActiveInterpolations(CSSAnimationUpdate* u pdate, const Element* animatingElement, double timelineCurrentTime) 573 void CSSAnimations::calculateAnimationActiveInterpolations(CSSAnimationUpdate* u pdate, const Element* animatingElement, double timelineCurrentTime)
555 { 574 {
556 ActiveAnimations* activeAnimations = animatingElement ? animatingElement->ac tiveAnimations() : nullptr; 575 ActiveAnimations* activeAnimations = animatingElement ? animatingElement->ac tiveAnimations() : nullptr;
557 AnimationStack* animationStack = activeAnimations ? &activeAnimations->defau ltStack() : nullptr; 576 AnimationStack* animationStack = activeAnimations ? &activeAnimations->defau ltStack() : nullptr;
558 577
559 if (update->newAnimations().isEmpty() && update->suppressedAnimationAnimatio nPlayers().isEmpty()) { 578 if (update->newAnimations().isEmpty() && update->suppressedAnimationAnimatio nPlayers().isEmpty()) {
560 WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation>> acti veInterpolationsForAnimations(AnimationStack::activeInterpolations(animationStac k, 0, 0, Animation::DefaultPriority, timelineCurrentTime)); 579 WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation>> acti veInterpolationsForAnimations(AnimationStack::activeInterpolations(animationStac k, 0, 0, Animation::DefaultPriority, timelineCurrentTime));
561 update->adoptActiveInterpolationsForAnimations(activeInterpolationsForAn imations); 580 update->adoptActiveInterpolationsForAnimations(activeInterpolationsForAn imations);
562 return; 581 return;
563 } 582 }
564 583
565 WillBeHeapVector<RawPtrWillBeMember<InertAnimation>> newAnimations; 584 WillBeHeapVector<RawPtrWillBeMember<InertAnimation>> newAnimations;
566 for (const auto& newAnimation : update->newAnimations()) 585 for (const auto& newAnimation : update->newAnimations())
567 newAnimations.append(newAnimation.animation.get()); 586 newAnimations.append(newAnimation.animation.get());
568 for (const auto& updatedAnimation : update->animationsWithTimingUpdates()) 587 for (const auto& updatedAnimation : update->animationsWithUpdates())
569 newAnimations.append(updatedAnimation.animation.get()); // Animations wi th timing updates use a temporary InertAnimation for the current frame. 588 newAnimations.append(updatedAnimation.animation.get()); // Animations wi th updates use a temporary InertAnimation for the current frame.
570 589
571 WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation>> activeIn terpolationsForAnimations(AnimationStack::activeInterpolations(animationStack, & newAnimations, &update->suppressedAnimationAnimationPlayers(), Animation::Defaul tPriority, timelineCurrentTime)); 590 WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<Interpolation>> activeIn terpolationsForAnimations(AnimationStack::activeInterpolations(animationStack, & newAnimations, &update->suppressedAnimationAnimationPlayers(), Animation::Defaul tPriority, timelineCurrentTime));
572 update->adoptActiveInterpolationsForAnimations(activeInterpolationsForAnimat ions); 591 update->adoptActiveInterpolationsForAnimations(activeInterpolationsForAnimat ions);
573 } 592 }
574 593
575 void CSSAnimations::calculateTransitionActiveInterpolations(CSSAnimationUpdate* update, const Element* animatingElement, double timelineCurrentTime) 594 void CSSAnimations::calculateTransitionActiveInterpolations(CSSAnimationUpdate* update, const Element* animatingElement, double timelineCurrentTime)
576 { 595 {
577 ActiveAnimations* activeAnimations = animatingElement ? animatingElement->ac tiveAnimations() : nullptr; 596 ActiveAnimations* activeAnimations = animatingElement ? animatingElement->ac tiveAnimations() : nullptr;
578 AnimationStack* animationStack = activeAnimations ? &activeAnimations->defau ltStack() : nullptr; 597 AnimationStack* animationStack = activeAnimations ? &activeAnimations->defau ltStack() : nullptr;
579 598
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 } 764 }
746 765
747 void CSSAnimationUpdate::trace(Visitor* visitor) 766 void CSSAnimationUpdate::trace(Visitor* visitor)
748 { 767 {
749 #if ENABLE(OILPAN) 768 #if ENABLE(OILPAN)
750 visitor->trace(m_newTransitions); 769 visitor->trace(m_newTransitions);
751 visitor->trace(m_activeInterpolationsForAnimations); 770 visitor->trace(m_activeInterpolationsForAnimations);
752 visitor->trace(m_activeInterpolationsForTransitions); 771 visitor->trace(m_activeInterpolationsForTransitions);
753 visitor->trace(m_newAnimations); 772 visitor->trace(m_newAnimations);
754 visitor->trace(m_suppressedAnimationPlayers); 773 visitor->trace(m_suppressedAnimationPlayers);
755 visitor->trace(m_animationsWithTimingUpdates); 774 visitor->trace(m_animationsWithUpdates);
756 #endif 775 #endif
757 } 776 }
758 777
759 } // namespace blink 778 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698