Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: third_party/WebKit/Source/core/animation/animatable/AnimatableValueKeyframe.cpp

Issue 1701813002: Make Keyframe::PropertySpecificKeyframes RefCounted (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: InvalidatableInterpolation RefPtrs Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
(...skipping 12 matching lines...) Expand all
23 for (PropertyValueMap::const_iterator iter = m_propertyValues.begin(); iter != m_propertyValues.end(); ++iter) 23 for (PropertyValueMap::const_iterator iter = m_propertyValues.begin(); iter != m_propertyValues.end(); ++iter)
24 properties.add(PropertyHandle(*iter.keys())); 24 properties.add(PropertyHandle(*iter.keys()));
25 return properties; 25 return properties;
26 } 26 }
27 27
28 PassRefPtr<Keyframe> AnimatableValueKeyframe::clone() const 28 PassRefPtr<Keyframe> AnimatableValueKeyframe::clone() const
29 { 29 {
30 return adoptRef(new AnimatableValueKeyframe(*this)); 30 return adoptRef(new AnimatableValueKeyframe(*this));
31 } 31 }
32 32
33 PassOwnPtr<Keyframe::PropertySpecificKeyframe> AnimatableValueKeyframe::createPr opertySpecificKeyframe(PropertyHandle property) const 33 PassRefPtr<Keyframe::PropertySpecificKeyframe> AnimatableValueKeyframe::createPr opertySpecificKeyframe(PropertyHandle property) const
34 { 34 {
35 return adoptPtr(new PropertySpecificKeyframe(offset(), &easing(), propertyVa lue(property.cssProperty()), composite())); 35 return PropertySpecificKeyframe::create(offset(), &easing(), propertyValue(p roperty.cssProperty()), composite());
36 } 36 }
37 37
38 AnimatableValueKeyframe::PropertySpecificKeyframe::PropertySpecificKeyframe(doub le offset, PassRefPtr<TimingFunction> easing, const AnimatableValue* value, Effe ctModel::CompositeOperation op) 38 PassRefPtr<Keyframe::PropertySpecificKeyframe> AnimatableValueKeyframe::Property SpecificKeyframe::cloneWithOffset(double offset) const
39 : Keyframe::PropertySpecificKeyframe(offset, easing, op)
40 , m_value(const_cast<AnimatableValue*>(value))
41 { }
42
43 AnimatableValueKeyframe::PropertySpecificKeyframe::PropertySpecificKeyframe(doub le offset, PassRefPtr<TimingFunction> easing, PassRefPtr<AnimatableValue> value)
44 : Keyframe::PropertySpecificKeyframe(offset, easing, EffectModel::CompositeR eplace)
45 , m_value(value)
46 { 39 {
47 ASSERT(!isNull(m_offset)); 40 return create(offset, m_easing, m_value, m_composite);
48 }
49
50 PassOwnPtr<Keyframe::PropertySpecificKeyframe> AnimatableValueKeyframe::Property SpecificKeyframe::cloneWithOffset(double offset) const
51 {
52 return adoptPtr(new PropertySpecificKeyframe(offset, m_easing, m_value));
53 } 41 }
54 42
55 PassRefPtr<Interpolation> AnimatableValueKeyframe::PropertySpecificKeyframe::may beCreateInterpolation(PropertyHandle property, Keyframe::PropertySpecificKeyfram e& end, Element*, const ComputedStyle*) const 43 PassRefPtr<Interpolation> AnimatableValueKeyframe::PropertySpecificKeyframe::may beCreateInterpolation(PropertyHandle property, Keyframe::PropertySpecificKeyfram e& end, Element*, const ComputedStyle*) const
56 { 44 {
57 AnimatableValuePropertySpecificKeyframe& to = toAnimatableValuePropertySpeci ficKeyframe(end); 45 AnimatableValuePropertySpecificKeyframe& to = toAnimatableValuePropertySpeci ficKeyframe(end);
58 return LegacyStyleInterpolation::create(value(), to.value(), property.cssPro perty()); 46 return LegacyStyleInterpolation::create(value(), to.value(), property.cssPro perty());
59 } 47 }
60 48
61 PassOwnPtr<Keyframe::PropertySpecificKeyframe> AnimatableValueKeyframe::Property SpecificKeyframe::neutralKeyframe(double offset, PassRefPtr<TimingFunction> easi ng) const 49 PassRefPtr<Keyframe::PropertySpecificKeyframe> AnimatableValueKeyframe::Property SpecificKeyframe::neutralKeyframe(double offset, PassRefPtr<TimingFunction> easi ng) const
62 { 50 {
63 return adoptPtr(new AnimatableValueKeyframe::PropertySpecificKeyframe(offset , easing, AnimatableValue::neutralValue(), EffectModel::CompositeAdd)); 51 return create(offset, easing, AnimatableValue::neutralValue(), EffectModel:: CompositeAdd);
64 } 52 }
65 53
66 } // namespace blink 54 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698