Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / animation / SampledEffect.h
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
3 // found in the LICENSE file.
4
5 #ifndef SampledEffect_h
6 #define SampledEffect_h
7
8 #include "core/animation/Animation.h"
9 #include "core/animation/AnimationPlayer.h"
10 #include "core/animation/Interpolation.h"
11 #include "wtf/BitArray.h"
12 #include "wtf/Vector.h"
13
14 namespace blink {
15
16 class SampledEffect : public NoBaseWillBeGarbageCollected<SampledEffect> {
17 public:
18     static PassOwnPtrWillBeRawPtr<SampledEffect> create(Animation* animation, PassOwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation> > > interpolations)
19     {
20         return adoptPtrWillBeNoop(new SampledEffect(animation, interpolations));
21     }
22
23     bool canChange() const;
24     void clear();
25
26     const WillBeHeapVector<RefPtrWillBeMember<Interpolation> >& interpolations() const { return *m_interpolations; }
27     void setInterpolations(PassOwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation> > > interpolations) { m_interpolations = interpolations; }
28
29     Animation* animation() const { return m_animation; }
30     unsigned sequenceNumber() const { return m_sequenceNumber; }
31     Animation::Priority priority() const { return m_priority; }
32
33     void removeReplacedInterpolationsIfNeeded(const BitArray<numCSSProperties>&);
34
35     void trace(Visitor*);
36
37 private:
38     SampledEffect(Animation*, PassOwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolation> > >);
39
40     RawPtrWillBeWeakMember<Animation> m_animation;
41 #if !ENABLE(OILPAN)
42     RefPtr<AnimationPlayer> m_player;
43 #endif
44     OwnPtrWillBeMember<WillBeHeapVector<RefPtrWillBeMember<Interpolation> > > m_interpolations;
45     const unsigned m_sequenceNumber;
46     Animation::Priority m_priority;
47 };
48
49 } // namespace blink
50
51 #endif