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 InterpolationEffect_h | 5 #ifndef InterpolationEffect_h |
6 #define InterpolationEffect_h | 6 #define InterpolationEffect_h |
7 | 7 |
8 #include "core/animation/Interpolation.h" | 8 #include "core/animation/Interpolation.h" |
9 #include "core/animation/Keyframe.h" | 9 #include "core/animation/Keyframe.h" |
10 #include "platform/RuntimeEnabledFeatures.h" | 10 #include "platform/RuntimeEnabledFeatures.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 void addInterpolationsFromKeyframes(CSSPropertyID, Element*, Keyframe::Prope
rtySpecificKeyframe& keyframeA, Keyframe::PropertySpecificKeyframe& keyframeB, d
ouble applyFrom, double applyTo); | 31 void addInterpolationsFromKeyframes(CSSPropertyID, Element*, Keyframe::Prope
rtySpecificKeyframe& keyframeA, Keyframe::PropertySpecificKeyframe& keyframeB, d
ouble applyFrom, double applyTo); |
32 | 32 |
33 template<typename T> | 33 template<typename T> |
34 inline void forEachInterpolation(const T& callback) | 34 inline void forEachInterpolation(const T& callback) |
35 { | 35 { |
36 for (auto& record : m_interpolations) | 36 for (auto& record : m_interpolations) |
37 callback(*record->m_interpolation); | 37 callback(*record->m_interpolation); |
38 } | 38 } |
39 | 39 |
40 void trace(Visitor*); | 40 DECLARE_TRACE(); |
41 | 41 |
42 private: | 42 private: |
43 InterpolationEffect() | 43 InterpolationEffect() |
44 { | 44 { |
45 } | 45 } |
46 | 46 |
47 class InterpolationRecord : public NoBaseWillBeGarbageCollectedFinalized<Int
erpolationRecord> { | 47 class InterpolationRecord : public NoBaseWillBeGarbageCollectedFinalized<Int
erpolationRecord> { |
48 public: | 48 public: |
49 RefPtrWillBeMember<Interpolation> m_interpolation; | 49 RefPtrWillBeMember<Interpolation> m_interpolation; |
50 RefPtr<TimingFunction> m_easing; | 50 RefPtr<TimingFunction> m_easing; |
51 double m_start; | 51 double m_start; |
52 double m_end; | 52 double m_end; |
53 double m_applyFrom; | 53 double m_applyFrom; |
54 double m_applyTo; | 54 double m_applyTo; |
55 | 55 |
56 static PassOwnPtrWillBeRawPtr<InterpolationRecord> create(PassRefPtrWill
BeRawPtr<Interpolation> interpolation, PassRefPtr<TimingFunction> easing, double
start, double end, double applyFrom, double applyTo) | 56 static PassOwnPtrWillBeRawPtr<InterpolationRecord> create(PassRefPtrWill
BeRawPtr<Interpolation> interpolation, PassRefPtr<TimingFunction> easing, double
start, double end, double applyFrom, double applyTo) |
57 { | 57 { |
58 return adoptPtrWillBeNoop(new InterpolationRecord(interpolation, eas
ing, start, end, applyFrom, applyTo)); | 58 return adoptPtrWillBeNoop(new InterpolationRecord(interpolation, eas
ing, start, end, applyFrom, applyTo)); |
59 } | 59 } |
60 | 60 |
61 void trace(Visitor*); | 61 DECLARE_TRACE(); |
62 | 62 |
63 private: | 63 private: |
64 InterpolationRecord(PassRefPtrWillBeRawPtr<Interpolation> interpolation,
PassRefPtr<TimingFunction> easing, double start, double end, double applyFrom,
double applyTo) | 64 InterpolationRecord(PassRefPtrWillBeRawPtr<Interpolation> interpolation,
PassRefPtr<TimingFunction> easing, double start, double end, double applyFrom,
double applyTo) |
65 : m_interpolation(interpolation) | 65 : m_interpolation(interpolation) |
66 , m_easing(easing) | 66 , m_easing(easing) |
67 , m_start(start) | 67 , m_start(start) |
68 , m_end(end) | 68 , m_end(end) |
69 , m_applyFrom(applyFrom) | 69 , m_applyFrom(applyFrom) |
70 , m_applyTo(applyTo) | 70 , m_applyTo(applyTo) |
71 { | 71 { |
72 } | 72 } |
73 }; | 73 }; |
74 | 74 |
75 WillBeHeapVector<OwnPtrWillBeMember<InterpolationRecord> > m_interpolations; | 75 WillBeHeapVector<OwnPtrWillBeMember<InterpolationRecord> > m_interpolations; |
76 }; | 76 }; |
77 | 77 |
78 } // namespace blink | 78 } // namespace blink |
79 | 79 |
80 #endif // InterpolationEffect_h | 80 #endif // InterpolationEffect_h |
OLD | NEW |