| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/animation/animatable/AnimatableValueKeyframe.h" | 5 #include "core/animation/animatable/AnimatableValueKeyframe.h" |
| 6 | 6 |
| 7 #include "core/animation/LegacyStyleInterpolation.h" | 7 #include "core/animation/LegacyStyleInterpolation.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 | 10 |
| 11 AnimatableValueKeyframe::AnimatableValueKeyframe( | 11 AnimatableValueKeyframe::AnimatableValueKeyframe( |
| 12 const AnimatableValueKeyframe& copyFrom) | 12 const AnimatableValueKeyframe& copyFrom) |
| 13 : Keyframe(copyFrom.m_offset, copyFrom.m_composite, copyFrom.m_easing) { | 13 : Keyframe(copyFrom.m_offset, copyFrom.m_composite, copyFrom.m_easing) { |
| 14 for (PropertyValueMap::const_iterator iter = | 14 for (PropertyValueMap::const_iterator iter = |
| 15 copyFrom.m_propertyValues.begin(); | 15 copyFrom.m_propertyValues.begin(); |
| 16 iter != copyFrom.m_propertyValues.end(); ++iter) | 16 iter != copyFrom.m_propertyValues.end(); ++iter) |
| 17 setPropertyValue(iter->key, iter->value.get()); | 17 setPropertyValue(iter->key, iter->value.get()); |
| 18 } | 18 } |
| 19 | 19 |
| 20 PropertyHandleSet AnimatableValueKeyframe::properties() const { | 20 PropertyHandleSet AnimatableValueKeyframe::properties() const { |
| 21 // This is not used in time-critical code, so we probably don't need to | 21 // This is not used in time-critical code, so we probably don't need to |
| 22 // worry about caching this result. | 22 // worry about caching this result. |
| 23 PropertyHandleSet properties; | 23 PropertyHandleSet properties; |
| 24 for (PropertyValueMap::const_iterator iter = m_propertyValues.begin(); | 24 for (PropertyValueMap::const_iterator iter = m_propertyValues.begin(); |
| 25 iter != m_propertyValues.end(); ++iter) | 25 iter != m_propertyValues.end(); ++iter) |
| 26 properties.add(PropertyHandle(*iter.keys())); | 26 properties.insert(PropertyHandle(*iter.keys())); |
| 27 return properties; | 27 return properties; |
| 28 } | 28 } |
| 29 | 29 |
| 30 PassRefPtr<Keyframe> AnimatableValueKeyframe::clone() const { | 30 PassRefPtr<Keyframe> AnimatableValueKeyframe::clone() const { |
| 31 return adoptRef(new AnimatableValueKeyframe(*this)); | 31 return adoptRef(new AnimatableValueKeyframe(*this)); |
| 32 } | 32 } |
| 33 | 33 |
| 34 PassRefPtr<Keyframe::PropertySpecificKeyframe> | 34 PassRefPtr<Keyframe::PropertySpecificKeyframe> |
| 35 AnimatableValueKeyframe::createPropertySpecificKeyframe( | 35 AnimatableValueKeyframe::createPropertySpecificKeyframe( |
| 36 const PropertyHandle& property) const { | 36 const PropertyHandle& property) const { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 55 | 55 |
| 56 PassRefPtr<Keyframe::PropertySpecificKeyframe> | 56 PassRefPtr<Keyframe::PropertySpecificKeyframe> |
| 57 AnimatableValueKeyframe::PropertySpecificKeyframe::neutralKeyframe( | 57 AnimatableValueKeyframe::PropertySpecificKeyframe::neutralKeyframe( |
| 58 double offset, | 58 double offset, |
| 59 PassRefPtr<TimingFunction> easing) const { | 59 PassRefPtr<TimingFunction> easing) const { |
| 60 return create(offset, std::move(easing), AnimatableValue::neutralValue(), | 60 return create(offset, std::move(easing), AnimatableValue::neutralValue(), |
| 61 EffectModel::CompositeAdd); | 61 EffectModel::CompositeAdd); |
| 62 } | 62 } |
| 63 | 63 |
| 64 } // namespace blink | 64 } // namespace blink |
| OLD | NEW |