OLD | NEW |
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 594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 m_transitions.clear(); | 605 m_transitions.clear(); |
606 clearPendingUpdate(); | 606 clearPendingUpdate(); |
607 } | 607 } |
608 | 608 |
609 void CSSAnimations::calculateAnimationActiveInterpolations(CSSAnimationUpdate& u
pdate, const Element* animatingElement, double timelineCurrentTime) | 609 void CSSAnimations::calculateAnimationActiveInterpolations(CSSAnimationUpdate& u
pdate, const Element* animatingElement, double timelineCurrentTime) |
610 { | 610 { |
611 ElementAnimations* elementAnimations = animatingElement ? animatingElement->
elementAnimations() : nullptr; | 611 ElementAnimations* elementAnimations = animatingElement ? animatingElement->
elementAnimations() : nullptr; |
612 AnimationStack* animationStack = elementAnimations ? &elementAnimations->def
aultStack() : nullptr; | 612 AnimationStack* animationStack = elementAnimations ? &elementAnimations->def
aultStack() : nullptr; |
613 | 613 |
614 if (update.newAnimations().isEmpty() && update.suppressedAnimations().isEmpt
y()) { | 614 if (update.newAnimations().isEmpty() && update.suppressedAnimations().isEmpt
y()) { |
615 ActiveInterpolationMap activeInterpolationsForAnimations(AnimationStack:
:activeInterpolations(animationStack, 0, 0, KeyframeEffect::DefaultPriority, tim
elineCurrentTime)); | 615 ActiveInterpolationsMap activeInterpolationsForAnimations(AnimationStack
::activeInterpolations(animationStack, 0, 0, KeyframeEffect::DefaultPriority, ti
melineCurrentTime)); |
616 update.adoptActiveInterpolationsForAnimations(activeInterpolationsForAni
mations); | 616 update.adoptActiveInterpolationsForAnimations(activeInterpolationsForAni
mations); |
617 return; | 617 return; |
618 } | 618 } |
619 | 619 |
620 HeapVector<Member<InertEffect>> newEffects; | 620 HeapVector<Member<InertEffect>> newEffects; |
621 for (const auto& newAnimation : update.newAnimations()) | 621 for (const auto& newAnimation : update.newAnimations()) |
622 newEffects.append(newAnimation.effect.get()); | 622 newEffects.append(newAnimation.effect.get()); |
623 for (const auto& updatedAnimation : update.animationsWithUpdates()) | 623 for (const auto& updatedAnimation : update.animationsWithUpdates()) |
624 newEffects.append(updatedAnimation.effect.get()); // Animations with upd
ates use a temporary InertEffect for the current frame. | 624 newEffects.append(updatedAnimation.effect.get()); // Animations with upd
ates use a temporary InertEffect for the current frame. |
625 | 625 |
626 ActiveInterpolationMap activeInterpolationsForAnimations(AnimationStack::act
iveInterpolations(animationStack, &newEffects, &update.suppressedAnimations(), K
eyframeEffect::DefaultPriority, timelineCurrentTime)); | 626 ActiveInterpolationsMap activeInterpolationsForAnimations(AnimationStack::ac
tiveInterpolations(animationStack, &newEffects, &update.suppressedAnimations(),
KeyframeEffect::DefaultPriority, timelineCurrentTime)); |
627 update.adoptActiveInterpolationsForAnimations(activeInterpolationsForAnimati
ons); | 627 update.adoptActiveInterpolationsForAnimations(activeInterpolationsForAnimati
ons); |
628 } | 628 } |
629 | 629 |
630 void CSSAnimations::calculateTransitionActiveInterpolations(CSSAnimationUpdate&
update, const Element* animatingElement, double timelineCurrentTime) | 630 void CSSAnimations::calculateTransitionActiveInterpolations(CSSAnimationUpdate&
update, const Element* animatingElement, double timelineCurrentTime) |
631 { | 631 { |
632 ElementAnimations* elementAnimations = animatingElement ? animatingElement->
elementAnimations() : nullptr; | 632 ElementAnimations* elementAnimations = animatingElement ? animatingElement->
elementAnimations() : nullptr; |
633 AnimationStack* animationStack = elementAnimations ? &elementAnimations->def
aultStack() : nullptr; | 633 AnimationStack* animationStack = elementAnimations ? &elementAnimations->def
aultStack() : nullptr; |
634 | 634 |
635 ActiveInterpolationMap activeInterpolationsForTransitions; | 635 ActiveInterpolationsMap activeInterpolationsForTransitions; |
636 if (update.newTransitions().isEmpty() && update.cancelledTransitions().isEmp
ty()) { | 636 if (update.newTransitions().isEmpty() && update.cancelledTransitions().isEmp
ty()) { |
637 activeInterpolationsForTransitions = AnimationStack::activeInterpolation
s(animationStack, 0, 0, KeyframeEffect::TransitionPriority, timelineCurrentTime)
; | 637 activeInterpolationsForTransitions = AnimationStack::activeInterpolation
s(animationStack, 0, 0, KeyframeEffect::TransitionPriority, timelineCurrentTime)
; |
638 } else { | 638 } else { |
639 HeapVector<Member<InertEffect>> newTransitions; | 639 HeapVector<Member<InertEffect>> newTransitions; |
640 for (const auto& entry : update.newTransitions()) | 640 for (const auto& entry : update.newTransitions()) |
641 newTransitions.append(entry.value.effect.get()); | 641 newTransitions.append(entry.value.effect.get()); |
642 | 642 |
643 HeapHashSet<Member<const Animation>> cancelledAnimations; | 643 HeapHashSet<Member<const Animation>> cancelledAnimations; |
644 if (!update.cancelledTransitions().isEmpty()) { | 644 if (!update.cancelledTransitions().isEmpty()) { |
645 ASSERT(elementAnimations); | 645 ASSERT(elementAnimations); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
793 } | 793 } |
794 | 794 |
795 DEFINE_TRACE(CSSAnimations) | 795 DEFINE_TRACE(CSSAnimations) |
796 { | 796 { |
797 visitor->trace(m_transitions); | 797 visitor->trace(m_transitions); |
798 visitor->trace(m_pendingUpdate); | 798 visitor->trace(m_pendingUpdate); |
799 visitor->trace(m_animations); | 799 visitor->trace(m_animations); |
800 } | 800 } |
801 | 801 |
802 } // namespace blink | 802 } // namespace blink |
OLD | NEW |