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; |
|
Mads Ager (chromium)
2014/03/21 13:52:54
In particular, this one does not trace the Propert
| |
| 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) |
| 94 { | 95 { |
| 95 return adoptRefWillBeNoop(new KeyframeEffectModel(keyframes)); | 96 return adoptRefWillBeNoop(new KeyframeEffectModel(keyframes)); |
| 96 } | 97 } |
| 97 | 98 |
| 98 virtual bool affects(CSSPropertyID property) OVERRIDE | 99 virtual bool affects(CSSPropertyID property) OVERRIDE |
| 99 { | 100 { |
| 100 ensureKeyframeGroups(); | 101 ensureKeyframeGroups(); |
| 101 return m_keyframeGroups->contains(property); | 102 return m_keyframeGroups->contains(property); |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 113 | 114 |
| 114 PropertySet properties() const; | 115 PropertySet properties() const; |
| 115 | 116 |
| 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; |
|
Mads Ager (chromium)
2014/03/21 13:49:30
Where is this PassOwnPtr consumed? Are you tracing
| |
| 125 | |
| 126 void trace(Visitor* visitor) | |
| 127 { | |
| 128 visitor->trace(m_value); | |
| 129 } | |
| 130 | |
| 124 private: | 131 private: |
| 125 // Used by cloneWithOffset(). | 132 // Used by cloneWithOffset(). |
| 126 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin g, PassRefPtr<AnimatableValue>, CompositeOperation); | 133 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin g, PassRefPtrWillBeRawPtr<AnimatableValue>, CompositeOperation); |
| 127 double m_offset; | 134 double m_offset; |
| 128 RefPtr<TimingFunction> m_easing; | 135 RefPtr<TimingFunction> m_easing; |
| 129 RefPtr<AnimatableValue> m_value; | 136 RefPtrWillBeMember<AnimatableValue> m_value; |
| 130 AnimationEffect::CompositeOperation m_composite; | 137 AnimationEffect::CompositeOperation m_composite; |
| 131 }; | 138 }; |
| 132 | 139 |
| 133 class PropertySpecificKeyframeGroup { | 140 class PropertySpecificKeyframeGroup { |
| 134 public: | 141 public: |
| 135 void appendKeyframe(PassOwnPtr<PropertySpecificKeyframe>); | 142 void appendKeyframe(PassOwnPtr<PropertySpecificKeyframe>); |
| 136 const PropertySpecificKeyframeVector& keyframes() const { return m_keyfr ames; } | 143 const PropertySpecificKeyframeVector& keyframes() const { return m_keyfr ames; } |
| 137 private: | 144 private: |
| 138 PropertySpecificKeyframeVector m_keyframes; | 145 PropertySpecificKeyframeVector m_keyframes; |
| 139 void removeRedundantKeyframes(); | 146 void removeRedundantKeyframes(); |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 169 mutable RefPtr<InterpolationEffect> m_interpolationEffect; | 176 mutable RefPtr<InterpolationEffect> m_interpolationEffect; |
| 170 | 177 |
| 171 friend class KeyframeEffectModelTest; | 178 friend class KeyframeEffectModelTest; |
| 172 }; | 179 }; |
| 173 | 180 |
| 174 DEFINE_TYPE_CASTS(KeyframeEffectModel, AnimationEffect, value, value->isKeyframe EffectModel(), value.isKeyframeEffectModel()); | 181 DEFINE_TYPE_CASTS(KeyframeEffectModel, AnimationEffect, value, value->isKeyframe EffectModel(), value.isKeyframeEffectModel()); |
| 175 | 182 |
| 176 } // namespace WebCore | 183 } // namespace WebCore |
| 177 | 184 |
| 178 #endif // KeyframeEffectModel_h | 185 #endif // KeyframeEffectModel_h |
| OLD | NEW |