diff options
Diffstat (limited to 'cc/animation/animation_curve.cc')
-rw-r--r-- | cc/animation/animation_curve.cc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/cc/animation/animation_curve.cc b/cc/animation/animation_curve.cc new file mode 100644 index 0000000..05cda9b --- /dev/null +++ b/cc/animation/animation_curve.cc @@ -0,0 +1,30 @@ +// Copyright 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "cc/animation/animation_curve.h" + +#include "base/logging.h" + +namespace cc { + +const FloatAnimationCurve* AnimationCurve::ToFloatAnimationCurve() const { + DCHECK(Type() == AnimationCurve::Float); + return static_cast<const FloatAnimationCurve*>(this); +} + +AnimationCurve::CurveType FloatAnimationCurve::Type() const { + return Float; +} + +const TransformAnimationCurve* AnimationCurve::ToTransformAnimationCurve() + const { + DCHECK(Type() == AnimationCurve::Transform); + return static_cast<const TransformAnimationCurve*>(this); +} + +AnimationCurve::CurveType TransformAnimationCurve::Type() const { + return Transform; +} + +} // namespace cc |