Chromium Code Reviews| Index: Source/core/animation/LegacyStyleInterpolation.h |
| diff --git a/Source/core/animation/LegacyStyleInterpolation.h b/Source/core/animation/LegacyStyleInterpolation.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cf9561887eec35ccbcc9a178a6f44fd727f45ba7 |
| --- /dev/null |
| +++ b/Source/core/animation/LegacyStyleInterpolation.h |
| @@ -0,0 +1,57 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef LegacyStyleInterpolation_h |
| +#define LegacyStyleInterpolation_h |
| + |
| +#include "core/animation/InterpolableValuePromise.h" |
| +#include "core/animation/Interpolation.h" |
| + |
| +namespace WebCore { |
| + |
| +class LegacyStyleInterpolation : public StyleInterpolation { |
| +public: |
| + static PassRefPtrWillBeRawPtr<LegacyStyleInterpolation> create(PassRefPtrWillBeRawPtr<InterpolableValuePromise> start, PassRefPtrWillBeRawPtr<InterpolableValuePromise> end, CSSPropertyID); |
| + |
| + static PassRefPtrWillBeRawPtr<LegacyStyleInterpolation> create(PassRefPtrWillBeRawPtr<AnimatableValue> start, PassRefPtrWillBeRawPtr<AnimatableValue> end, CSSPropertyID id) |
|
shans
2014/05/08 16:12:58
Why do we still have this? The point of Interpolab
|
| + { |
| + return adoptRefWillBeNoop(new LegacyStyleInterpolation(InterpolableAnimatableValue::create(start), InterpolableAnimatableValue::create(end), id)); |
| + } |
| + |
| + virtual void apply(StyleResolverState&) const OVERRIDE; |
| + |
| + virtual bool isLegacyStyleInterpolation() const OVERRIDE FINAL { return true; } |
| + |
| + PassRefPtrWillBeRawPtr<AnimatableValue> currentValue() const |
| + { |
| + InterpolableAnimatableValue* value = static_cast<InterpolableAnimatableValue*>(m_cachedValue.get()); |
| + return value ? value->value() : 0; |
| + } |
| + |
| + virtual void trace(Visitor*) OVERRIDE; |
| + |
| +private: |
| + LegacyStyleInterpolation(PassRefPtrWillBeRawPtr<InterpolableValuePromise> start, PassRefPtrWillBeRawPtr<InterpolableValuePromise> end, CSSPropertyID id) |
| + : StyleInterpolation(nullptr, nullptr, id) |
| + , m_startPromise(start) |
| + , m_endPromise(end) |
| + { |
| + } |
| + |
| + LegacyStyleInterpolation(PassOwnPtrWillBeRawPtr<InterpolableValue> startValue, PassOwnPtrWillBeRawPtr<InterpolableValue> endValue, CSSPropertyID id) |
| + : StyleInterpolation(startValue, endValue, id) |
| + , m_startPromise(nullptr) |
| + , m_endPromise(nullptr) |
| + { |
| + } |
| + |
| + const RefPtrWillBeMember<InterpolableValuePromise> m_startPromise; |
| + const RefPtrWillBeMember<InterpolableValuePromise> m_endPromise; |
| +}; |
| + |
| +DEFINE_TYPE_CASTS(LegacyStyleInterpolation, Interpolation, value, value->isLegacyStyleInterpolation(), value.isLegacyStyleInterpolation()); |
| + |
| +} |
| + |
| +#endif |