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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 bool hasSyntheticKeyframes() const | 96 bool hasSyntheticKeyframes() const |
97 { | 97 { |
98 ensureKeyframeGroups(); | 98 ensureKeyframeGroups(); |
99 return m_hasSyntheticKeyframes; | 99 return m_hasSyntheticKeyframes; |
100 } | 100 } |
101 | 101 |
102 DECLARE_VIRTUAL_TRACE(); | 102 DECLARE_VIRTUAL_TRACE(); |
103 | 103 |
104 // FIXME: This is a hack used to resolve CSSValues to AnimatableValues while
we have a valid handle on an element. | 104 // FIXME: This is a hack used to resolve CSSValues to AnimatableValues while
we have a valid handle on an element. |
105 // This should be removed once AnimatableValues are obsolete. | 105 // This should be removed once AnimatableValues are obsolete. |
106 void forceConversionsToAnimatableValues(Element&, const LayoutStyle* baseSty
le); | 106 void forceConversionsToAnimatableValues(Element&, const ComputedStyle* baseS
tyle); |
107 bool updateNeutralKeyframeAnimatableValues(CSSPropertyID, PassRefPtrWillBeRa
wPtr<AnimatableValue>); | 107 bool updateNeutralKeyframeAnimatableValues(CSSPropertyID, PassRefPtrWillBeRa
wPtr<AnimatableValue>); |
108 | 108 |
109 template<typename T> | 109 template<typename T> |
110 inline void forEachInterpolation(const T& callback) { m_interpolationEffect-
>forEachInterpolation(callback); } | 110 inline void forEachInterpolation(const T& callback) { m_interpolationEffect-
>forEachInterpolation(callback); } |
111 | 111 |
112 static KeyframeVector normalizedKeyframesForInspector(const KeyframeVector&
keyframes) { return normalizedKeyframes(keyframes); } | 112 static KeyframeVector normalizedKeyframesForInspector(const KeyframeVector&
keyframes) { return normalizedKeyframes(keyframes); } |
113 | 113 |
114 bool affects(CSSPropertyID property) const override | 114 bool affects(CSSPropertyID property) const override |
115 { | 115 { |
116 ensureKeyframeGroups(); | 116 ensureKeyframeGroups(); |
117 return m_keyframeGroups->contains(property); | 117 return m_keyframeGroups->contains(property); |
118 } | 118 } |
119 | 119 |
120 protected: | 120 protected: |
121 KeyframeEffectModelBase(PassRefPtrWillBeRawPtr<TimingFunction> neutralKeyfra
meEasing) | 121 KeyframeEffectModelBase(PassRefPtrWillBeRawPtr<TimingFunction> neutralKeyfra
meEasing) |
122 : m_neutralKeyframeEasing(neutralKeyframeEasing) | 122 : m_neutralKeyframeEasing(neutralKeyframeEasing) |
123 { | 123 { |
124 } | 124 } |
125 | 125 |
126 static KeyframeVector normalizedKeyframes(const KeyframeVector& keyframes); | 126 static KeyframeVector normalizedKeyframes(const KeyframeVector& keyframes); |
127 | 127 |
128 // Lazily computes the groups of property-specific keyframes. | 128 // Lazily computes the groups of property-specific keyframes. |
129 void ensureKeyframeGroups() const; | 129 void ensureKeyframeGroups() const; |
130 void ensureInterpolationEffect(Element* = nullptr, const LayoutStyle* baseSt
yle = nullptr) const; | 130 void ensureInterpolationEffect(Element* = nullptr, const ComputedStyle* base
Style = nullptr) const; |
131 void snapshotCompositableProperties(Element&, const LayoutStyle* baseStyle); | 131 void snapshotCompositableProperties(Element&, const ComputedStyle* baseStyle
); |
132 | 132 |
133 KeyframeVector m_keyframes; | 133 KeyframeVector m_keyframes; |
134 // The spec describes filtering the normalized keyframes at sampling time | 134 // The spec describes filtering the normalized keyframes at sampling time |
135 // to get the 'property-specific keyframes'. For efficiency, we cache the | 135 // to get the 'property-specific keyframes'. For efficiency, we cache the |
136 // property-specific lists. | 136 // property-specific lists. |
137 using KeyframeGroupMap = WillBeHeapHashMap<CSSPropertyID, OwnPtrWillBeMember
<PropertySpecificKeyframeGroup>>; | 137 using KeyframeGroupMap = WillBeHeapHashMap<CSSPropertyID, OwnPtrWillBeMember
<PropertySpecificKeyframeGroup>>; |
138 mutable OwnPtrWillBeMember<KeyframeGroupMap> m_keyframeGroups; | 138 mutable OwnPtrWillBeMember<KeyframeGroupMap> m_keyframeGroups; |
139 mutable RefPtrWillBeMember<InterpolationEffect> m_interpolationEffect; | 139 mutable RefPtrWillBeMember<InterpolationEffect> m_interpolationEffect; |
140 RefPtr<TimingFunction> m_neutralKeyframeEasing; | 140 RefPtr<TimingFunction> m_neutralKeyframeEasing; |
141 | 141 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 template <> | 202 template <> |
203 inline bool KeyframeEffectModel<AnimatableValueKeyframe>::isAnimatableValueKeyfr
ameEffectModel() const { return true; } | 203 inline bool KeyframeEffectModel<AnimatableValueKeyframe>::isAnimatableValueKeyfr
ameEffectModel() const { return true; } |
204 | 204 |
205 template <> | 205 template <> |
206 inline bool KeyframeEffectModel<StringKeyframe>::isStringKeyframeEffectModel() c
onst { return true; } | 206 inline bool KeyframeEffectModel<StringKeyframe>::isStringKeyframeEffectModel() c
onst { return true; } |
207 | 207 |
208 } // namespace blink | 208 } // namespace blink |
209 | 209 |
210 #endif // KeyframeEffectModel_h | 210 #endif // KeyframeEffectModel_h |
OLD | NEW |