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

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

Issue 2286233002: Replaced PassRefPtr copies with moves in Source/core/animation. (Closed)
Patch Set: Created 4 years, 3 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 #ifndef AnimatableValueKeyframe_h 5 #ifndef AnimatableValueKeyframe_h
6 #define AnimatableValueKeyframe_h 6 #define AnimatableValueKeyframe_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "core/animation/Keyframe.h" 9 #include "core/animation/Keyframe.h"
10 #include "core/animation/animatable/AnimatableValue.h" 10 #include "core/animation/animatable/AnimatableValue.h"
(...skipping 16 matching lines...) Expand all
27 { 27 {
28 DCHECK(m_propertyValues.contains(property)); 28 DCHECK(m_propertyValues.contains(property));
29 return m_propertyValues.get(property); 29 return m_propertyValues.get(property);
30 } 30 }
31 PropertyHandleSet properties() const override; 31 PropertyHandleSet properties() const override;
32 32
33 class PropertySpecificKeyframe : public Keyframe::PropertySpecificKeyframe { 33 class PropertySpecificKeyframe : public Keyframe::PropertySpecificKeyframe {
34 public: 34 public:
35 static PassRefPtr<PropertySpecificKeyframe> create(double offset, PassRe fPtr<TimingFunction> easing, PassRefPtr<AnimatableValue> value, EffectModel::Com positeOperation composite) 35 static PassRefPtr<PropertySpecificKeyframe> create(double offset, PassRe fPtr<TimingFunction> easing, PassRefPtr<AnimatableValue> value, EffectModel::Com positeOperation composite)
36 { 36 {
37 return adoptRef(new PropertySpecificKeyframe(offset, easing, value, composite)); 37 return adoptRef(new PropertySpecificKeyframe(offset, std::move(easin g), std::move(value), composite));
38 } 38 }
39 39
40 AnimatableValue* value() const { return m_value.get(); } 40 AnimatableValue* value() const { return m_value.get(); }
41 const PassRefPtr<AnimatableValue> getAnimatableValue() const final { ret urn m_value; } 41 const PassRefPtr<AnimatableValue> getAnimatableValue() const final { ret urn m_value; }
42 42
43 PassRefPtr<Keyframe::PropertySpecificKeyframe> neutralKeyframe(double of fset, PassRefPtr<TimingFunction> easing) const final; 43 PassRefPtr<Keyframe::PropertySpecificKeyframe> neutralKeyframe(double of fset, PassRefPtr<TimingFunction> easing) const final;
44 PassRefPtr<Interpolation> createInterpolation(PropertyHandle, const Keyf rame::PropertySpecificKeyframe& end) const final; 44 PassRefPtr<Interpolation> createInterpolation(PropertyHandle, const Keyf rame::PropertySpecificKeyframe& end) const final;
45 45
46 private: 46 private:
47 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin g, PassRefPtr<AnimatableValue> value, EffectModel::CompositeOperation composite) 47 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin g, PassRefPtr<AnimatableValue> value, EffectModel::CompositeOperation composite)
48 : Keyframe::PropertySpecificKeyframe(offset, easing, composite) 48 : Keyframe::PropertySpecificKeyframe(offset, std::move(easing), comp osite)
49 , m_value(value) 49 , m_value(value)
50 { } 50 { }
51 51
52 PassRefPtr<Keyframe::PropertySpecificKeyframe> cloneWithOffset(double of fset) const override; 52 PassRefPtr<Keyframe::PropertySpecificKeyframe> cloneWithOffset(double of fset) const override;
53 bool isAnimatableValuePropertySpecificKeyframe() const override { return true; } 53 bool isAnimatableValuePropertySpecificKeyframe() const override { return true; }
54 54
55 RefPtr<AnimatableValue> m_value; 55 RefPtr<AnimatableValue> m_value;
56 }; 56 };
57 57
58 private: 58 private:
(...skipping 11 matching lines...) Expand all
70 }; 70 };
71 71
72 using AnimatableValuePropertySpecificKeyframe = AnimatableValueKeyframe::Propert ySpecificKeyframe; 72 using AnimatableValuePropertySpecificKeyframe = AnimatableValueKeyframe::Propert ySpecificKeyframe;
73 73
74 DEFINE_TYPE_CASTS(AnimatableValueKeyframe, Keyframe, value, value->isAnimatableV alueKeyframe(), value.isAnimatableValueKeyframe()); 74 DEFINE_TYPE_CASTS(AnimatableValueKeyframe, Keyframe, value, value->isAnimatableV alueKeyframe(), value.isAnimatableValueKeyframe());
75 DEFINE_TYPE_CASTS(AnimatableValuePropertySpecificKeyframe, Keyframe::PropertySpe cificKeyframe, value, value->isAnimatableValuePropertySpecificKeyframe(), value. isAnimatableValuePropertySpecificKeyframe()); 75 DEFINE_TYPE_CASTS(AnimatableValuePropertySpecificKeyframe, Keyframe::PropertySpe cificKeyframe, value, value->isAnimatableValuePropertySpecificKeyframe(), value. isAnimatableValuePropertySpecificKeyframe());
76 76
77 } // namespace blink 77 } // namespace blink
78 78
79 #endif 79 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698