| Index: third_party/WebKit/Source/core/animation/KeyframeInterpolation.h
|
| diff --git a/third_party/WebKit/Source/core/animation/InvalidatableInterpolation.h b/third_party/WebKit/Source/core/animation/KeyframeInterpolation.h
|
| similarity index 67%
|
| rename from third_party/WebKit/Source/core/animation/InvalidatableInterpolation.h
|
| rename to third_party/WebKit/Source/core/animation/KeyframeInterpolation.h
|
| index 88430934824ade771888b7cd7c378f66db01ec6d..dccdc081a98fc68bb13d6819dcc38fd543566500 100644
|
| --- a/third_party/WebKit/Source/core/animation/InvalidatableInterpolation.h
|
| +++ b/third_party/WebKit/Source/core/animation/KeyframeInterpolation.h
|
| @@ -2,80 +2,79 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef InvalidatableInterpolation_h
|
| -#define InvalidatableInterpolation_h
|
| +#ifndef KeyframeInterpolation_h
|
| +#define KeyframeInterpolation_h
|
|
|
| #include "core/animation/InterpolationType.h"
|
| +#include "core/animation/Keyframe.h"
|
| #include "core/animation/PrimitiveInterpolation.h"
|
| #include "core/animation/PropertyInterpolationTypesMapping.h"
|
| -#include "core/animation/StyleInterpolation.h"
|
| -#include "core/animation/TypedInterpolationValue.h"
|
| +#include "core/animation/StackableInterpolation.h"
|
| #include <memory>
|
|
|
| namespace blink {
|
|
|
| // TODO(alancutter): This class will replace *StyleInterpolation and Interpolation.
|
| // For now it needs to distinguish itself during the refactor and temporarily has an ugly name.
|
| -class CORE_EXPORT InvalidatableInterpolation : public Interpolation {
|
| +class KeyframeInterpolation : public StackableInterpolation {
|
| public:
|
| - static PassRefPtr<InvalidatableInterpolation> create(
|
| + static PassRefPtr<KeyframeInterpolation> create(
|
| PropertyHandle property,
|
| const InterpolationTypes& interpolationTypes,
|
| PassRefPtr<PropertySpecificKeyframe> startKeyframe,
|
| PassRefPtr<PropertySpecificKeyframe> endKeyframe)
|
| {
|
| - return adoptRef(new InvalidatableInterpolation(property, interpolationTypes, startKeyframe, endKeyframe));
|
| + return adoptRef(new KeyframeInterpolation(property, interpolationTypes, startKeyframe, endKeyframe));
|
| }
|
|
|
| PropertyHandle getProperty() const final { return m_property; }
|
| - virtual void interpolate(int iteration, double fraction);
|
| bool dependsOnUnderlyingValue() const final;
|
| - virtual void apply(InterpolationEnvironment&) const { NOTREACHED(); }
|
| static void applyStack(const ActiveInterpolations&, InterpolationEnvironment&);
|
|
|
| - virtual bool isInvalidatableInterpolation() const { return true; }
|
| + virtual bool isKeyframeInterpolation() const { return true; }
|
|
|
| private:
|
| - InvalidatableInterpolation(
|
| + KeyframeInterpolation(
|
| PropertyHandle property,
|
| const InterpolationTypes& interpolationTypes,
|
| PassRefPtr<PropertySpecificKeyframe> startKeyframe,
|
| PassRefPtr<PropertySpecificKeyframe> endKeyframe)
|
| - : Interpolation(nullptr, nullptr)
|
| - , m_property(property)
|
| + : m_property(property)
|
| , m_interpolationTypes(interpolationTypes)
|
| , m_startKeyframe(startKeyframe)
|
| , m_endKeyframe(endKeyframe)
|
| - , m_currentFraction(std::numeric_limits<double>::quiet_NaN())
|
| + , m_previousFraction(std::numeric_limits<double>::quiet_NaN())
|
| , m_isCached(false)
|
| { }
|
|
|
| using ConversionCheckers = InterpolationType::ConversionCheckers;
|
|
|
| - std::unique_ptr<TypedInterpolationValue> maybeConvertUnderlyingValue(const InterpolationEnvironment&) const;
|
| - const TypedInterpolationValue* ensureValidInterpolation(const InterpolationEnvironment&, const UnderlyingValueOwner&) const;
|
| + void interpolateImpl() final;
|
| + std::unique_ptr<TypedInterpolationValue> maybeConvertUnderlyingValue(const InterpolationEnvironment&) const final;
|
| + const TypedInterpolationValue* ensureValidInterpolation(const InterpolationEnvironment&, const UnderlyingValueOwner&) const final;
|
| + void setFlagIfInheritUsed(InterpolationEnvironment&) const final;
|
| + double underlyingFraction() const final;
|
| +
|
| void clearCache() const;
|
| bool isCacheValid(const InterpolationEnvironment&, const UnderlyingValueOwner&) const;
|
| bool isNeutralKeyframeActive() const;
|
| std::unique_ptr<PairwisePrimitiveInterpolation> maybeConvertPairwise(const InterpolationEnvironment&, const UnderlyingValueOwner&) const;
|
| std::unique_ptr<TypedInterpolationValue> convertSingleKeyframe(const PropertySpecificKeyframe&, const InterpolationEnvironment&, const UnderlyingValueOwner&) const;
|
| void addConversionCheckers(const InterpolationType&, ConversionCheckers&) const;
|
| - void setFlagIfInheritUsed(InterpolationEnvironment&) const;
|
| - double underlyingFraction() const;
|
|
|
| const PropertyHandle m_property;
|
| const InterpolationTypes& m_interpolationTypes;
|
| RefPtr<PropertySpecificKeyframe> m_startKeyframe;
|
| RefPtr<PropertySpecificKeyframe> m_endKeyframe;
|
| - double m_currentFraction;
|
| + double m_previousFraction;
|
| mutable bool m_isCached;
|
| mutable std::unique_ptr<PrimitiveInterpolation> m_cachedPairConversion;
|
| mutable ConversionCheckers m_conversionCheckers;
|
| mutable std::unique_ptr<TypedInterpolationValue> m_cachedValue;
|
| };
|
|
|
| -DEFINE_TYPE_CASTS(InvalidatableInterpolation, Interpolation, value, value->isInvalidatableInterpolation(), value.isInvalidatableInterpolation());
|
| +DEFINE_TYPE_CASTS(KeyframeInterpolation, Interpolation, value, value->isKeyframeInterpolation(), value.isKeyframeInterpolation());
|
|
|
| } // namespace blink
|
|
|
| -#endif // InvalidatableInterpolation_h
|
| +#endif // KeyframeInterpolation_h
|
|
|