Chromium Code Reviews| Index: Source/core/animation/AnimatableDouble.h |
| diff --git a/Source/core/animation/AnimatableTransform.h b/Source/core/animation/AnimatableDouble.h |
| similarity index 69% |
| copy from Source/core/animation/AnimatableTransform.h |
| copy to Source/core/animation/AnimatableDouble.h |
| index cececfe45afd3344a927cf50373e5f25becb258b..303ff950a1b6a16be8d76b75302ba0f176af7903 100644 |
| --- a/Source/core/animation/AnimatableTransform.h |
| +++ b/Source/core/animation/AnimatableDouble.h |
| @@ -28,43 +28,47 @@ |
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| */ |
| -#ifndef AnimatableTransform_h |
| -#define AnimatableTransform_h |
| +#ifndef AnimatableDouble_h |
| +#define AnimatableDouble_h |
| #include "core/animation/AnimatableValue.h" |
| -#include "core/platform/graphics/transforms/TransformOperations.h" |
| +#include "core/css/CSSValue.h" |
| +#include "wtf/MathExtras.h" |
|
Timothy Loh
2013/09/30 23:27:59
Is this used here?
alancutter (OOO until 2018)
2013/10/01 09:32:24
Removed.
|
| namespace WebCore { |
| -class AnimatableTransform : public AnimatableValue { |
| +class AnimatableDouble : public AnimatableValue { |
| public: |
| - virtual ~AnimatableTransform() { } |
| - static PassRefPtr<AnimatableTransform> create(const TransformOperations&); |
| - const TransformOperations& transformOperations() const |
| + virtual ~AnimatableDouble() { } |
| + |
| + static PassRefPtr<AnimatableDouble> create(double number) |
| { |
| - return m_transform; |
| + return adoptRef(new AnimatableDouble(number)); |
| } |
| + PassRefPtr<CSSValue> toCSSValue() const; |
| + double toDouble() const { return m_number; } |
| + |
| protected: |
| virtual PassRefPtr<AnimatableValue> interpolateTo(const AnimatableValue*, double fraction) const OVERRIDE; |
| virtual PassRefPtr<AnimatableValue> addWith(const AnimatableValue*) const OVERRIDE; |
| private: |
| - explicit AnimatableTransform(const TransformOperations& transform) |
| - : m_transform(transform) |
| + AnimatableDouble(double number) |
| + : m_number(number) |
| { |
| } |
| - virtual AnimatableType type() const OVERRIDE { return TypeTransform; } |
| - const TransformOperations m_transform; |
| + virtual AnimatableType type() const OVERRIDE { return TypeDouble; } |
| + |
| + double m_number; |
| }; |
| -inline const AnimatableTransform* toAnimatableTransform(const AnimatableValue* value) |
| +inline const AnimatableDouble* toAnimatableDouble(const AnimatableValue* value) |
| { |
| - ASSERT_WITH_SECURITY_IMPLICATION(value && value->isTransform()); |
| - return static_cast<const AnimatableTransform*>(value); |
| + ASSERT_WITH_SECURITY_IMPLICATION(value && value->isDouble()); |
| + return static_cast<const AnimatableDouble*>(value); |
| } |
| } // namespace WebCore |
| -#endif // AnimatableTransform_h |
| - |
| +#endif // AnimatableDouble_h |