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 // TODO(haraken): Drop Finalized once we ship Oilpan and the OwnPtrWillBeMember |
tkent
2015/09/01 22:59:22
We should introduce GarbageCollectedFinalizedWillB
| |
20 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(SampledEffect); | 20 // is gone. |
21 class SampledEffect : public GarbageCollectedFinalized<SampledEffect> { | |
21 WTF_MAKE_NONCOPYABLE(SampledEffect); | 22 WTF_MAKE_NONCOPYABLE(SampledEffect); |
22 public: | 23 public: |
23 static PassOwnPtrWillBeRawPtr<SampledEffect> create(KeyframeEffect* animatio n, PassOwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> i nterpolations) | 24 static SampledEffect* create(KeyframeEffect* animation, PassOwnPtrWillBeRawP tr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> interpolations) |
24 { | 25 { |
25 return adoptPtrWillBeNoop(new SampledEffect(animation, interpolations)); | 26 return new SampledEffect(animation, interpolations); |
26 } | 27 } |
27 | 28 |
28 void clear(); | 29 void clear(); |
29 | 30 |
30 const WillBeHeapVector<RefPtrWillBeMember<Interpolation>>& interpolations() const { return *m_interpolations; } | 31 const WillBeHeapVector<RefPtrWillBeMember<Interpolation>>& interpolations() const { return *m_interpolations; } |
31 #if ENABLE(OILPAN) | 32 #if ENABLE(OILPAN) |
32 RawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> mutableInterpola tions() { return m_interpolations.get(); } | 33 RawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> mutableInterpola tions() { return m_interpolations.get(); } |
33 #else | 34 #else |
34 PassOwnPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> mutableInter polations() { return m_interpolations.release(); } | 35 PassOwnPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> mutableInter polations() { return m_interpolations.release(); } |
35 #endif | 36 #endif |
36 | 37 |
37 void setInterpolations(PassOwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeM ember<Interpolation>>> interpolations) { m_interpolations = interpolations; } | 38 void setInterpolations(PassOwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeM ember<Interpolation>>> interpolations) { m_interpolations = interpolations; } |
38 | 39 |
39 KeyframeEffect* effect() const { return m_effect; } | 40 KeyframeEffect* effect() const { return m_effect; } |
40 unsigned sequenceNumber() const { return m_sequenceNumber; } | 41 unsigned sequenceNumber() const { return m_sequenceNumber; } |
41 KeyframeEffect::Priority priority() const { return m_priority; } | 42 KeyframeEffect::Priority priority() const { return m_priority; } |
42 | 43 |
43 DECLARE_TRACE(); | 44 DECLARE_TRACE(); |
44 | 45 |
45 void applySVGUpdate(SVGElement&); | 46 void applySVGUpdate(SVGElement&); |
46 | 47 |
47 private: | 48 private: |
48 SampledEffect(KeyframeEffect*, PassOwnPtrWillBeRawPtr<WillBeHeapVector<RefPt rWillBeMember<Interpolation>>>); | 49 SampledEffect(KeyframeEffect*, PassOwnPtrWillBeRawPtr<WillBeHeapVector<RefPt rWillBeMember<Interpolation>>>); |
49 | 50 |
50 RawPtrWillBeWeakMember<KeyframeEffect> m_effect; | 51 WeakMember<KeyframeEffect> m_effect; |
51 RefPtrWillBeMember<Animation> m_animation; | 52 Member<Animation> m_animation; |
52 OwnPtrWillBeMember<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> m_in terpolations; | 53 OwnPtrWillBeMember<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> m_in terpolations; |
53 const unsigned m_sequenceNumber; | 54 const unsigned m_sequenceNumber; |
54 KeyframeEffect::Priority m_priority; | 55 KeyframeEffect::Priority m_priority; |
55 }; | 56 }; |
56 | 57 |
57 } // namespace blink | 58 } // namespace blink |
58 | 59 |
59 #endif // SampledEffect_h | 60 #endif // SampledEffect_h |
OLD | NEW |