diff options
author | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-12 22:43:41 +0000 |
---|---|---|
committer | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-12 22:43:41 +0000 |
commit | cd57cc5a246367c2558fefa04ae9eca8f4d545d2 (patch) | |
tree | a2235045e9c5e4ff028d641b76f5d01aa5461b26 /cc/keyframed_animation_curve.h | |
parent | 3fe7ba055be580443445895c0ee01ada3b628487 (diff) | |
download | chromium_src-cd57cc5a246367c2558fefa04ae9eca8f4d545d2.zip chromium_src-cd57cc5a246367c2558fefa04ae9eca8f4d545d2.tar.gz chromium_src-cd57cc5a246367c2558fefa04ae9eca8f4d545d2.tar.bz2 |
[cc] Rename all cc/ filenames to Chromium style
BUG=155413
Review URL: https://codereview.chromium.org/11122003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161671 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/keyframed_animation_curve.h')
-rw-r--r-- | cc/keyframed_animation_curve.h | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/cc/keyframed_animation_curve.h b/cc/keyframed_animation_curve.h index 638cbb2..066e5c6 100644 --- a/cc/keyframed_animation_curve.h +++ b/cc/keyframed_animation_curve.h @@ -1,3 +1,109 @@ // 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. + +#ifndef CCKeyframedAnimationCurve_h +#define CCKeyframedAnimationCurve_h + +#include "CCAnimationCurve.h" +#include "CCTimingFunction.h" +#include "scoped_ptr_vector.h" +#include <public/WebTransformOperations.h> + +namespace cc { + +class CCKeyframe { +public: + double time() const; + const CCTimingFunction* timingFunction() const; + +protected: + CCKeyframe(double time, scoped_ptr<CCTimingFunction>); + virtual ~CCKeyframe(); + +private: + double m_time; + scoped_ptr<CCTimingFunction> m_timingFunction; +}; + +class CCFloatKeyframe : public CCKeyframe { +public: + static scoped_ptr<CCFloatKeyframe> create(double time, float value, scoped_ptr<CCTimingFunction>); + virtual ~CCFloatKeyframe(); + + float value() const; + + scoped_ptr<CCFloatKeyframe> clone() const; + +private: + CCFloatKeyframe(double time, float value, scoped_ptr<CCTimingFunction>); + + float m_value; +}; + +class CCTransformKeyframe : public CCKeyframe { +public: + static scoped_ptr<CCTransformKeyframe> create(double time, const WebKit::WebTransformOperations& value, scoped_ptr<CCTimingFunction>); + virtual ~CCTransformKeyframe(); + + const WebKit::WebTransformOperations& value() const; + + scoped_ptr<CCTransformKeyframe> clone() const; + +private: + CCTransformKeyframe(double time, const WebKit::WebTransformOperations& value, scoped_ptr<CCTimingFunction>); + + WebKit::WebTransformOperations m_value; +}; + +class CCKeyframedFloatAnimationCurve : public CCFloatAnimationCurve { +public: + // It is required that the keyframes be sorted by time. + static scoped_ptr<CCKeyframedFloatAnimationCurve> create(); + + virtual ~CCKeyframedFloatAnimationCurve(); + + void addKeyframe(scoped_ptr<CCFloatKeyframe>); + + // CCAnimationCurve implementation + virtual double duration() const OVERRIDE; + virtual scoped_ptr<CCAnimationCurve> clone() const OVERRIDE; + + // CCFloatAnimationCurve implementation + virtual float getValue(double t) const OVERRIDE; + +private: + CCKeyframedFloatAnimationCurve(); + + // Always sorted in order of increasing time. No two keyframes have the + // same time. + ScopedPtrVector<CCFloatKeyframe> m_keyframes; +}; + +class CCKeyframedTransformAnimationCurve : public CCTransformAnimationCurve { +public: + // It is required that the keyframes be sorted by time. + static scoped_ptr<CCKeyframedTransformAnimationCurve> create(); + + virtual ~CCKeyframedTransformAnimationCurve(); + + void addKeyframe(scoped_ptr<CCTransformKeyframe>); + + // CCAnimationCurve implementation + virtual double duration() const OVERRIDE; + virtual scoped_ptr<CCAnimationCurve> clone() const OVERRIDE; + + // CCTransformAnimationCurve implementation + virtual WebKit::WebTransformationMatrix getValue(double t) const OVERRIDE; + +private: + CCKeyframedTransformAnimationCurve(); + + // Always sorted in order of increasing time. No two keyframes have the + // same time. + ScopedPtrVector<CCTransformKeyframe> m_keyframes; +}; + +} // namespace cc + +#endif // CCKeyframedAnimationCurve_h |