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 #ifndef SampledEffect_h | 5 #ifndef SampledEffect_h |
6 #define SampledEffect_h | 6 #define SampledEffect_h |
7 | 7 |
8 #include "core/animation/Animation.h" | 8 #include "core/animation/Animation.h" |
9 #include "core/animation/Interpolation.h" | 9 #include "core/animation/Interpolation.h" |
10 #include "core/animation/KeyframeEffect.h" | 10 #include "core/animation/KeyframeEffect.h" |
11 #include "wtf/Allocator.h" | 11 #include "wtf/Allocator.h" |
12 #include "wtf/BitArray.h" | 12 #include "wtf/BitArray.h" |
13 #include "wtf/Vector.h" | 13 #include "wtf/Vector.h" |
14 | 14 |
15 namespace blink { | 15 namespace blink { |
16 | 16 |
17 class SVGElement; | 17 class SVGElement; |
18 | 18 |
19 class SampledEffect : public NoBaseWillBeGarbageCollected<SampledEffect> { | 19 class SampledEffect : public GarbageCollectedFinalized<SampledEffect> { |
alancutter (OOO until 2018)
2015/09/01 08:00:42
Not sure why this needs finalising.
sof
2015/09/01 08:13:06
The OwnPtrWillBeMember<> field brings that about -
haraken
2015/09/01 08:53:58
Added a TODO.
| |
20 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(SampledEffect); | |
21 WTF_MAKE_NONCOPYABLE(SampledEffect); | 20 WTF_MAKE_NONCOPYABLE(SampledEffect); |
22 public: | 21 public: |
23 static PassOwnPtrWillBeRawPtr<SampledEffect> create(KeyframeEffect* animatio n, PassOwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> i nterpolations) | 22 static SampledEffect* create(KeyframeEffect* animation, PassOwnPtrWillBeRawP tr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> interpolations) |
24 { | 23 { |
25 return adoptPtrWillBeNoop(new SampledEffect(animation, interpolations)); | 24 return new SampledEffect(animation, interpolations); |
26 } | 25 } |
27 | 26 |
28 void clear(); | 27 void clear(); |
29 | 28 |
30 const WillBeHeapVector<RefPtrWillBeMember<Interpolation>>& interpolations() const { return *m_interpolations; } | 29 const WillBeHeapVector<RefPtrWillBeMember<Interpolation>>& interpolations() const { return *m_interpolations; } |
31 #if ENABLE(OILPAN) | 30 #if ENABLE(OILPAN) |
32 RawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> mutableInterpola tions() { return m_interpolations.get(); } | 31 RawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> mutableInterpola tions() { return m_interpolations.get(); } |
33 #else | 32 #else |
34 PassOwnPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> mutableInter polations() { return m_interpolations.release(); } | 33 PassOwnPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> mutableInter polations() { return m_interpolations.release(); } |
35 #endif | 34 #endif |
36 | 35 |
37 void setInterpolations(PassOwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeM ember<Interpolation>>> interpolations) { m_interpolations = interpolations; } | 36 void setInterpolations(PassOwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeM ember<Interpolation>>> interpolations) { m_interpolations = interpolations; } |
38 | 37 |
39 KeyframeEffect* effect() const { return m_effect; } | 38 KeyframeEffect* effect() const { return m_effect; } |
40 unsigned sequenceNumber() const { return m_sequenceNumber; } | 39 unsigned sequenceNumber() const { return m_sequenceNumber; } |
41 KeyframeEffect::Priority priority() const { return m_priority; } | 40 KeyframeEffect::Priority priority() const { return m_priority; } |
42 | 41 |
43 DECLARE_TRACE(); | 42 DECLARE_TRACE(); |
44 | 43 |
45 void applySVGUpdate(SVGElement&); | 44 void applySVGUpdate(SVGElement&); |
46 | 45 |
47 private: | 46 private: |
48 SampledEffect(KeyframeEffect*, PassOwnPtrWillBeRawPtr<WillBeHeapVector<RefPt rWillBeMember<Interpolation>>>); | 47 SampledEffect(KeyframeEffect*, PassOwnPtrWillBeRawPtr<WillBeHeapVector<RefPt rWillBeMember<Interpolation>>>); |
49 | 48 |
50 RawPtrWillBeWeakMember<KeyframeEffect> m_effect; | 49 WeakMember<KeyframeEffect> m_effect; |
51 RefPtrWillBeMember<Animation> m_animation; | 50 Member<Animation> m_animation; |
52 OwnPtrWillBeMember<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> m_in terpolations; | 51 OwnPtrWillBeMember<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> m_in terpolations; |
53 const unsigned m_sequenceNumber; | 52 const unsigned m_sequenceNumber; |
54 KeyframeEffect::Priority m_priority; | 53 KeyframeEffect::Priority m_priority; |
55 }; | 54 }; |
56 | 55 |
57 } // namespace blink | 56 } // namespace blink |
58 | 57 |
59 #endif // SampledEffect_h | 58 #endif // SampledEffect_h |
OLD | NEW |