Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 AnimationEffect::CompositeOperation composite() const { return m_composite; } | 66 AnimationEffect::CompositeOperation composite() const { return m_composite; } |
| 67 void setEasing(PassRefPtr<TimingFunction>); | 67 void setEasing(PassRefPtr<TimingFunction>); |
| 68 TimingFunction* easing() const { return m_easing.get(); } | 68 TimingFunction* easing() const { return m_easing.get(); } |
| 69 void setPropertyValue(CSSPropertyID, const AnimatableValue*); | 69 void setPropertyValue(CSSPropertyID, const AnimatableValue*); |
| 70 void clearPropertyValue(CSSPropertyID); | 70 void clearPropertyValue(CSSPropertyID); |
| 71 const AnimatableValue* propertyValue(CSSPropertyID) const; | 71 const AnimatableValue* propertyValue(CSSPropertyID) const; |
| 72 PropertySet properties() const; | 72 PropertySet properties() const; |
| 73 PassRefPtrWillBeRawPtr<Keyframe> clone() const { return adoptRefWillBeNoop(n ew Keyframe(*this)); } | 73 PassRefPtrWillBeRawPtr<Keyframe> clone() const { return adoptRefWillBeNoop(n ew Keyframe(*this)); } |
| 74 PassRefPtrWillBeRawPtr<Keyframe> cloneWithOffset(double offset) const; | 74 PassRefPtrWillBeRawPtr<Keyframe> cloneWithOffset(double offset) const; |
| 75 | 75 |
| 76 void trace(Visitor*) { } | 76 void trace(Visitor*); |
| 77 | |
| 77 private: | 78 private: |
| 78 Keyframe(); | 79 Keyframe(); |
| 79 Keyframe(const Keyframe&); | 80 Keyframe(const Keyframe&); |
| 80 double m_offset; | 81 double m_offset; |
| 81 AnimationEffect::CompositeOperation m_composite; | 82 AnimationEffect::CompositeOperation m_composite; |
| 82 RefPtr<TimingFunction> m_easing; | 83 RefPtr<TimingFunction> m_easing; |
| 83 typedef HashMap<CSSPropertyID, RefPtr<AnimatableValue> > PropertyValueMap; | 84 typedef WillBeHeapHashMap<CSSPropertyID, RefPtrWillBeMember<AnimatableValue> > PropertyValueMap; |
| 84 PropertyValueMap m_propertyValues; | 85 PropertyValueMap m_propertyValues; |
| 85 }; | 86 }; |
| 86 | 87 |
| 87 class KeyframeEffectModel FINAL : public AnimationEffect { | 88 class KeyframeEffectModel FINAL : public AnimationEffect { |
| 88 public: | 89 public: |
| 89 class PropertySpecificKeyframe; | 90 class PropertySpecificKeyframe; |
| 90 typedef WillBeHeapVector<RefPtrWillBeMember<Keyframe> > KeyframeVector; | 91 typedef WillBeHeapVector<RefPtrWillBeMember<Keyframe> > KeyframeVector; |
| 91 typedef Vector<OwnPtr<PropertySpecificKeyframe> > PropertySpecificKeyframeVe ctor; | 92 typedef Vector<OwnPtr<PropertySpecificKeyframe> > PropertySpecificKeyframeVe ctor; |
| 92 // FIXME: Implement accumulation. | 93 // FIXME: Implement accumulation. |
| 93 static PassRefPtrWillBeRawPtr<KeyframeEffectModel> create(const KeyframeVect or& keyframes) | 94 static PassRefPtrWillBeRawPtr<KeyframeEffectModel> create(const KeyframeVect or& keyframes) |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 116 class PropertySpecificKeyframe { | 117 class PropertySpecificKeyframe { |
| 117 public: | 118 public: |
| 118 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin g, const AnimatableValue*, CompositeOperation); | 119 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin g, const AnimatableValue*, CompositeOperation); |
| 119 double offset() const { return m_offset; } | 120 double offset() const { return m_offset; } |
| 120 TimingFunction* easing() const { return m_easing.get(); } | 121 TimingFunction* easing() const { return m_easing.get(); } |
| 121 const AnimatableValue* value() const { return m_value.get(); } | 122 const AnimatableValue* value() const { return m_value.get(); } |
| 122 AnimationEffect::CompositeOperation composite() const { return m_composi te; } | 123 AnimationEffect::CompositeOperation composite() const { return m_composi te; } |
| 123 PassOwnPtr<PropertySpecificKeyframe> cloneWithOffset(double offset) cons t; | 124 PassOwnPtr<PropertySpecificKeyframe> cloneWithOffset(double offset) cons t; |
| 124 private: | 125 private: |
| 125 // Used by cloneWithOffset(). | 126 // Used by cloneWithOffset(). |
| 126 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin g, PassRefPtr<AnimatableValue>, CompositeOperation); | 127 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin g, PassRefPtrWillBeRawPtr<AnimatableValue>, CompositeOperation); |
| 127 double m_offset; | 128 double m_offset; |
| 128 RefPtr<TimingFunction> m_easing; | 129 RefPtr<TimingFunction> m_easing; |
| 129 RefPtr<AnimatableValue> m_value; | 130 RefPtrWillBeMember<AnimatableValue> m_value; |
|
Mads Ager (chromium)
2014/03/20 14:51:55
Is PropertySpecificKeyframe STACK_ALLOCATED, if so
haraken
2014/03/21 13:45:04
Nice catch. PropertySpecificKeyframe needs to be a
| |
| 130 AnimationEffect::CompositeOperation m_composite; | 131 AnimationEffect::CompositeOperation m_composite; |
| 131 }; | 132 }; |
| 132 | 133 |
| 133 class PropertySpecificKeyframeGroup { | 134 class PropertySpecificKeyframeGroup { |
| 134 public: | 135 public: |
| 135 void appendKeyframe(PassOwnPtr<PropertySpecificKeyframe>); | 136 void appendKeyframe(PassOwnPtr<PropertySpecificKeyframe>); |
| 136 const PropertySpecificKeyframeVector& keyframes() const { return m_keyfr ames; } | 137 const PropertySpecificKeyframeVector& keyframes() const { return m_keyfr ames; } |
| 137 private: | 138 private: |
| 138 PropertySpecificKeyframeVector m_keyframes; | 139 PropertySpecificKeyframeVector m_keyframes; |
| 139 void removeRedundantKeyframes(); | 140 void removeRedundantKeyframes(); |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 169 mutable RefPtr<InterpolationEffect> m_interpolationEffect; | 170 mutable RefPtr<InterpolationEffect> m_interpolationEffect; |
| 170 | 171 |
| 171 friend class KeyframeEffectModelTest; | 172 friend class KeyframeEffectModelTest; |
| 172 }; | 173 }; |
| 173 | 174 |
| 174 DEFINE_TYPE_CASTS(KeyframeEffectModel, AnimationEffect, value, value->isKeyframe EffectModel(), value.isKeyframeEffectModel()); | 175 DEFINE_TYPE_CASTS(KeyframeEffectModel, AnimationEffect, value, value->isKeyframe EffectModel(), value.isKeyframeEffectModel()); |
| 175 | 176 |
| 176 } // namespace WebCore | 177 } // namespace WebCore |
| 177 | 178 |
| 178 #endif // KeyframeEffectModel_h | 179 #endif // KeyframeEffectModel_h |
| OLD | NEW |