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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 void ensureKeyframeGroups() const; | 133 void ensureKeyframeGroups() const; |
134 void ensureInterpolationEffect(Element* = nullptr, const ComputedStyle* base
Style = nullptr) const; | 134 void ensureInterpolationEffect(Element* = nullptr, const ComputedStyle* base
Style = nullptr) const; |
135 void snapshotCompositableProperties(Element&, const ComputedStyle* baseStyle
); | 135 void snapshotCompositableProperties(Element&, const ComputedStyle* baseStyle
); |
136 | 136 |
137 KeyframeVector m_keyframes; | 137 KeyframeVector m_keyframes; |
138 // The spec describes filtering the normalized keyframes at sampling time | 138 // The spec describes filtering the normalized keyframes at sampling time |
139 // to get the 'property-specific keyframes'. For efficiency, we cache the | 139 // to get the 'property-specific keyframes'. For efficiency, we cache the |
140 // property-specific lists. | 140 // property-specific lists. |
141 using KeyframeGroupMap = WillBeHeapHashMap<PropertyHandle, OwnPtrWillBeMembe
r<PropertySpecificKeyframeGroup>>; | 141 using KeyframeGroupMap = WillBeHeapHashMap<PropertyHandle, OwnPtrWillBeMembe
r<PropertySpecificKeyframeGroup>>; |
142 mutable OwnPtrWillBeMember<KeyframeGroupMap> m_keyframeGroups; | 142 mutable OwnPtrWillBeMember<KeyframeGroupMap> m_keyframeGroups; |
143 mutable RefPtrWillBeMember<InterpolationEffect> m_interpolationEffect; | 143 mutable Member<InterpolationEffect> m_interpolationEffect; |
144 RefPtr<TimingFunction> m_neutralKeyframeEasing; | 144 RefPtr<TimingFunction> m_neutralKeyframeEasing; |
145 | 145 |
146 mutable bool m_hasSyntheticKeyframes; | 146 mutable bool m_hasSyntheticKeyframes; |
147 | 147 |
148 friend class KeyframeEffectModelTest; | 148 friend class KeyframeEffectModelTest; |
149 }; | 149 }; |
150 | 150 |
151 template <class Keyframe> | 151 template <class Keyframe> |
152 class KeyframeEffectModel final : public KeyframeEffectModelBase { | 152 class KeyframeEffectModel final : public KeyframeEffectModelBase { |
153 public: | 153 public: |
154 using KeyframeVector = WillBeHeapVector<RefPtrWillBeMember<Keyframe>>; | 154 using KeyframeVector = WillBeHeapVector<RefPtrWillBeMember<Keyframe>>; |
155 static PassRefPtrWillBeRawPtr<KeyframeEffectModel<Keyframe>> create(const Ke
yframeVector& keyframes, PassRefPtrWillBeRawPtr<TimingFunction> neutralKeyframeE
asing = nullptr) | 155 static KeyframeEffectModel<Keyframe>* create(const KeyframeVector& keyframes
, PassRefPtrWillBeRawPtr<TimingFunction> neutralKeyframeEasing = nullptr) |
156 { | 156 { |
157 return adoptRefWillBeNoop(new KeyframeEffectModel(keyframes, neutralKeyf
rameEasing)); | 157 return new KeyframeEffectModel(keyframes, neutralKeyframeEasing); |
158 } | 158 } |
159 | 159 |
160 private: | 160 private: |
161 KeyframeEffectModel(const KeyframeVector& keyframes, PassRefPtrWillBeRawPtr<
TimingFunction> neutralKeyframeEasing) | 161 KeyframeEffectModel(const KeyframeVector& keyframes, PassRefPtrWillBeRawPtr<
TimingFunction> neutralKeyframeEasing) |
162 : KeyframeEffectModelBase(neutralKeyframeEasing) | 162 : KeyframeEffectModelBase(neutralKeyframeEasing) |
163 { | 163 { |
164 m_keyframes.appendVector(keyframes); | 164 m_keyframes.appendVector(keyframes); |
165 } | 165 } |
166 | 166 |
167 virtual bool isAnimatableValueKeyframeEffectModel() const { return false; } | 167 virtual bool isAnimatableValueKeyframeEffectModel() const { return false; } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 | 205 |
206 template <> | 206 template <> |
207 inline bool KeyframeEffectModel<AnimatableValueKeyframe>::isAnimatableValueKeyfr
ameEffectModel() const { return true; } | 207 inline bool KeyframeEffectModel<AnimatableValueKeyframe>::isAnimatableValueKeyfr
ameEffectModel() const { return true; } |
208 | 208 |
209 template <> | 209 template <> |
210 inline bool KeyframeEffectModel<StringKeyframe>::isStringKeyframeEffectModel() c
onst { return true; } | 210 inline bool KeyframeEffectModel<StringKeyframe>::isStringKeyframeEffectModel() c
onst { return true; } |
211 | 211 |
212 } // namespace blink | 212 } // namespace blink |
213 | 213 |
214 #endif // KeyframeEffectModel_h | 214 #endif // KeyframeEffectModel_h |
OLD | NEW |