Chromium Code Reviews| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/animation/animatable/AnimatableValueKeyframe.h" | 6 #include "core/animation/animatable/AnimatableValueKeyframe.h" |
| 7 | 7 |
| 8 #include "core/animation/LegacyStyleInterpolation.h" | 8 #include "core/animation/LegacyStyleInterpolation.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 for (PropertyValueMap::const_iterator iter = m_propertyValues.begin(); iter != m_propertyValues.end(); ++iter) | 24 for (PropertyValueMap::const_iterator iter = m_propertyValues.begin(); iter != m_propertyValues.end(); ++iter) |
| 25 properties.add(PropertyHandle(*iter.keys())); | 25 properties.add(PropertyHandle(*iter.keys())); |
| 26 return properties; | 26 return properties; |
| 27 } | 27 } |
| 28 | 28 |
| 29 PassRefPtrWillBeRawPtr<Keyframe> AnimatableValueKeyframe::clone() const | 29 PassRefPtrWillBeRawPtr<Keyframe> AnimatableValueKeyframe::clone() const |
| 30 { | 30 { |
| 31 return adoptRefWillBeNoop(new AnimatableValueKeyframe(*this)); | 31 return adoptRefWillBeNoop(new AnimatableValueKeyframe(*this)); |
| 32 } | 32 } |
| 33 | 33 |
| 34 PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> AnimatableValueKeyfra me::createPropertySpecificKeyframe(PropertyHandle property) const | 34 PassRefPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> AnimatableValueKeyfra me::createPropertySpecificKeyframe(PropertyHandle property) const |
| 35 { | 35 { |
| 36 return adoptPtrWillBeNoop(new PropertySpecificKeyframe(offset(), &easing(), propertyValue(property.cssProperty()), composite())); | 36 return adoptRefWillBeNoop(new PropertySpecificKeyframe(offset(), &easing(), propertyValue(property.cssProperty()), composite())); |
| 37 } | 37 } |
| 38 | 38 |
| 39 DEFINE_TRACE(AnimatableValueKeyframe) | 39 DEFINE_TRACE(AnimatableValueKeyframe) |
| 40 { | 40 { |
| 41 #if ENABLE(OILPAN) | 41 #if ENABLE(OILPAN) |
| 42 visitor->trace(m_propertyValues); | 42 visitor->trace(m_propertyValues); |
| 43 #endif | 43 #endif |
| 44 Keyframe::trace(visitor); | 44 Keyframe::trace(visitor); |
| 45 } | 45 } |
| 46 | 46 |
| 47 AnimatableValueKeyframe::PropertySpecificKeyframe::PropertySpecificKeyframe(doub le offset, PassRefPtr<TimingFunction> easing, const AnimatableValue* value, Effe ctModel::CompositeOperation op) | 47 AnimatableValueKeyframe::PropertySpecificKeyframe::PropertySpecificKeyframe(doub le offset, PassRefPtr<TimingFunction> easing, const AnimatableValue* value, Effe ctModel::CompositeOperation op) |
| 48 : Keyframe::PropertySpecificKeyframe(offset, easing, op) | 48 : Keyframe::PropertySpecificKeyframe(offset, easing, op) |
| 49 , m_value(const_cast<AnimatableValue*>(value)) | 49 , m_value(const_cast<AnimatableValue*>(value)) |
| 50 { } | 50 { } |
| 51 | 51 |
| 52 AnimatableValueKeyframe::PropertySpecificKeyframe::PropertySpecificKeyframe(doub le offset, PassRefPtr<TimingFunction> easing, PassRefPtrWillBeRawPtr<AnimatableV alue> value) | 52 AnimatableValueKeyframe::PropertySpecificKeyframe::PropertySpecificKeyframe(doub le offset, PassRefPtr<TimingFunction> easing, PassRefPtrWillBeRawPtr<AnimatableV alue> value) |
| 53 : Keyframe::PropertySpecificKeyframe(offset, easing, EffectModel::CompositeR eplace) | 53 : Keyframe::PropertySpecificKeyframe(offset, easing, EffectModel::CompositeR eplace) |
| 54 , m_value(value) | 54 , m_value(value) |
| 55 { | 55 { |
| 56 ASSERT(!isNull(m_offset)); | 56 ASSERT(!isNull(m_offset)); |
| 57 } | 57 } |
| 58 | 58 |
| 59 PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> AnimatableValueKeyfra me::PropertySpecificKeyframe::cloneWithOffset(double offset) const | 59 PassRefPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> AnimatableValueKeyfra me::PropertySpecificKeyframe::cloneWithOffset(double offset) const |
| 60 { | 60 { |
| 61 Keyframe::PropertySpecificKeyframe* theClone = new PropertySpecificKeyframe( offset, m_easing, m_value); | 61 Keyframe::PropertySpecificKeyframe* theClone = new PropertySpecificKeyframe( offset, m_easing, m_value); |
| 62 return adoptPtrWillBeNoop(theClone); | 62 return adoptRefWillBeNoop(theClone); |
| 63 } | 63 } |
| 64 | 64 |
| 65 PassRefPtrWillBeRawPtr<Interpolation> AnimatableValueKeyframe::PropertySpecificK eyframe::maybeCreateInterpolation(PropertyHandle property, Keyframe::PropertySpe cificKeyframe& end, Element*, const ComputedStyle*) const | 65 PassRefPtrWillBeRawPtr<Interpolation> AnimatableValueKeyframe::PropertySpecificK eyframe::maybeCreateInterpolation(PropertyHandle property, Keyframe::PropertySpe cificKeyframe& end, Element*, const ComputedStyle*) |
| 66 { | 66 { |
| 67 AnimatableValuePropertySpecificKeyframe& to = toAnimatableValuePropertySpeci ficKeyframe(end); | 67 AnimatableValuePropertySpecificKeyframe& to = toAnimatableValuePropertySpeci ficKeyframe(end); |
| 68 return LegacyStyleInterpolation::create(value(), to.value(), property.cssPro perty()); | 68 return LegacyStyleInterpolation::create(value(), to.value(), property.cssPro perty()); |
| 69 } | 69 } |
| 70 | 70 |
| 71 PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> AnimatableValueKeyfra me::PropertySpecificKeyframe::neutralKeyframe(double offset, PassRefPtr<TimingFu nction> easing) const | 71 PassRefPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> AnimatableValueKeyfra me::PropertySpecificKeyframe::neutralKeyframe(double offset, PassRefPtr<TimingFu nction> easing) const |
|
shans
2015/06/04 00:15:15
Can you provide a high-level justification of why
alancutter (OOO until 2018)
2015/06/11 04:15:13
Reconsidering this I think there should be no reas
| |
| 72 { | 72 { |
| 73 return adoptPtrWillBeNoop(new AnimatableValueKeyframe::PropertySpecificKeyfr ame(offset, easing, AnimatableValue::neutralValue(), EffectModel::CompositeAdd)) ; | 73 return adoptRefWillBeNoop(new AnimatableValueKeyframe::PropertySpecificKeyfr ame(offset, easing, AnimatableValue::neutralValue(), EffectModel::CompositeAdd)) ; |
| 74 } | 74 } |
| 75 | 75 |
| 76 DEFINE_TRACE(AnimatableValueKeyframe::PropertySpecificKeyframe) | 76 DEFINE_TRACE(AnimatableValueKeyframe::PropertySpecificKeyframe) |
| 77 { | 77 { |
| 78 visitor->trace(m_value); | 78 visitor->trace(m_value); |
| 79 Keyframe::PropertySpecificKeyframe::trace(visitor); | 79 Keyframe::PropertySpecificKeyframe::trace(visitor); |
| 80 } | 80 } |
| 81 | 81 |
| 82 } | 82 } |
| OLD | NEW |