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

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

Issue 2649103007: Make PropertyHandle instances const references where possible (Closed)
Patch Set: Created 3 years, 11 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 InvalidatableInterpolation_h 5 #ifndef InvalidatableInterpolation_h
6 #define InvalidatableInterpolation_h 6 #define InvalidatableInterpolation_h
7 7
8 #include "core/animation/Interpolation.h" 8 #include "core/animation/Interpolation.h"
9 #include "core/animation/InterpolationType.h" 9 #include "core/animation/InterpolationType.h"
10 #include "core/animation/InterpolationTypesMap.h" 10 #include "core/animation/InterpolationTypesMap.h"
11 #include "core/animation/PrimitiveInterpolation.h" 11 #include "core/animation/PrimitiveInterpolation.h"
12 #include "core/animation/TypedInterpolationValue.h" 12 #include "core/animation/TypedInterpolationValue.h"
13 #include <memory> 13 #include <memory>
14 14
15 namespace blink { 15 namespace blink {
16 16
17 // TODO(alancutter): This class will replace *StyleInterpolation and 17 // TODO(alancutter): This class will replace *StyleInterpolation and
18 // Interpolation. For now it needs to distinguish itself during the refactor and 18 // Interpolation. For now it needs to distinguish itself during the refactor and
19 // temporarily has an ugly name. 19 // temporarily has an ugly name.
20 class CORE_EXPORT InvalidatableInterpolation : public Interpolation { 20 class CORE_EXPORT InvalidatableInterpolation : public Interpolation {
21 public: 21 public:
22 static PassRefPtr<InvalidatableInterpolation> create( 22 static PassRefPtr<InvalidatableInterpolation> create(
23 PropertyHandle property, 23 const PropertyHandle& property,
24 PassRefPtr<PropertySpecificKeyframe> startKeyframe, 24 PassRefPtr<PropertySpecificKeyframe> startKeyframe,
25 PassRefPtr<PropertySpecificKeyframe> endKeyframe) { 25 PassRefPtr<PropertySpecificKeyframe> endKeyframe) {
26 return adoptRef(new InvalidatableInterpolation( 26 return adoptRef(new InvalidatableInterpolation(
27 property, std::move(startKeyframe), std::move(endKeyframe))); 27 property, std::move(startKeyframe), std::move(endKeyframe)));
28 } 28 }
29 29
30 PropertyHandle getProperty() const final { return m_property; } 30 const PropertyHandle& getProperty() const final { return m_property; }
31 virtual void interpolate(int iteration, double fraction); 31 virtual void interpolate(int iteration, double fraction);
32 bool dependsOnUnderlyingValue() const final; 32 bool dependsOnUnderlyingValue() const final;
33 static void applyStack(const ActiveInterpolations&, 33 static void applyStack(const ActiveInterpolations&,
34 InterpolationEnvironment&); 34 InterpolationEnvironment&);
35 35
36 virtual bool isInvalidatableInterpolation() const { return true; } 36 virtual bool isInvalidatableInterpolation() const { return true; }
37 37
38 private: 38 private:
39 InvalidatableInterpolation(PropertyHandle property, 39 InvalidatableInterpolation(const PropertyHandle& property,
40 PassRefPtr<PropertySpecificKeyframe> startKeyframe, 40 PassRefPtr<PropertySpecificKeyframe> startKeyframe,
41 PassRefPtr<PropertySpecificKeyframe> endKeyframe) 41 PassRefPtr<PropertySpecificKeyframe> endKeyframe)
42 : Interpolation(), 42 : Interpolation(),
43 m_property(property), 43 m_property(property),
44 m_interpolationTypes(nullptr), 44 m_interpolationTypes(nullptr),
45 m_interpolationTypesVersion(0), 45 m_interpolationTypesVersion(0),
46 m_startKeyframe(startKeyframe), 46 m_startKeyframe(startKeyframe),
47 m_endKeyframe(endKeyframe), 47 m_endKeyframe(endKeyframe),
48 m_currentFraction(std::numeric_limits<double>::quiet_NaN()), 48 m_currentFraction(std::numeric_limits<double>::quiet_NaN()),
49 m_isConversionCached(false) {} 49 m_isConversionCached(false) {}
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 86
87 DEFINE_TYPE_CASTS(InvalidatableInterpolation, 87 DEFINE_TYPE_CASTS(InvalidatableInterpolation,
88 Interpolation, 88 Interpolation,
89 value, 89 value,
90 value->isInvalidatableInterpolation(), 90 value->isInvalidatableInterpolation(),
91 value.isInvalidatableInterpolation()); 91 value.isInvalidatableInterpolation());
92 92
93 } // namespace blink 93 } // namespace blink
94 94
95 #endif // InvalidatableInterpolation_h 95 #endif // InvalidatableInterpolation_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/animation/InterpolationEffect.cpp ('k') | third_party/WebKit/Source/core/animation/Keyframe.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698