| 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 { return Color; } | 17 AnimationCurve::CurveType ColorAnimationCurve::Type() const { |
| 18 return COLOR; |
| 19 } |
| 18 | 20 |
| 19 const FloatAnimationCurve* AnimationCurve::ToFloatAnimationCurve() const { | 21 const FloatAnimationCurve* AnimationCurve::ToFloatAnimationCurve() const { |
| 20 DCHECK(Type() == AnimationCurve::Float); | 22 DCHECK(Type() == AnimationCurve::FLOAT); |
| 21 return static_cast<const FloatAnimationCurve*>(this); | 23 return static_cast<const FloatAnimationCurve*>(this); |
| 22 } | 24 } |
| 23 | 25 |
| 24 AnimationCurve::CurveType FloatAnimationCurve::Type() const { | 26 AnimationCurve::CurveType FloatAnimationCurve::Type() const { |
| 25 return Float; | 27 return FLOAT; |
| 26 } | 28 } |
| 27 | 29 |
| 28 const TransformAnimationCurve* AnimationCurve::ToTransformAnimationCurve() | 30 const TransformAnimationCurve* AnimationCurve::ToTransformAnimationCurve() |
| 29 const { | 31 const { |
| 30 DCHECK(Type() == AnimationCurve::Transform); | 32 DCHECK(Type() == AnimationCurve::TRANSFORM); |
| 31 return static_cast<const TransformAnimationCurve*>(this); | 33 return static_cast<const TransformAnimationCurve*>(this); |
| 32 } | 34 } |
| 33 | 35 |
| 34 AnimationCurve::CurveType TransformAnimationCurve::Type() const { | 36 AnimationCurve::CurveType TransformAnimationCurve::Type() const { |
| 35 return Transform; | 37 return TRANSFORM; |
| 36 } | 38 } |
| 37 | 39 |
| 38 const FilterAnimationCurve* AnimationCurve::ToFilterAnimationCurve() const { | 40 const FilterAnimationCurve* AnimationCurve::ToFilterAnimationCurve() const { |
| 39 DCHECK(Type() == AnimationCurve::Filter); | 41 DCHECK(Type() == AnimationCurve::FILTER); |
| 40 return static_cast<const FilterAnimationCurve*>(this); | 42 return static_cast<const FilterAnimationCurve*>(this); |
| 41 } | 43 } |
| 42 | 44 |
| 43 AnimationCurve::CurveType FilterAnimationCurve::Type() const { | 45 AnimationCurve::CurveType FilterAnimationCurve::Type() const { |
| 44 return Filter; | 46 return FILTER; |
| 45 } | 47 } |
| 46 | 48 |
| 47 const ScrollOffsetAnimationCurve* AnimationCurve::ToScrollOffsetAnimationCurve() | 49 const ScrollOffsetAnimationCurve* AnimationCurve::ToScrollOffsetAnimationCurve() |
| 48 const { | 50 const { |
| 49 DCHECK(Type() == AnimationCurve::ScrollOffset); | 51 DCHECK(Type() == AnimationCurve::SCROLL_OFFSET); |
| 50 return static_cast<const ScrollOffsetAnimationCurve*>(this); | 52 return static_cast<const ScrollOffsetAnimationCurve*>(this); |
| 51 } | 53 } |
| 52 | 54 |
| 53 ScrollOffsetAnimationCurve* AnimationCurve::ToScrollOffsetAnimationCurve() { | 55 ScrollOffsetAnimationCurve* AnimationCurve::ToScrollOffsetAnimationCurve() { |
| 54 DCHECK(Type() == AnimationCurve::ScrollOffset); | 56 DCHECK(Type() == AnimationCurve::SCROLL_OFFSET); |
| 55 return static_cast<ScrollOffsetAnimationCurve*>(this); | 57 return static_cast<ScrollOffsetAnimationCurve*>(this); |
| 56 } | 58 } |
| 57 | 59 |
| 58 } // namespace cc | 60 } // namespace cc |
| OLD | NEW |