| 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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 if (AnimatableValue::usesDefaultInterpolation(to.get(), from.get())) | 532 if (AnimatableValue::usesDefaultInterpolation(to.get(), from.get())) |
| 533 return; | 533 return; |
| 534 | 534 |
| 535 Timing timing = transitionData.convertToTiming(transitionIndex); | 535 Timing timing = transitionData.convertToTiming(transitionIndex); |
| 536 if (timing.startDelay + timing.iterationDuration <= 0) | 536 if (timing.startDelay + timing.iterationDuration <= 0) |
| 537 return; | 537 return; |
| 538 | 538 |
| 539 AnimatableValue* reversingAdjustedStartValue = from.get(); | 539 AnimatableValue* reversingAdjustedStartValue = from.get(); |
| 540 double reversingShorteningFactor = 1; | 540 double reversingShorteningFactor = 1; |
| 541 if (interruptedTransition) { | 541 if (interruptedTransition) { |
| 542 const double interruptedTimeFraction = interruptedTransition->animation-
>effect()->timeFraction(); | 542 const double interruptedProgress = interruptedTransition->animation->eff
ect()->progress(); |
| 543 if (!std::isnan(interruptedTimeFraction)) { | 543 if (!std::isnan(interruptedProgress)) { |
| 544 // const_cast because we need to take a ref later when passing to st
artTransition. | 544 // const_cast because we need to take a ref later when passing to st
artTransition. |
| 545 reversingAdjustedStartValue = const_cast<AnimatableValue*>(interrupt
edTransition->to); | 545 reversingAdjustedStartValue = const_cast<AnimatableValue*>(interrupt
edTransition->to); |
| 546 reversingShorteningFactor = clampTo( | 546 reversingShorteningFactor = clampTo( |
| 547 (interruptedTimeFraction * interruptedTransition->reversingShort
eningFactor) + | 547 (interruptedProgress * interruptedTransition->reversingShortenin
gFactor) + |
| 548 (1 - interruptedTransition->reversingShorteningFactor), 0.0, 1.0
); | 548 (1 - interruptedTransition->reversingShorteningFactor), 0.0, 1.0
); |
| 549 timing.iterationDuration *= reversingShorteningFactor; | 549 timing.iterationDuration *= reversingShorteningFactor; |
| 550 if (timing.startDelay < 0) { | 550 if (timing.startDelay < 0) { |
| 551 timing.startDelay *= reversingShorteningFactor; | 551 timing.startDelay *= reversingShorteningFactor; |
| 552 } | 552 } |
| 553 } | 553 } |
| 554 } | 554 } |
| 555 | 555 |
| 556 AnimatableValueKeyframeVector keyframes; | 556 AnimatableValueKeyframeVector keyframes; |
| 557 double startKeyframeOffset = 0; | 557 double startKeyframeOffset = 0; |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 } | 868 } |
| 869 | 869 |
| 870 DEFINE_TRACE(CSSAnimations) | 870 DEFINE_TRACE(CSSAnimations) |
| 871 { | 871 { |
| 872 visitor->trace(m_transitions); | 872 visitor->trace(m_transitions); |
| 873 visitor->trace(m_pendingUpdate); | 873 visitor->trace(m_pendingUpdate); |
| 874 visitor->trace(m_runningAnimations); | 874 visitor->trace(m_runningAnimations); |
| 875 } | 875 } |
| 876 | 876 |
| 877 } // namespace blink | 877 } // namespace blink |
| OLD | NEW |