| Index: cc/animation/timing_function.h
|
| diff --git a/cc/animation/timing_function.h b/cc/animation/timing_function.h
|
| index 0f475e7624a1a2f82c0c3aed3a4ac8fa1bf090b7..5ff8d3561bd82e3f174d2a1ee7879f309ae77269 100644
|
| --- a/cc/animation/timing_function.h
|
| +++ b/cc/animation/timing_function.h
|
| @@ -19,7 +19,7 @@ class CC_ANIMATION_EXPORT TimingFunction {
|
| virtual ~TimingFunction();
|
|
|
| // Note that LINEAR is a nullptr TimingFunction (for now).
|
| - enum class Type { LINEAR, CUBIC_BEZIER, STEPS };
|
| + enum class Type { LINEAR, CUBIC_BEZIER, STEPS, FRAMES };
|
|
|
| virtual Type GetType() const = 0;
|
| virtual float GetValue(double t) const = 0;
|
| @@ -101,6 +101,29 @@ class CC_ANIMATION_EXPORT StepsTimingFunction : public TimingFunction {
|
| DISALLOW_ASSIGN(StepsTimingFunction);
|
| };
|
|
|
| +class CC_ANIMATION_EXPORT FramesTimingFunction : public TimingFunction {
|
| + public:
|
| + static std::unique_ptr<FramesTimingFunction> Create(int frames);
|
| + ~FramesTimingFunction() override;
|
| +
|
| + // TimingFunction implementation.
|
| + Type GetType() const override;
|
| + float GetValue(double t) const override;
|
| + std::unique_ptr<TimingFunction> Clone() const override;
|
| + void Range(float* min, float* max) const override;
|
| + float Velocity(double time) const override;
|
| +
|
| + int frames() const { return frames_; }
|
| + double GetPreciseValue(double t) const;
|
| +
|
| + private:
|
| + explicit FramesTimingFunction(int frames);
|
| +
|
| + int frames_;
|
| +
|
| + DISALLOW_ASSIGN(FramesTimingFunction);
|
| +};
|
| +
|
| } // namespace cc
|
|
|
| #endif // CC_ANIMATION_TIMING_FUNCTION_H_
|
|
|