| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 if (m_isInTargetActiveAnimationsList) | 53 if (m_isInTargetActiveAnimationsList) |
| 54 m_target->removeActiveAnimation(this); | 54 m_target->removeActiveAnimation(this); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void Animation::applyEffects(bool previouslyActiveOrInEffect) | 57 void Animation::applyEffects(bool previouslyActiveOrInEffect) |
| 58 { | 58 { |
| 59 if (!previouslyActiveOrInEffect) { | 59 if (!previouslyActiveOrInEffect) { |
| 60 m_target->addActiveAnimation(this); | 60 m_target->addActiveAnimation(this); |
| 61 m_isInTargetActiveAnimationsList = true; | 61 m_isInTargetActiveAnimationsList = true; |
| 62 } | 62 } |
| 63 m_cachedStyle = m_effect->sample(0, currentIteration()); | 63 m_compositableValues = m_effect->sample(currentIteration(), 0.0); |
| 64 m_target->setNeedsStyleRecalc(SyntheticStyleChange); | 64 m_target->setNeedsStyleRecalc(SyntheticStyleChange); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void Animation::clearEffects() | 67 void Animation::clearEffects() |
| 68 { | 68 { |
| 69 m_target->removeActiveAnimation(this); | 69 m_target->removeActiveAnimation(this); |
| 70 m_isInTargetActiveAnimationsList = false; | 70 m_isInTargetActiveAnimationsList = false; |
| 71 m_cachedStyle.clear(); | 71 m_compositableValues.clear(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void Animation::updateChildrenAndEffects(bool wasActiveOrInEffect) const | 74 void Animation::updateChildrenAndEffects(bool wasActiveOrInEffect) const |
| 75 { | 75 { |
| 76 const bool isActiveOrInEffect = isActive() || isInEffect(); | 76 const bool isActiveOrInEffect = isActive() || isInEffect(); |
| 77 ASSERT(m_isInTargetActiveAnimationsList == wasActiveOrInEffect); | 77 ASSERT(m_isInTargetActiveAnimationsList == wasActiveOrInEffect); |
| 78 if (wasActiveOrInEffect && !isActiveOrInEffect) | 78 if (wasActiveOrInEffect && !isActiveOrInEffect) |
| 79 const_cast<Animation*>(this)->clearEffects(); | 79 const_cast<Animation*>(this)->clearEffects(); |
| 80 else if (isActiveOrInEffect) | 80 else if (isActiveOrInEffect) |
| 81 const_cast<Animation*>(this)->applyEffects(wasActiveOrInEffect); | 81 const_cast<Animation*>(this)->applyEffects(wasActiveOrInEffect); |
| 82 } | 82 } |
| 83 | 83 |
| 84 } // namespace | 84 } // namespace |
| OLD | NEW |