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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 #include "wtf/Vector.h" | 46 #include "wtf/Vector.h" |
| 47 | 47 |
| 48 namespace WebCore { | 48 namespace WebCore { |
| 49 | 49 |
| 50 class KeyframeEffectModelTest; | 50 class KeyframeEffectModelTest; |
| 51 | 51 |
| 52 class KeyframeEffectModelBase : public AnimationEffect { | 52 class KeyframeEffectModelBase : public AnimationEffect { |
| 53 public: | 53 public: |
| 54 // FIXME: Implement accumulation. | 54 // FIXME: Implement accumulation. |
| 55 | 55 |
| 56 typedef Vector<OwnPtr<Keyframe::PropertySpecificKeyframe> > PropertySpecific KeyframeVector; | 56 typedef WillBeHeapVector<OwnPtrWillBeMember<Keyframe::PropertySpecificKeyfra me> > PropertySpecificKeyframeVector; |
| 57 class PropertySpecificKeyframeGroup { | 57 class PropertySpecificKeyframeGroup : public NoBaseWillBeGarbageCollected<Pr opertySpecificKeyframeGroup> { |
|
zerny-chromium
2014/04/03 05:17:11
nit: FINAL
(Seems reasonable to add when we add a
haraken
2014/04/03 06:11:00
Done.
| |
| 58 public: | 58 public: |
| 59 void appendKeyframe(PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKey frame>); | 59 void appendKeyframe(PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKey frame>); |
| 60 const PropertySpecificKeyframeVector& keyframes() const { return m_keyfr ames; } | 60 const PropertySpecificKeyframeVector& keyframes() const { return m_keyfr ames; } |
| 61 | 61 |
| 62 void trace(Visitor*); | 62 void trace(Visitor*); |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 void removeRedundantKeyframes(); | 65 void removeRedundantKeyframes(); |
| 66 void addSyntheticKeyframeIfRequired(const KeyframeEffectModelBase* conte xt); | 66 void addSyntheticKeyframeIfRequired(const KeyframeEffectModelBase* conte xt); |
| 67 | 67 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 100 // Lazily computes the groups of property-specific keyframes. | 100 // Lazily computes the groups of property-specific keyframes. |
| 101 void ensureKeyframeGroups() const; | 101 void ensureKeyframeGroups() const; |
| 102 void ensureInterpolationEffect() const; | 102 void ensureInterpolationEffect() const; |
| 103 | 103 |
| 104 KeyframeVector m_keyframes; | 104 KeyframeVector m_keyframes; |
| 105 // The spec describes filtering the normalized keyframes at sampling time | 105 // The spec describes filtering the normalized keyframes at sampling time |
| 106 // to get the 'property-specific keyframes'. For efficiency, we cache the | 106 // to get the 'property-specific keyframes'. For efficiency, we cache the |
| 107 // property-specific lists. | 107 // property-specific lists. |
| 108 typedef WillBeHeapHashMap<CSSPropertyID, OwnPtrWillBeMember<PropertySpecific KeyframeGroup> > KeyframeGroupMap; | 108 typedef WillBeHeapHashMap<CSSPropertyID, OwnPtrWillBeMember<PropertySpecific KeyframeGroup> > KeyframeGroupMap; |
| 109 mutable OwnPtrWillBeMember<KeyframeGroupMap> m_keyframeGroups; | 109 mutable OwnPtrWillBeMember<KeyframeGroupMap> m_keyframeGroups; |
| 110 mutable RefPtr<InterpolationEffect> m_interpolationEffect; | 110 mutable RefPtrWillBeMember<InterpolationEffect> m_interpolationEffect; |
| 111 | 111 |
| 112 friend class KeyframeEffectModelTest; | 112 friend class KeyframeEffectModelTest; |
| 113 | 113 |
| 114 bool affects(CSSPropertyID property) | 114 bool affects(CSSPropertyID property) |
| 115 { | 115 { |
| 116 ensureKeyframeGroups(); | 116 ensureKeyframeGroups(); |
| 117 return m_keyframeGroups->contains(property); | 117 return m_keyframeGroups->contains(property); |
| 118 } | 118 } |
| 119 }; | 119 }; |
| 120 | 120 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 155 } | 155 } |
| 156 | 156 |
| 157 inline AnimatableValueKeyframeEffectModel* toAnimatableValueKeyframeEffectModel( AnimationEffect* base) | 157 inline AnimatableValueKeyframeEffectModel* toAnimatableValueKeyframeEffectModel( AnimationEffect* base) |
| 158 { | 158 { |
| 159 return toAnimatableValueKeyframeEffectModel(toKeyframeEffectModelBase(base)) ; | 159 return toAnimatableValueKeyframeEffectModel(toKeyframeEffectModelBase(base)) ; |
| 160 } | 160 } |
| 161 | 161 |
| 162 } // namespace WebCore | 162 } // namespace WebCore |
| 163 | 163 |
| 164 #endif // KeyframeEffectModel_h | 164 #endif // KeyframeEffectModel_h |
| OLD | NEW |