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
3 // found in the LICENSE file.
5 #include "cc/animation/animation_curve.h"
7 #include "base/logging.h"
8 #include "cc/animation/scroll_offset_animation_curve.h"
12 const ColorAnimationCurve
* AnimationCurve::ToColorAnimationCurve() const {
13 DCHECK(Type() == AnimationCurve::COLOR
);
14 return static_cast<const ColorAnimationCurve
*>(this);
17 AnimationCurve::CurveType
ColorAnimationCurve::Type() const {
21 const FloatAnimationCurve
* AnimationCurve::ToFloatAnimationCurve() const {
22 DCHECK(Type() == AnimationCurve::FLOAT
);
23 return static_cast<const FloatAnimationCurve
*>(this);
26 AnimationCurve::CurveType
FloatAnimationCurve::Type() const {
30 const TransformAnimationCurve
* AnimationCurve::ToTransformAnimationCurve()
32 DCHECK(Type() == AnimationCurve::TRANSFORM
);
33 return static_cast<const TransformAnimationCurve
*>(this);
36 AnimationCurve::CurveType
TransformAnimationCurve::Type() const {
40 const FilterAnimationCurve
* AnimationCurve::ToFilterAnimationCurve() const {
41 DCHECK(Type() == AnimationCurve::FILTER
);
42 return static_cast<const FilterAnimationCurve
*>(this);
45 AnimationCurve::CurveType
FilterAnimationCurve::Type() const {
49 const ScrollOffsetAnimationCurve
* AnimationCurve::ToScrollOffsetAnimationCurve()
51 DCHECK(Type() == AnimationCurve::SCROLL_OFFSET
);
52 return static_cast<const ScrollOffsetAnimationCurve
*>(this);
55 ScrollOffsetAnimationCurve
* AnimationCurve::ToScrollOffsetAnimationCurve() {
56 DCHECK(Type() == AnimationCurve::SCROLL_OFFSET
);
57 return static_cast<ScrollOffsetAnimationCurve
*>(this);