OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #include "cc/animation/animation_curve.h" | 5 #include "cc/animation/animation_curve.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "cc/animation/scroll_offset_animation_curve.h" | 8 #include "cc/animation/scroll_offset_animation_curve.h" |
9 | 9 |
10 namespace cc { | 10 namespace cc { |
11 | 11 |
12 const ColorAnimationCurve* AnimationCurve::ToColorAnimationCurve() const { | 12 const ColorAnimationCurve* AnimationCurve::ToColorAnimationCurve() const { |
13 DCHECK(Type() == AnimationCurve::COLOR); | 13 DCHECK(Type() == AnimationCurve::Color); |
14 return static_cast<const ColorAnimationCurve*>(this); | 14 return static_cast<const ColorAnimationCurve*>(this); |
15 } | 15 } |
16 | 16 |
17 AnimationCurve::CurveType ColorAnimationCurve::Type() const { | 17 AnimationCurve::CurveType ColorAnimationCurve::Type() const { return Color; } |
18 return COLOR; | |
19 } | |
20 | 18 |
21 const FloatAnimationCurve* AnimationCurve::ToFloatAnimationCurve() const { | 19 const FloatAnimationCurve* AnimationCurve::ToFloatAnimationCurve() const { |
22 DCHECK(Type() == AnimationCurve::FLOAT); | 20 DCHECK(Type() == AnimationCurve::Float); |
23 return static_cast<const FloatAnimationCurve*>(this); | 21 return static_cast<const FloatAnimationCurve*>(this); |
24 } | 22 } |
25 | 23 |
26 AnimationCurve::CurveType FloatAnimationCurve::Type() const { | 24 AnimationCurve::CurveType FloatAnimationCurve::Type() const { |
27 return FLOAT; | 25 return Float; |
28 } | 26 } |
29 | 27 |
30 const TransformAnimationCurve* AnimationCurve::ToTransformAnimationCurve() | 28 const TransformAnimationCurve* AnimationCurve::ToTransformAnimationCurve() |
31 const { | 29 const { |
32 DCHECK(Type() == AnimationCurve::TRANSFORM); | 30 DCHECK(Type() == AnimationCurve::Transform); |
33 return static_cast<const TransformAnimationCurve*>(this); | 31 return static_cast<const TransformAnimationCurve*>(this); |
34 } | 32 } |
35 | 33 |
36 AnimationCurve::CurveType TransformAnimationCurve::Type() const { | 34 AnimationCurve::CurveType TransformAnimationCurve::Type() const { |
37 return TRANSFORM; | 35 return Transform; |
38 } | 36 } |
39 | 37 |
40 const FilterAnimationCurve* AnimationCurve::ToFilterAnimationCurve() const { | 38 const FilterAnimationCurve* AnimationCurve::ToFilterAnimationCurve() const { |
41 DCHECK(Type() == AnimationCurve::FILTER); | 39 DCHECK(Type() == AnimationCurve::Filter); |
42 return static_cast<const FilterAnimationCurve*>(this); | 40 return static_cast<const FilterAnimationCurve*>(this); |
43 } | 41 } |
44 | 42 |
45 AnimationCurve::CurveType FilterAnimationCurve::Type() const { | 43 AnimationCurve::CurveType FilterAnimationCurve::Type() const { |
46 return FILTER; | 44 return Filter; |
47 } | 45 } |
48 | 46 |
49 const ScrollOffsetAnimationCurve* AnimationCurve::ToScrollOffsetAnimationCurve() | 47 const ScrollOffsetAnimationCurve* AnimationCurve::ToScrollOffsetAnimationCurve() |
50 const { | 48 const { |
51 DCHECK(Type() == AnimationCurve::SCROLL_OFFSET); | 49 DCHECK(Type() == AnimationCurve::ScrollOffset); |
52 return static_cast<const ScrollOffsetAnimationCurve*>(this); | 50 return static_cast<const ScrollOffsetAnimationCurve*>(this); |
53 } | 51 } |
54 | 52 |
55 ScrollOffsetAnimationCurve* AnimationCurve::ToScrollOffsetAnimationCurve() { | 53 ScrollOffsetAnimationCurve* AnimationCurve::ToScrollOffsetAnimationCurve() { |
56 DCHECK(Type() == AnimationCurve::SCROLL_OFFSET); | 54 DCHECK(Type() == AnimationCurve::ScrollOffset); |
57 return static_cast<ScrollOffsetAnimationCurve*>(this); | 55 return static_cast<ScrollOffsetAnimationCurve*>(this); |
58 } | 56 } |
59 | 57 |
60 } // namespace cc | 58 } // namespace cc |
OLD | NEW |