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

Side by Side Diff: Source/core/animation/StringKeyframe.h

Issue 1233363002: CSSValue Immediates: Replace CSSPrimitiveValue usage with const references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cssvalue_patch_4_attempt_2
Patch Set: Rebase Created 5 years, 4 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 StringKeyframe_h 5 #ifndef StringKeyframe_h
6 #define StringKeyframe_h 6 #define StringKeyframe_h
7 7
8 #include "core/animation/Keyframe.h" 8 #include "core/animation/Keyframe.h"
9 #include "core/css/StylePropertySet.h" 9 #include "core/css/StylePropertySet.h"
10 10
(...skipping 23 matching lines...) Expand all
34 { 34 {
35 return m_svgPropertyMap.get(&attributeName); 35 return m_svgPropertyMap.get(&attributeName);
36 } 36 }
37 37
38 virtual PropertyHandleSet properties() const override; 38 virtual PropertyHandleSet properties() const override;
39 39
40 DECLARE_VIRTUAL_TRACE(); 40 DECLARE_VIRTUAL_TRACE();
41 41
42 class CSSPropertySpecificKeyframe : public Keyframe::PropertySpecificKeyfram e { 42 class CSSPropertySpecificKeyframe : public Keyframe::PropertySpecificKeyfram e {
43 public: 43 public:
44 CSSPropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> ea sing, NullableCSSValue, EffectModel::CompositeOperation); 44 CSSPropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> ea sing, const NullableCSSValue&, EffectModel::CompositeOperation);
45 45
46 NullableCSSValue value() const { return m_value; } 46 const NullableCSSValue& value() const { return m_value; }
47 47
48 virtual void populateAnimatableValue(CSSPropertyID, Element&, const Comp utedStyle* baseStyle) const; 48 virtual void populateAnimatableValue(CSSPropertyID, Element&, const Comp utedStyle* baseStyle) const;
49 virtual const PassRefPtrWillBeRawPtr<AnimatableValue> getAnimatableValue () const override final { return m_animatableValueCache.get(); } 49 virtual const PassRefPtrWillBeRawPtr<AnimatableValue> getAnimatableValue () const override final { return m_animatableValueCache.get(); }
50 void setAnimatableValue(PassRefPtrWillBeRawPtr<AnimatableValue> value) { m_animatableValueCache = value; } 50 void setAnimatableValue(PassRefPtrWillBeRawPtr<AnimatableValue> value) { m_animatableValueCache = value; }
51 51
52 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> neutr alKeyframe(double offset, PassRefPtr<TimingFunction> easing) const override fina l; 52 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> neutr alKeyframe(double offset, PassRefPtr<TimingFunction> easing) const override fina l;
53 virtual PassRefPtrWillBeRawPtr<Interpolation> maybeCreateInterpolation(P ropertyHandle, Keyframe::PropertySpecificKeyframe& end, Element*, const Computed Style* baseStyle) const override final; 53 virtual PassRefPtrWillBeRawPtr<Interpolation> maybeCreateInterpolation(P ropertyHandle, Keyframe::PropertySpecificKeyframe& end, Element*, const Computed Style* baseStyle) const override final;
54 54
55 DECLARE_VIRTUAL_TRACE(); 55 DECLARE_VIRTUAL_TRACE();
56 56
57 private: 57 private:
58 CSSPropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> ea sing, NullableCSSValue); 58 CSSPropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> ea sing, const NullableCSSValue&);
59 59
60 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> clone WithOffset(double offset) const; 60 virtual PassOwnPtrWillBeRawPtr<Keyframe::PropertySpecificKeyframe> clone WithOffset(double offset) const;
61 virtual bool isCSSPropertySpecificKeyframe() const override { return tru e; } 61 virtual bool isCSSPropertySpecificKeyframe() const override { return tru e; }
62 62
63 static bool createInterpolationsFromCSSValues(CSSPropertyID, CSSValue fr omCSSValue, CSSValue toCSSValue, Element*, OwnPtrWillBeRawPtr<WillBeHeapVector<R efPtrWillBeMember<Interpolation>>>& interpolations); 63 static bool createInterpolationsFromCSSValues(CSSPropertyID, const CSSVa lue& fromCSSValue, const CSSValue& toCSSValue, Element*, OwnPtrWillBeRawPtr<Will BeHeapVector<RefPtrWillBeMember<Interpolation>>>& interpolations);
64 64
65 void populateAnimatableValueCaches(CSSPropertyID, Keyframe::PropertySpec ificKeyframe&, Element*, CSSValue& fromCSSValue, CSSValue& toCSSValue) const; 65 void populateAnimatableValueCaches(CSSPropertyID, Keyframe::PropertySpec ificKeyframe&, Element*, const CSSValue& fromCSSValue, const CSSValue& toCSSValu e) const;
66 66
67 NullableCSSValue m_value; 67 NullableCSSValue m_value;
68 mutable RefPtrWillBeMember<AnimatableValue> m_animatableValueCache; 68 mutable RefPtrWillBeMember<AnimatableValue> m_animatableValueCache;
69 }; 69 };
70 70
71 class SVGPropertySpecificKeyframe : public Keyframe::PropertySpecificKeyfram e { 71 class SVGPropertySpecificKeyframe : public Keyframe::PropertySpecificKeyfram e {
72 public: 72 public:
73 SVGPropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> ea sing, const String&, EffectModel::CompositeOperation); 73 SVGPropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> ea sing, const String&, EffectModel::CompositeOperation);
74 74
75 const String& value() const { return m_value; } 75 const String& value() const { return m_value; }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 using CSSPropertySpecificKeyframe = StringKeyframe::CSSPropertySpecificKeyframe; 110 using CSSPropertySpecificKeyframe = StringKeyframe::CSSPropertySpecificKeyframe;
111 using SVGPropertySpecificKeyframe = StringKeyframe::SVGPropertySpecificKeyframe; 111 using SVGPropertySpecificKeyframe = StringKeyframe::SVGPropertySpecificKeyframe;
112 112
113 DEFINE_TYPE_CASTS(StringKeyframe, Keyframe, value, value->isStringKeyframe(), va lue.isStringKeyframe()); 113 DEFINE_TYPE_CASTS(StringKeyframe, Keyframe, value, value->isStringKeyframe(), va lue.isStringKeyframe());
114 DEFINE_TYPE_CASTS(CSSPropertySpecificKeyframe, Keyframe::PropertySpecificKeyfram e, value, value->isCSSPropertySpecificKeyframe(), value.isCSSPropertySpecificKey frame()); 114 DEFINE_TYPE_CASTS(CSSPropertySpecificKeyframe, Keyframe::PropertySpecificKeyfram e, value, value->isCSSPropertySpecificKeyframe(), value.isCSSPropertySpecificKey frame());
115 DEFINE_TYPE_CASTS(SVGPropertySpecificKeyframe, Keyframe::PropertySpecificKeyfram e, value, value->isSVGPropertySpecificKeyframe(), value.isSVGPropertySpecificKey frame()); 115 DEFINE_TYPE_CASTS(SVGPropertySpecificKeyframe, Keyframe::PropertySpecificKeyfram e, value, value->isSVGPropertySpecificKeyframe(), value.isSVGPropertySpecificKey frame());
116 116
117 } 117 }
118 118
119 #endif 119 #endif
OLDNEW
« no previous file with comments | « Source/core/animation/ShadowStyleInterpolation.cpp ('k') | Source/core/animation/StringKeyframe.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698