OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "core/animation/SampledEffect.h" | 6 #include "core/animation/SampledEffect.h" |
7 | 7 |
8 #include "core/animation/SVGInterpolation.h" | 8 #include "core/animation/SVGInterpolation.h" |
9 #include "core/animation/StyleInterpolation.h" | 9 #include "core/animation/StyleInterpolation.h" |
10 #include "core/svg/SVGElement.h" | 10 #include "core/svg/SVGElement.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 SampledEffect::SampledEffect(Animation* animation, PassOwnPtrWillBeRawPtr<WillBe
HeapVector<RefPtrWillBeMember<Interpolation>>> interpolations) | 14 SampledEffect::SampledEffect(KeyframeEffect* effect, PassOwnPtrWillBeRawPtr<Will
BeHeapVector<RefPtrWillBeMember<Interpolation>>> interpolations) |
15 : m_animation(animation) | 15 : m_effect(effect) |
16 , m_player(animation->player()) | 16 , m_animation(effect->animation()) |
17 , m_interpolations(interpolations) | 17 , m_interpolations(interpolations) |
18 , m_sequenceNumber(animation->player()->sequenceNumber()) | 18 , m_sequenceNumber(effect->animation()->sequenceNumber()) |
19 , m_priority(animation->priority()) | 19 , m_priority(effect->priority()) |
20 { | 20 { |
21 ASSERT(m_interpolations && !m_interpolations->isEmpty()); | 21 ASSERT(m_interpolations && !m_interpolations->isEmpty()); |
22 } | 22 } |
23 | 23 |
24 void SampledEffect::clear() | 24 void SampledEffect::clear() |
25 { | 25 { |
26 m_player = nullptr; | 26 m_effect = nullptr; |
27 m_animation = nullptr; | 27 m_animation = nullptr; |
28 m_interpolations->clear(); | 28 m_interpolations->clear(); |
29 } | 29 } |
30 | 30 |
31 DEFINE_TRACE(SampledEffect) | 31 DEFINE_TRACE(SampledEffect) |
32 { | 32 { |
| 33 visitor->trace(m_effect); |
33 visitor->trace(m_animation); | 34 visitor->trace(m_animation); |
34 visitor->trace(m_player); | |
35 #if ENABLE(OILPAN) | 35 #if ENABLE(OILPAN) |
36 visitor->trace(m_interpolations); | 36 visitor->trace(m_interpolations); |
37 #endif | 37 #endif |
38 } | 38 } |
39 | 39 |
40 void SampledEffect::applySVGUpdate(SVGElement& targetElement) | 40 void SampledEffect::applySVGUpdate(SVGElement& targetElement) |
41 { | 41 { |
42 for (const auto& interpolation : *m_interpolations) { | 42 for (const auto& interpolation : *m_interpolations) { |
43 if (interpolation->isSVGInterpolation()) { | 43 if (interpolation->isSVGInterpolation()) { |
44 toSVGInterpolation(interpolation.get())->apply(targetElement); | 44 toSVGInterpolation(interpolation.get())->apply(targetElement); |
45 } | 45 } |
46 } | 46 } |
47 } | 47 } |
48 | 48 |
49 } // namespace blink | 49 } // namespace blink |
OLD | NEW |