| Index: third_party/WebKit/Source/platform/animation/TimingFunction.cpp
|
| diff --git a/third_party/WebKit/Source/platform/animation/TimingFunction.cpp b/third_party/WebKit/Source/platform/animation/TimingFunction.cpp
|
| index 179f91b7555e18d5558dd4929dc708bc232e6e82..86e7cdc8fa5c12361ab0aa42e943c4326646104f 100644
|
| --- a/third_party/WebKit/Source/platform/animation/TimingFunction.cpp
|
| +++ b/third_party/WebKit/Source/platform/animation/TimingFunction.cpp
|
| @@ -108,6 +108,27 @@ std::unique_ptr<cc::TimingFunction> StepsTimingFunction::CloneToCC() const {
|
| return steps_->Clone();
|
| }
|
|
|
| +String FramesTimingFunction::ToString() const {
|
| + StringBuilder builder;
|
| + builder.Append("frames(");
|
| + builder.Append(String::NumberToStringECMAScript(this->NumberOfFrames()));
|
| + builder.Append(")");
|
| + return builder.ToString();
|
| +}
|
| +
|
| +void FramesTimingFunction::Range(double* min_value, double* max_value) const {
|
| + *min_value = 0;
|
| + *max_value = 1;
|
| +}
|
| +
|
| +double FramesTimingFunction::Evaluate(double fraction, double) const {
|
| + return frames_->GetPreciseValue(fraction);
|
| +}
|
| +
|
| +std::unique_ptr<cc::TimingFunction> FramesTimingFunction::CloneToCC() const {
|
| + return frames_->Clone();
|
| +}
|
| +
|
| PassRefPtr<TimingFunction> CreateCompositorTimingFunctionFromCC(
|
| const cc::TimingFunction* timing_function) {
|
| if (!timing_function)
|
| @@ -169,6 +190,14 @@ bool operator==(const StepsTimingFunction& lhs, const TimingFunction& rhs) {
|
| (lhs.GetStepPosition() == stf.GetStepPosition());
|
| }
|
|
|
| +bool operator==(const FramesTimingFunction& lhs, const TimingFunction& rhs) {
|
| + if (rhs.GetType() != TimingFunction::Type::FRAMES)
|
| + return false;
|
| +
|
| + const FramesTimingFunction& ftf = ToFramesTimingFunction(rhs);
|
| + return lhs.NumberOfFrames() == ftf.NumberOfFrames();
|
| +}
|
| +
|
| // The generic operator== *must* come after the
|
| // non-generic operator== otherwise it will end up calling itself.
|
| bool operator==(const TimingFunction& lhs, const TimingFunction& rhs) {
|
| @@ -185,6 +214,10 @@ bool operator==(const TimingFunction& lhs, const TimingFunction& rhs) {
|
| const StepsTimingFunction& step = ToStepsTimingFunction(lhs);
|
| return (step == rhs);
|
| }
|
| + case TimingFunction::Type::FRAMES: {
|
| + const FramesTimingFunction& frame = ToFramesTimingFunction(lhs);
|
| + return (frame == rhs);
|
| + }
|
| default:
|
| ASSERT_NOT_REACHED();
|
| }
|
|
|