Chromium Code Reviews| 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 WebCore { | 14 namespace WebCore { |
| 15 | 15 |
| 16 class SampledEffect { | 16 class SampledEffect : public NoBaseWillBeGarbageCollected<SampledEffect> { |
| 17 public: | 17 public: |
| 18 static PassOwnPtr<SampledEffect> create(Animation* animation, PassOwnPtrWill BeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation> > > interpolations) | 18 static PassOwnPtrWillBeRawPtr<SampledEffect> create(Animation* animation, Pa ssOwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation> > > inte rpolations) |
| 19 { | 19 { |
| 20 return adoptPtr(new SampledEffect(animation, interpolations)); | 20 return adoptPtrWillBeNoop(new SampledEffect(animation, interpolations)); |
| 21 } | 21 } |
| 22 | 22 |
| 23 bool canChange() const; | 23 bool canChange() const; |
| 24 void clear(); | 24 void clear(); |
| 25 | 25 |
| 26 const WillBeHeapVector<RefPtrWillBeMember<Interpolation> >& interpolations() const { return *m_interpolations; } | 26 const WillBeHeapVector<RefPtrWillBeMember<Interpolation> >& interpolations() const { return *m_interpolations; } |
| 27 void setInterpolations(PassOwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeM ember<Interpolation> > > interpolations) { m_interpolations = interpolations; } | 27 void setInterpolations(PassOwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeM ember<Interpolation> > > interpolations) { m_interpolations = interpolations; } |
| 28 | 28 |
| 29 Animation* animation() const { return m_animation; } | 29 Animation* animation() const { return m_animation; } |
| 30 const AnimationPlayer::SortInfo& sortInfo() const { return m_playerSortInfo; } | 30 const AnimationPlayer::SortInfo& sortInfo() const { return m_playerSortInfo; } |
| 31 Animation::Priority priority() const { return m_priority; } | 31 Animation::Priority priority() const { return m_priority; } |
| 32 | 32 |
| 33 void removeReplacedInterpolationsIfNeeded(const BitArray<numCSSProperties>&) ; | 33 void removeReplacedInterpolationsIfNeeded(const BitArray<numCSSProperties>&) ; |
| 34 | 34 |
| 35 void trace(Visitor*); | |
| 36 | |
| 35 private: | 37 private: |
| 36 SampledEffect(Animation*, PassOwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWill BeMember<Interpolation> > >); | 38 SampledEffect(Animation*, PassOwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWill BeMember<Interpolation> > >); |
| 37 | 39 |
| 38 // When Animation and AnimationPlayer are moved to Oilpan, we won't need a | 40 RefPtrWillBeWeakMember<AnimationPlayer> m_player; |
|
Mads Ager (chromium)
2014/05/15 08:36:54
Instead of making this a WeakMember you can comple
haraken
2014/05/16 07:41:22
Done.
| |
| 39 // handle on the player and should only keep a weak pointer to the animation . | 41 RawPtrWillBeWeakMember<Animation> m_animation; |
| 40 RefPtr<AnimationPlayer> m_player; | 42 OwnPtrWillBeMember<WillBeHeapVector<RefPtrWillBeMember<Interpolation> > > m_ interpolations; |
| 41 Animation* m_animation; | |
| 42 OwnPtrWillBePersistent<WillBeHeapVector<RefPtrWillBeMember<Interpolation> > > m_interpolations; | |
| 43 AnimationPlayer::SortInfo m_playerSortInfo; | 43 AnimationPlayer::SortInfo m_playerSortInfo; |
| 44 Animation::Priority m_priority; | 44 Animation::Priority m_priority; |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 } // namespace WebCore | 47 } // namespace WebCore |
| 48 | 48 |
| 49 #endif | 49 #endif |
| OLD | NEW |