OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 class AnimatableDouble FINAL : public AnimatableValue { | 39 class AnimatableDouble FINAL : public AnimatableValue { |
40 public: | 40 public: |
41 virtual ~AnimatableDouble() { } | 41 virtual ~AnimatableDouble() { } |
42 | 42 |
43 enum Constraint { | 43 enum Constraint { |
44 Unconstrained, | 44 Unconstrained, |
45 InterpolationIsNonContinuousWithZero, | 45 InterpolationIsNonContinuousWithZero, |
46 }; | 46 }; |
47 | 47 |
48 static PassRefPtr<AnimatableDouble> create(double number, Constraint constra
int = Unconstrained) | 48 static PassRefPtrWillBeRawPtr<AnimatableDouble> create(double number, Constr
aint constraint = Unconstrained) |
49 { | 49 { |
50 return adoptRef(new AnimatableDouble(number, constraint)); | 50 return adoptRefWillBeNoop(new AnimatableDouble(number, constraint)); |
51 } | 51 } |
52 | 52 |
53 PassRefPtrWillBeRawPtr<CSSValue> toCSSValue() const; | 53 PassRefPtrWillBeRawPtr<CSSValue> toCSSValue() const; |
54 double toDouble() const { return m_number; } | 54 double toDouble() const { return m_number; } |
55 | 55 |
| 56 virtual void trace(Visitor*) OVERRIDE { } |
| 57 |
56 protected: | 58 protected: |
57 virtual PassRefPtr<AnimatableValue> interpolateTo(const AnimatableValue*, do
uble fraction) const OVERRIDE; | 59 virtual PassRefPtrWillBeRawPtr<AnimatableValue> interpolateTo(const Animatab
leValue*, double fraction) const OVERRIDE; |
58 virtual PassRefPtr<AnimatableValue> addWith(const AnimatableValue*) const OV
ERRIDE; | 60 virtual PassRefPtrWillBeRawPtr<AnimatableValue> addWith(const AnimatableValu
e*) const OVERRIDE; |
59 virtual bool usesDefaultInterpolationWith(const AnimatableValue*) const OVER
RIDE; | 61 virtual bool usesDefaultInterpolationWith(const AnimatableValue*) const OVER
RIDE; |
60 | 62 |
61 private: | 63 private: |
62 AnimatableDouble(double number, Constraint constraint) | 64 AnimatableDouble(double number, Constraint constraint) |
63 : m_number(number) | 65 : m_number(number) |
64 , m_constraint(constraint) | 66 , m_constraint(constraint) |
65 { | 67 { |
66 } | 68 } |
67 virtual AnimatableType type() const OVERRIDE { return TypeDouble; } | 69 virtual AnimatableType type() const OVERRIDE { return TypeDouble; } |
68 virtual bool equalTo(const AnimatableValue*) const OVERRIDE; | 70 virtual bool equalTo(const AnimatableValue*) const OVERRIDE; |
69 virtual double distanceTo(const AnimatableValue*) const OVERRIDE; | 71 virtual double distanceTo(const AnimatableValue*) const OVERRIDE; |
70 | 72 |
71 double m_number; | 73 double m_number; |
72 Constraint m_constraint; | 74 Constraint m_constraint; |
73 }; | 75 }; |
74 | 76 |
75 DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(AnimatableDouble, isDouble()); | 77 DEFINE_ANIMATABLE_VALUE_TYPE_CASTS(AnimatableDouble, isDouble()); |
76 | 78 |
77 } // namespace WebCore | 79 } // namespace WebCore |
78 | 80 |
79 #endif // AnimatableDouble_h | 81 #endif // AnimatableDouble_h |
OLD | NEW |