| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 void Animation::applyEffects() | 143 void Animation::applyEffects() |
| 144 { | 144 { |
| 145 ASSERT(isInEffect()); | 145 ASSERT(isInEffect()); |
| 146 ASSERT(player()); | 146 ASSERT(player()); |
| 147 if (!m_target || !m_effect) | 147 if (!m_target || !m_effect) |
| 148 return; | 148 return; |
| 149 | 149 |
| 150 double iteration = currentIteration(); | 150 double iteration = currentIteration(); |
| 151 ASSERT(iteration >= 0); | 151 ASSERT(iteration >= 0); |
| 152 OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation> > > in
terpolations = m_sampledEffect ? m_sampledEffect->mutableInterpolations() : null
ptr; |
| 152 // FIXME: Handle iteration values which overflow int. | 153 // FIXME: Handle iteration values which overflow int. |
| 153 OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation> > > in
terpolations = m_effect->sample(static_cast<int>(iteration), timeFraction(), ite
rationDuration()); | 154 m_effect->sample(static_cast<int>(iteration), timeFraction(), iterationDurat
ion(), interpolations); |
| 154 if (m_sampledEffect) { | 155 if (m_sampledEffect) { |
| 155 m_sampledEffect->setInterpolations(interpolations.release()); | 156 m_sampledEffect->setInterpolations(interpolations.release()); |
| 156 } else if (!interpolations->isEmpty()) { | 157 } else if (interpolations && !interpolations->isEmpty()) { |
| 157 OwnPtrWillBeRawPtr<SampledEffect> sampledEffect = SampledEffect::create(
this, interpolations.release()); | 158 OwnPtrWillBeRawPtr<SampledEffect> sampledEffect = SampledEffect::create(
this, interpolations.release()); |
| 158 m_sampledEffect = sampledEffect.get(); | 159 m_sampledEffect = sampledEffect.get(); |
| 159 ensureAnimationStack(m_target).add(sampledEffect.release()); | 160 ensureAnimationStack(m_target).add(sampledEffect.release()); |
| 160 } else { | 161 } else { |
| 161 return; | 162 return; |
| 162 } | 163 } |
| 163 | 164 |
| 164 m_target->setNeedsAnimationStyleRecalc(); | 165 m_target->setNeedsAnimationStyleRecalc(); |
| 165 } | 166 } |
| 166 | 167 |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 | 313 |
| 313 void Animation::trace(Visitor* visitor) | 314 void Animation::trace(Visitor* visitor) |
| 314 { | 315 { |
| 315 visitor->trace(m_target); | 316 visitor->trace(m_target); |
| 316 visitor->trace(m_effect); | 317 visitor->trace(m_effect); |
| 317 visitor->trace(m_sampledEffect); | 318 visitor->trace(m_sampledEffect); |
| 318 AnimationNode::trace(visitor); | 319 AnimationNode::trace(visitor); |
| 319 } | 320 } |
| 320 | 321 |
| 321 } // namespace blink | 322 } // namespace blink |
| OLD | NEW |