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

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

Issue 2649103007: Make PropertyHandle instances const references where possible (Closed)
Patch Set: Created 3 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 #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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 AnimatableValue* value() const { return m_value.get(); } 44 AnimatableValue* value() const { return m_value.get(); }
45 PassRefPtr<AnimatableValue> getAnimatableValue() const final { 45 PassRefPtr<AnimatableValue> getAnimatableValue() const final {
46 return m_value; 46 return m_value;
47 } 47 }
48 48
49 bool isNeutral() const final { return m_value->isNeutral(); } 49 bool isNeutral() const final { return m_value->isNeutral(); }
50 PassRefPtr<Keyframe::PropertySpecificKeyframe> neutralKeyframe( 50 PassRefPtr<Keyframe::PropertySpecificKeyframe> neutralKeyframe(
51 double offset, 51 double offset,
52 PassRefPtr<TimingFunction> easing) const final; 52 PassRefPtr<TimingFunction> easing) const final;
53 PassRefPtr<Interpolation> createInterpolation( 53 PassRefPtr<Interpolation> createInterpolation(
54 PropertyHandle, 54 const PropertyHandle&,
55 const Keyframe::PropertySpecificKeyframe& end) const final; 55 const Keyframe::PropertySpecificKeyframe& end) const final;
56 56
57 private: 57 private:
58 PropertySpecificKeyframe(double offset, 58 PropertySpecificKeyframe(double offset,
59 PassRefPtr<TimingFunction> easing, 59 PassRefPtr<TimingFunction> easing,
60 PassRefPtr<AnimatableValue> value, 60 PassRefPtr<AnimatableValue> value,
61 EffectModel::CompositeOperation composite) 61 EffectModel::CompositeOperation composite)
62 : Keyframe::PropertySpecificKeyframe(offset, 62 : Keyframe::PropertySpecificKeyframe(offset,
63 std::move(easing), 63 std::move(easing),
64 composite), 64 composite),
65 m_value(value) {} 65 m_value(value) {}
66 66
67 PassRefPtr<Keyframe::PropertySpecificKeyframe> cloneWithOffset( 67 PassRefPtr<Keyframe::PropertySpecificKeyframe> cloneWithOffset(
68 double offset) const override; 68 double offset) const override;
69 bool isAnimatableValuePropertySpecificKeyframe() const override { 69 bool isAnimatableValuePropertySpecificKeyframe() const override {
70 return true; 70 return true;
71 } 71 }
72 72
73 RefPtr<AnimatableValue> m_value; 73 RefPtr<AnimatableValue> m_value;
74 }; 74 };
75 75
76 private: 76 private:
77 AnimatableValueKeyframe() {} 77 AnimatableValueKeyframe() {}
78 78
79 AnimatableValueKeyframe(const AnimatableValueKeyframe& copyFrom); 79 AnimatableValueKeyframe(const AnimatableValueKeyframe& copyFrom);
80 80
81 PassRefPtr<Keyframe> clone() const override; 81 PassRefPtr<Keyframe> clone() const override;
82 PassRefPtr<Keyframe::PropertySpecificKeyframe> createPropertySpecificKeyframe( 82 PassRefPtr<Keyframe::PropertySpecificKeyframe> createPropertySpecificKeyframe(
83 PropertyHandle) const override; 83 const PropertyHandle&) const override;
84 84
85 bool isAnimatableValueKeyframe() const override { return true; } 85 bool isAnimatableValueKeyframe() const override { return true; }
86 86
87 using PropertyValueMap = HashMap<CSSPropertyID, RefPtr<AnimatableValue>>; 87 using PropertyValueMap = HashMap<CSSPropertyID, RefPtr<AnimatableValue>>;
88 PropertyValueMap m_propertyValues; 88 PropertyValueMap m_propertyValues;
89 }; 89 };
90 90
91 using AnimatableValuePropertySpecificKeyframe = 91 using AnimatableValuePropertySpecificKeyframe =
92 AnimatableValueKeyframe::PropertySpecificKeyframe; 92 AnimatableValueKeyframe::PropertySpecificKeyframe;
93 93
94 DEFINE_TYPE_CASTS(AnimatableValueKeyframe, 94 DEFINE_TYPE_CASTS(AnimatableValueKeyframe,
95 Keyframe, 95 Keyframe,
96 value, 96 value,
97 value->isAnimatableValueKeyframe(), 97 value->isAnimatableValueKeyframe(),
98 value.isAnimatableValueKeyframe()); 98 value.isAnimatableValueKeyframe());
99 DEFINE_TYPE_CASTS(AnimatableValuePropertySpecificKeyframe, 99 DEFINE_TYPE_CASTS(AnimatableValuePropertySpecificKeyframe,
100 Keyframe::PropertySpecificKeyframe, 100 Keyframe::PropertySpecificKeyframe,
101 value, 101 value,
102 value->isAnimatableValuePropertySpecificKeyframe(), 102 value->isAnimatableValuePropertySpecificKeyframe(),
103 value.isAnimatableValuePropertySpecificKeyframe()); 103 value.isAnimatableValuePropertySpecificKeyframe());
104 104
105 } // namespace blink 105 } // namespace blink
106 106
107 #endif 107 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698