| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 void KeyframeEffectModelBase::updateNeutralKeyframeAnimatableValues(CSSPropertyI
D property, PassRefPtrWillBeRawPtr<AnimatableValue> value) | 87 void KeyframeEffectModelBase::updateNeutralKeyframeAnimatableValues(CSSPropertyI
D property, PassRefPtrWillBeRawPtr<AnimatableValue> value) |
| 88 { | 88 { |
| 89 ASSERT(CompositorAnimations::isCompositableProperty(property)); | 89 ASSERT(CompositorAnimations::isCompositableProperty(property)); |
| 90 | 90 |
| 91 if (!value) | 91 if (!value) |
| 92 return; | 92 return; |
| 93 | 93 |
| 94 ensureKeyframeGroups(); | 94 ensureKeyframeGroups(); |
| 95 auto& keyframes = m_keyframeGroups->get(property)->m_keyframes; | 95 auto& keyframes = m_keyframeGroups->get(property)->m_keyframes; |
| 96 ASSERT(keyframes.size() >= 2); |
| 96 | 97 |
| 97 ASSERT(keyframes.size() >= 2); | 98 auto& first = toStringPropertySpecificKeyframe(*keyframes.first()); |
| 98 ASSERT(!toStringPropertySpecificKeyframe(*keyframes[0]).value() || !toString
PropertySpecificKeyframe(*keyframes[keyframes.size() - 1]).value()); | 99 auto& last = toStringPropertySpecificKeyframe(*keyframes.last()); |
| 100 ASSERT(!first.value() || !last.value()); |
| 99 | 101 |
| 100 if (!toStringPropertySpecificKeyframe(*keyframes.first()).value()) | 102 if (!first.value()) |
| 101 toStringPropertySpecificKeyframe(*keyframes.first()).setAnimatableValue(
value); | 103 first.setAnimatableValue(value); |
| 102 if (!toStringPropertySpecificKeyframe(*keyframes.last()).value()) | 104 if (!last.value()) |
| 103 toStringPropertySpecificKeyframe(*keyframes.last()).setAnimatableValue(v
alue); | 105 last.setAnimatableValue(value); |
| 104 | |
| 105 // FIXME: Handle neutral keyframes that are not at 0% or 100%. | |
| 106 } | 106 } |
| 107 | 107 |
| 108 KeyframeEffectModelBase::KeyframeVector KeyframeEffectModelBase::normalizedKeyfr
ames(const KeyframeVector& keyframes) | 108 KeyframeEffectModelBase::KeyframeVector KeyframeEffectModelBase::normalizedKeyfr
ames(const KeyframeVector& keyframes) |
| 109 { | 109 { |
| 110 double lastOffset = 0; | 110 double lastOffset = 0; |
| 111 KeyframeVector result; | 111 KeyframeVector result; |
| 112 result.reserveCapacity(keyframes.size()); | 112 result.reserveCapacity(keyframes.size()); |
| 113 | 113 |
| 114 for (const auto& keyframe : keyframes) { | 114 for (const auto& keyframe : keyframes) { |
| 115 double offset = keyframe->offset(); | 115 double offset = keyframe->offset(); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 } | 269 } |
| 270 | 270 |
| 271 DEFINE_TRACE(KeyframeEffectModelBase::PropertySpecificKeyframeGroup) | 271 DEFINE_TRACE(KeyframeEffectModelBase::PropertySpecificKeyframeGroup) |
| 272 { | 272 { |
| 273 #if ENABLE(OILPAN) | 273 #if ENABLE(OILPAN) |
| 274 visitor->trace(m_keyframes); | 274 visitor->trace(m_keyframes); |
| 275 #endif | 275 #endif |
| 276 } | 276 } |
| 277 | 277 |
| 278 } // namespace | 278 } // namespace |
| OLD | NEW |