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 } | 133 } |
134 | 134 |
135 void KeyframeEffectModelBase::ensureInterpolationEffect(Element* element) const | 135 void KeyframeEffectModelBase::ensureInterpolationEffect(Element* element) const |
136 { | 136 { |
137 if (m_interpolationEffect) | 137 if (m_interpolationEffect) |
138 return; | 138 return; |
139 m_interpolationEffect = InterpolationEffect::create(); | 139 m_interpolationEffect = InterpolationEffect::create(); |
140 | 140 |
141 for (const auto& entry : *m_keyframeGroups) { | 141 for (const auto& entry : *m_keyframeGroups) { |
142 const PropertySpecificKeyframeVector& keyframes = entry.value->keyframes
(); | 142 const PropertySpecificKeyframeVector& keyframes = entry.value->keyframes
(); |
143 ASSERT(keyframes[0]->composite() == AnimationEffect::CompositeReplace); | |
144 for (size_t i = 0; i < keyframes.size() - 1; i++) { | 143 for (size_t i = 0; i < keyframes.size() - 1; i++) { |
145 ASSERT(keyframes[i + 1]->composite() == AnimationEffect::CompositeRe
place); | |
146 double applyFrom = i ? keyframes[i]->offset() : (-std::numeric_limit
s<double>::infinity()); | 144 double applyFrom = i ? keyframes[i]->offset() : (-std::numeric_limit
s<double>::infinity()); |
147 double applyTo = i == keyframes.size() - 2 ? std::numeric_limits<dou
ble>::infinity() : keyframes[i + 1]->offset(); | 145 double applyTo = i == keyframes.size() - 2 ? std::numeric_limits<dou
ble>::infinity() : keyframes[i + 1]->offset(); |
148 if (applyTo == 1) | 146 if (applyTo == 1) |
149 applyTo = std::numeric_limits<double>::infinity(); | 147 applyTo = std::numeric_limits<double>::infinity(); |
150 | 148 |
151 m_interpolationEffect->addInterpolationsFromKeyframes(entry.key, ele
ment, *keyframes[i], *keyframes[i + 1], applyFrom, applyTo); | 149 m_interpolationEffect->addInterpolationsFromKeyframes(entry.key, ele
ment, *keyframes[i], *keyframes[i + 1], applyFrom, applyTo); |
152 } | 150 } |
153 } | 151 } |
154 } | 152 } |
155 | 153 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 } | 224 } |
227 | 225 |
228 void KeyframeEffectModelBase::PropertySpecificKeyframeGroup::trace(Visitor* visi
tor) | 226 void KeyframeEffectModelBase::PropertySpecificKeyframeGroup::trace(Visitor* visi
tor) |
229 { | 227 { |
230 #if ENABLE(OILPAN) | 228 #if ENABLE(OILPAN) |
231 visitor->trace(m_keyframes); | 229 visitor->trace(m_keyframes); |
232 #endif | 230 #endif |
233 } | 231 } |
234 | 232 |
235 } // namespace | 233 } // namespace |
OLD | NEW |