| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 void KeyframeEffectModelBase::sample(int iteration, double fraction, double iter
ationDuration, OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolat
ion>>>& result) const | 58 void KeyframeEffectModelBase::sample(int iteration, double fraction, double iter
ationDuration, OwnPtrWillBeRawPtr<WillBeHeapVector<RefPtrWillBeMember<Interpolat
ion>>>& result) const |
| 59 { | 59 { |
| 60 ASSERT(iteration >= 0); | 60 ASSERT(iteration >= 0); |
| 61 ASSERT(!isNull(fraction)); | 61 ASSERT(!isNull(fraction)); |
| 62 ensureKeyframeGroups(); | 62 ensureKeyframeGroups(); |
| 63 ensureInterpolationEffect(); | 63 ensureInterpolationEffect(); |
| 64 | 64 |
| 65 return m_interpolationEffect->getActiveInterpolations(fraction, iterationDur
ation, result); | 65 return m_interpolationEffect->getActiveInterpolations(fraction, iterationDur
ation, result); |
| 66 } | 66 } |
| 67 | 67 |
| 68 void KeyframeEffectModelBase::forceConversionsToAnimatableValues(Element& elemen
t, const LayoutStyle* baseStyle) | 68 void KeyframeEffectModelBase::forceConversionsToAnimatableValues(Element& elemen
t, const ComputedStyle* baseStyle) |
| 69 { | 69 { |
| 70 ensureKeyframeGroups(); | 70 ensureKeyframeGroups(); |
| 71 snapshotCompositableProperties(element, baseStyle); | 71 snapshotCompositableProperties(element, baseStyle); |
| 72 ensureInterpolationEffect(&element, baseStyle); | 72 ensureInterpolationEffect(&element, baseStyle); |
| 73 } | 73 } |
| 74 | 74 |
| 75 void KeyframeEffectModelBase::snapshotCompositableProperties(Element& element, c
onst LayoutStyle* baseStyle) | 75 void KeyframeEffectModelBase::snapshotCompositableProperties(Element& element, c
onst ComputedStyle* baseStyle) |
| 76 { | 76 { |
| 77 ensureKeyframeGroups(); | 77 ensureKeyframeGroups(); |
| 78 for (CSSPropertyID property : CompositorAnimations::CompositableProperties)
{ | 78 for (CSSPropertyID property : CompositorAnimations::CompositableProperties)
{ |
| 79 if (!affects(property)) | 79 if (!affects(property)) |
| 80 continue; | 80 continue; |
| 81 for (auto& keyframe : m_keyframeGroups->get(property)->m_keyframes) | 81 for (auto& keyframe : m_keyframeGroups->get(property)->m_keyframes) |
| 82 keyframe->populateAnimatableValue(property, element, baseStyle); | 82 keyframe->populateAnimatableValue(property, element, baseStyle); |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 | 85 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 // Add synthetic keyframes. | 169 // Add synthetic keyframes. |
| 170 m_hasSyntheticKeyframes = false; | 170 m_hasSyntheticKeyframes = false; |
| 171 for (const auto& entry : *m_keyframeGroups) { | 171 for (const auto& entry : *m_keyframeGroups) { |
| 172 if (entry.value->addSyntheticKeyframeIfRequired(m_neutralKeyframeEasing)
) | 172 if (entry.value->addSyntheticKeyframeIfRequired(m_neutralKeyframeEasing)
) |
| 173 m_hasSyntheticKeyframes = true; | 173 m_hasSyntheticKeyframes = true; |
| 174 | 174 |
| 175 entry.value->removeRedundantKeyframes(); | 175 entry.value->removeRedundantKeyframes(); |
| 176 } | 176 } |
| 177 } | 177 } |
| 178 | 178 |
| 179 void KeyframeEffectModelBase::ensureInterpolationEffect(Element* element, const
LayoutStyle* baseStyle) const | 179 void KeyframeEffectModelBase::ensureInterpolationEffect(Element* element, const
ComputedStyle* baseStyle) const |
| 180 { | 180 { |
| 181 if (m_interpolationEffect) | 181 if (m_interpolationEffect) |
| 182 return; | 182 return; |
| 183 m_interpolationEffect = InterpolationEffect::create(); | 183 m_interpolationEffect = InterpolationEffect::create(); |
| 184 | 184 |
| 185 for (const auto& entry : *m_keyframeGroups) { | 185 for (const auto& entry : *m_keyframeGroups) { |
| 186 const PropertySpecificKeyframeVector& keyframes = entry.value->keyframes
(); | 186 const PropertySpecificKeyframeVector& keyframes = entry.value->keyframes
(); |
| 187 for (size_t i = 0; i < keyframes.size() - 1; i++) { | 187 for (size_t i = 0; i < keyframes.size() - 1; i++) { |
| 188 double applyFrom = i ? keyframes[i]->offset() : (-std::numeric_limit
s<double>::infinity()); | 188 double applyFrom = i ? keyframes[i]->offset() : (-std::numeric_limit
s<double>::infinity()); |
| 189 double applyTo = i == keyframes.size() - 2 ? std::numeric_limits<dou
ble>::infinity() : keyframes[i + 1]->offset(); | 189 double applyTo = i == keyframes.size() - 2 ? std::numeric_limits<dou
ble>::infinity() : keyframes[i + 1]->offset(); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 } | 268 } |
| 269 | 269 |
| 270 DEFINE_TRACE(KeyframeEffectModelBase::PropertySpecificKeyframeGroup) | 270 DEFINE_TRACE(KeyframeEffectModelBase::PropertySpecificKeyframeGroup) |
| 271 { | 271 { |
| 272 #if ENABLE(OILPAN) | 272 #if ENABLE(OILPAN) |
| 273 visitor->trace(m_keyframes); | 273 visitor->trace(m_keyframes); |
| 274 #endif | 274 #endif |
| 275 } | 275 } |
| 276 | 276 |
| 277 } // namespace | 277 } // namespace |
| OLD | NEW |