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