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 16 matching lines...) Expand all Loading... |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "core/animation/InertAnimation.h" | 32 #include "core/animation/InertAnimation.h" |
33 #include "core/animation/Interpolation.h" | 33 #include "core/animation/Interpolation.h" |
34 | 34 |
35 namespace blink { | 35 namespace blink { |
36 | 36 |
37 PassRefPtrWillBeRawPtr<InertAnimation> InertAnimation::create(PassRefPtrWillBeRa
wPtr<AnimationEffect> effect, const Timing& timing, bool paused, double inherite
dTime) | 37 PassRefPtrWillBeRawPtr<InertAnimation> InertAnimation::create(PassRefPtrWillBeRa
wPtr<EffectModel> effect, const Timing& timing, bool paused, double inheritedTim
e) |
38 { | 38 { |
39 return adoptRefWillBeNoop(new InertAnimation(effect, timing, paused, inherit
edTime)); | 39 return adoptRefWillBeNoop(new InertAnimation(effect, timing, paused, inherit
edTime)); |
40 } | 40 } |
41 | 41 |
42 InertAnimation::InertAnimation(PassRefPtrWillBeRawPtr<AnimationEffect> effect, c
onst Timing& timing, bool paused, double inheritedTime) | 42 InertAnimation::InertAnimation(PassRefPtrWillBeRawPtr<EffectModel> effect, const
Timing& timing, bool paused, double inheritedTime) |
43 : AnimationNode(timing) | 43 : AnimationEffect(timing) |
44 , m_effect(effect) | 44 , m_effect(effect) |
45 , m_paused(paused) | 45 , m_paused(paused) |
46 , m_inheritedTime(inheritedTime) | 46 , m_inheritedTime(inheritedTime) |
47 { | 47 { |
48 } | 48 } |
49 | 49 |
50 void InertAnimation::sample(OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMemb
er<Interpolation>>>& result) | 50 void InertAnimation::sample(OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMemb
er<Interpolation>>>& result) |
51 { | 51 { |
52 updateInheritedTime(m_inheritedTime, TimingUpdateOnDemand); | 52 updateInheritedTime(m_inheritedTime, TimingUpdateOnDemand); |
53 if (!isInEffect()) { | 53 if (!isInEffect()) { |
54 result.clear(); | 54 result.clear(); |
55 return; | 55 return; |
56 } | 56 } |
57 | 57 |
58 double iteration = currentIteration(); | 58 double iteration = currentIteration(); |
59 ASSERT(iteration >= 0); | 59 ASSERT(iteration >= 0); |
60 // FIXME: Handle iteration values which overflow int. | 60 // FIXME: Handle iteration values which overflow int. |
61 return m_effect->sample(static_cast<int>(iteration), timeFraction(), iterati
onDuration(), result); | 61 return m_effect->sample(static_cast<int>(iteration), timeFraction(), iterati
onDuration(), result); |
62 } | 62 } |
63 | 63 |
64 double InertAnimation::calculateTimeToEffectChange(bool, double, double) const | 64 double InertAnimation::calculateTimeToEffectChange(bool, double, double) const |
65 { | 65 { |
66 return std::numeric_limits<double>::infinity(); | 66 return std::numeric_limits<double>::infinity(); |
67 } | 67 } |
68 | 68 |
69 DEFINE_TRACE(InertAnimation) | 69 DEFINE_TRACE(InertAnimation) |
70 { | 70 { |
71 visitor->trace(m_effect); | 71 visitor->trace(m_effect); |
72 AnimationNode::trace(visitor); | 72 AnimationEffect::trace(visitor); |
73 } | 73 } |
74 | 74 |
75 } // namespace blink | 75 } // namespace blink |
OLD | NEW |