| 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 Keyframe_h | 5 #ifndef Keyframe_h |
| 6 #define Keyframe_h | 6 #define Keyframe_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/animation/AnimationEffect.h" | 9 #include "core/animation/AnimationEffect.h" |
| 10 #include "core/animation/EffectModel.h" | 10 #include "core/animation/EffectModel.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 RefPtrWillBeRawPtr<Keyframe> theClone = clone(); | 45 RefPtrWillBeRawPtr<Keyframe> theClone = clone(); |
| 46 theClone->setOffset(offset); | 46 theClone->setOffset(offset); |
| 47 return theClone.release(); | 47 return theClone.release(); |
| 48 } | 48 } |
| 49 | 49 |
| 50 virtual bool isAnimatableValueKeyframe() const { return false; } | 50 virtual bool isAnimatableValueKeyframe() const { return false; } |
| 51 virtual bool isStringKeyframe() const { return false; } | 51 virtual bool isStringKeyframe() const { return false; } |
| 52 | 52 |
| 53 DEFINE_INLINE_VIRTUAL_TRACE() { } | 53 DEFINE_INLINE_VIRTUAL_TRACE() { } |
| 54 | 54 |
| 55 class PropertySpecificKeyframe : public NoBaseWillBeGarbageCollectedFinalize
d<PropertySpecificKeyframe> { | 55 class PropertySpecificKeyframe : public RefCountedWillBeGarbageCollectedFina
lized<PropertySpecificKeyframe> { |
| 56 public: | 56 public: |
| 57 virtual ~PropertySpecificKeyframe() { } | 57 virtual ~PropertySpecificKeyframe() { } |
| 58 double offset() const { return m_offset; } | 58 double offset() const { return m_offset; } |
| 59 TimingFunction& easing() const { return *m_easing; } | 59 TimingFunction& easing() const { return *m_easing; } |
| 60 EffectModel::CompositeOperation composite() const { return m_composite;
} | 60 EffectModel::CompositeOperation composite() const { return m_composite;
} |
| 61 virtual PassOwnPtrWillBeRawPtr<PropertySpecificKeyframe> cloneWithOffset
(double offset) const = 0; | 61 virtual PassRefPtrWillBeRawPtr<PropertySpecificKeyframe> cloneWithOffset
(double offset) const = 0; |
| 62 | 62 |
| 63 // FIXME: Remove this once CompositorAnimations no longer depends on Ani
matableValues | 63 // FIXME: Remove this once CompositorAnimations no longer depends on Ani
matableValues |
| 64 virtual void populateAnimatableValue(CSSPropertyID, Element&, const Comp
utedStyle* baseStyle) const { } | 64 virtual void populateAnimatableValue(CSSPropertyID, Element&, const Comp
utedStyle* baseStyle) const { } |
| 65 virtual const PassRefPtrWillBeRawPtr<AnimatableValue> getAnimatableValue
() const = 0; | 65 virtual const PassRefPtrWillBeRawPtr<AnimatableValue> getAnimatableValue
() const = 0; |
| 66 | 66 |
| 67 virtual bool isAnimatableValuePropertySpecificKeyframe() const { return
false; } | 67 virtual bool isAnimatableValuePropertySpecificKeyframe() const { return
false; } |
| 68 virtual bool isCSSPropertySpecificKeyframe() const { return false; } | 68 virtual bool isCSSPropertySpecificKeyframe() const { return false; } |
| 69 virtual bool isSVGPropertySpecificKeyframe() const { return false; } | 69 virtual bool isSVGPropertySpecificKeyframe() const { return false; } |
| 70 | 70 |
| 71 virtual PassOwnPtrWillBeRawPtr<PropertySpecificKeyframe> neutralKeyframe
(double offset, PassRefPtr<TimingFunction> easing) const = 0; | 71 virtual PassRefPtrWillBeRawPtr<PropertySpecificKeyframe> neutralKeyframe
(double offset, PassRefPtr<TimingFunction> easing) const = 0; |
| 72 virtual PassRefPtrWillBeRawPtr<Interpolation> maybeCreateInterpolation(P
ropertyHandle, Keyframe::PropertySpecificKeyframe& end, Element*, const Computed
Style* baseStyle) const = 0; | 72 virtual PassRefPtrWillBeRawPtr<Interpolation> maybeCreateInterpolation(P
ropertyHandle, Keyframe::PropertySpecificKeyframe& end, Element*, const Computed
Style* baseStyle) = 0; |
| 73 | 73 |
| 74 DEFINE_INLINE_VIRTUAL_TRACE() { } | 74 DEFINE_INLINE_VIRTUAL_TRACE() { } |
| 75 | 75 |
| 76 protected: | 76 protected: |
| 77 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin
g, EffectModel::CompositeOperation); | 77 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin
g, EffectModel::CompositeOperation); |
| 78 | 78 |
| 79 double m_offset; | 79 double m_offset; |
| 80 RefPtr<TimingFunction> m_easing; | 80 RefPtr<TimingFunction> m_easing; |
| 81 EffectModel::CompositeOperation m_composite; | 81 EffectModel::CompositeOperation m_composite; |
| 82 }; | 82 }; |
| 83 | 83 |
| 84 virtual PassOwnPtrWillBeRawPtr<PropertySpecificKeyframe> createPropertySpeci
ficKeyframe(PropertyHandle) const = 0; | 84 virtual PassRefPtrWillBeRawPtr<PropertySpecificKeyframe> createPropertySpeci
ficKeyframe(PropertyHandle) const = 0; |
| 85 | 85 |
| 86 protected: | 86 protected: |
| 87 Keyframe() | 87 Keyframe() |
| 88 : m_offset(nullValue()) | 88 : m_offset(nullValue()) |
| 89 , m_composite(EffectModel::CompositeReplace) | 89 , m_composite(EffectModel::CompositeReplace) |
| 90 , m_easing(LinearTimingFunction::shared()) | 90 , m_easing(LinearTimingFunction::shared()) |
| 91 { | 91 { |
| 92 } | 92 } |
| 93 Keyframe(double offset, EffectModel::CompositeOperation composite, PassRefPt
r<TimingFunction> easing) | 93 Keyframe(double offset, EffectModel::CompositeOperation composite, PassRefPt
r<TimingFunction> easing) |
| 94 : m_offset(offset) | 94 : m_offset(offset) |
| 95 , m_composite(composite) | 95 , m_composite(composite) |
| 96 , m_easing(easing) | 96 , m_easing(easing) |
| 97 { | 97 { |
| 98 } | 98 } |
| 99 | 99 |
| 100 double m_offset; | 100 double m_offset; |
| 101 EffectModel::CompositeOperation m_composite; | 101 EffectModel::CompositeOperation m_composite; |
| 102 RefPtr<TimingFunction> m_easing; | 102 RefPtr<TimingFunction> m_easing; |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 } // namespace blink | 105 } // namespace blink |
| 106 | 106 |
| 107 #endif // Keyframe_h | 107 #endif // Keyframe_h |
| OLD | NEW |