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/AnimationPlayer.h" | 9 #include "core/animation/AnimationPlayer.h" |
10 #include "core/animation/Interpolation.h" | 10 #include "core/animation/Interpolation.h" |
11 #include "wtf/BitArray.h" | 11 #include "wtf/BitArray.h" |
12 #include "wtf/Vector.h" | 12 #include "wtf/Vector.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 class SampledEffect : public NoBaseWillBeGarbageCollected<SampledEffect> { | 16 class SampledEffect : public NoBaseWillBeGarbageCollected<SampledEffect> { |
17 public: | 17 public: |
18 static PassOwnPtrWillBeRawPtr<SampledEffect> create(Animation* animation, Pa
ssOwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation> > > inte
rpolations) | 18 static PassOwnPtrWillBeRawPtr<SampledEffect> create(Animation* animation, Pa
ssOwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation> > > inte
rpolations) |
19 { | 19 { |
20 return adoptPtrWillBeNoop(new SampledEffect(animation, interpolations)); | 20 return adoptPtrWillBeNoop(new SampledEffect(animation, interpolations)); |
21 } | 21 } |
22 | 22 |
23 bool canChange() const; | |
24 void clear(); | 23 void clear(); |
25 | 24 |
26 const WillBeHeapVector<RefPtrWillBeMember<Interpolation> >& interpolations()
const { return *m_interpolations; } | 25 const WillBeHeapVector<RefPtrWillBeMember<Interpolation> >& interpolations()
const { return *m_interpolations; } |
27 #if ENABLE(OILPAN) | 26 #if ENABLE(OILPAN) |
28 RawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> mutableInterpola
tions() { return m_interpolations.get(); } | 27 RawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> mutableInterpola
tions() { return m_interpolations.get(); } |
29 #else | 28 #else |
30 PassOwnPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> mutableInter
polations() { return m_interpolations.release(); } | 29 PassOwnPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> mutableInter
polations() { return m_interpolations.release(); } |
31 #endif | 30 #endif |
32 | 31 |
33 void setInterpolations(PassOwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeM
ember<Interpolation> > > interpolations) { m_interpolations = interpolations; } | 32 void setInterpolations(PassOwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeM
ember<Interpolation> > > interpolations) { m_interpolations = interpolations; } |
34 | 33 |
35 Animation* animation() const { return m_animation; } | 34 Animation* animation() const { return m_animation; } |
36 unsigned sequenceNumber() const { return m_sequenceNumber; } | 35 unsigned sequenceNumber() const { return m_sequenceNumber; } |
37 Animation::Priority priority() const { return m_priority; } | 36 Animation::Priority priority() const { return m_priority; } |
38 | 37 |
39 void removeReplacedInterpolationsIfNeeded(const BitArray<numCSSProperties>&)
; | |
40 | |
41 DECLARE_TRACE(); | 38 DECLARE_TRACE(); |
42 | 39 |
43 private: | 40 private: |
44 SampledEffect(Animation*, PassOwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWill
BeMember<Interpolation> > >); | 41 SampledEffect(Animation*, PassOwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWill
BeMember<Interpolation> > >); |
45 | 42 |
46 RawPtrWillBeWeakMember<Animation> m_animation; | 43 RawPtrWillBeWeakMember<Animation> m_animation; |
47 #if !ENABLE(OILPAN) | 44 RefPtrWillBeMember<AnimationPlayer> m_player; |
48 RefPtr<AnimationPlayer> m_player; | |
49 #endif | |
50 OwnPtrWillBeMember<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> m_in
terpolations; | 45 OwnPtrWillBeMember<WillBeHeapVector<RefPtrWillBeMember<Interpolation>>> m_in
terpolations; |
51 const unsigned m_sequenceNumber; | 46 const unsigned m_sequenceNumber; |
52 Animation::Priority m_priority; | 47 Animation::Priority m_priority; |
53 }; | 48 }; |
54 | 49 |
55 } // namespace blink | 50 } // namespace blink |
56 | 51 |
57 #endif // SampledEffect_h | 52 #endif // SampledEffect_h |
OLD | NEW |