| OLD | NEW |
| 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/InterpolationType.h" | 8 #include "core/animation/InterpolationType.h" |
| 9 #include "core/animation/PrimitiveInterpolation.h" | 9 #include "core/animation/PrimitiveInterpolation.h" |
| 10 #include "core/animation/PropertyInterpolationTypesMapping.h" | 10 #include "core/animation/PropertyInterpolationTypesMapping.h" |
| 11 #include "core/animation/StyleInterpolation.h" | 11 #include "core/animation/StyleInterpolation.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 Interpolati
on. | 17 // TODO(alancutter): This class will replace *StyleInterpolation and Interpolati
on. |
| 18 // For now it needs to distinguish itself during the refactor and temporarily ha
s an ugly name. | 18 // For now it needs to distinguish itself during the refactor and temporarily ha
s an ugly name. |
| 19 class CORE_EXPORT InvalidatableInterpolation : public Interpolation { | 19 class CORE_EXPORT InvalidatableInterpolation : public Interpolation { |
| 20 public: | 20 public: |
| 21 static PassRefPtr<InvalidatableInterpolation> create( | 21 static PassRefPtr<InvalidatableInterpolation> create( |
| 22 PropertyHandle property, | 22 PropertyHandle property, |
| 23 const InterpolationTypes& interpolationTypes, | 23 const InterpolationTypes& interpolationTypes, |
| 24 PassRefPtr<PropertySpecificKeyframe> startKeyframe, | 24 PassRefPtr<PropertySpecificKeyframe> startKeyframe, |
| 25 PassRefPtr<PropertySpecificKeyframe> endKeyframe) | 25 PassRefPtr<PropertySpecificKeyframe> endKeyframe) |
| 26 { | 26 { |
| 27 return adoptRef(new InvalidatableInterpolation(property, interpolationTy
pes, startKeyframe, endKeyframe)); | 27 return adoptRef(new InvalidatableInterpolation(property, interpolationTy
pes, std::move(startKeyframe), std::move(endKeyframe))); |
| 28 } | 28 } |
| 29 | 29 |
| 30 PropertyHandle getProperty() const final { return m_property; } | 30 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 virtual void apply(InterpolationEnvironment&) const { NOTREACHED(); } | 33 virtual void apply(InterpolationEnvironment&) const { NOTREACHED(); } |
| 34 static void applyStack(const ActiveInterpolations&, InterpolationEnvironment
&); | 34 static void applyStack(const ActiveInterpolations&, InterpolationEnvironment
&); |
| 35 | 35 |
| 36 virtual bool isInvalidatableInterpolation() const { return true; } | 36 virtual bool isInvalidatableInterpolation() const { return true; } |
| 37 | 37 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 mutable std::unique_ptr<PrimitiveInterpolation> m_cachedPairConversion; | 72 mutable std::unique_ptr<PrimitiveInterpolation> m_cachedPairConversion; |
| 73 mutable ConversionCheckers m_conversionCheckers; | 73 mutable ConversionCheckers m_conversionCheckers; |
| 74 mutable std::unique_ptr<TypedInterpolationValue> m_cachedValue; | 74 mutable std::unique_ptr<TypedInterpolationValue> m_cachedValue; |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 DEFINE_TYPE_CASTS(InvalidatableInterpolation, Interpolation, value, value->isInv
alidatableInterpolation(), value.isInvalidatableInterpolation()); | 77 DEFINE_TYPE_CASTS(InvalidatableInterpolation, Interpolation, value, value->isInv
alidatableInterpolation(), value.isInvalidatableInterpolation()); |
| 78 | 78 |
| 79 } // namespace blink | 79 } // namespace blink |
| 80 | 80 |
| 81 #endif // InvalidatableInterpolation_h | 81 #endif // InvalidatableInterpolation_h |
| OLD | NEW |