| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "platform/animation/TimingFunction.h" | 6 #include "platform/animation/TimingFunction.h" |
| 7 | 7 |
| 8 #include "platform/animation/CubicBezierControlPoints.h" | 8 #include "platform/animation/CubicBezierControlPoints.h" |
| 9 #include "wtf/MathExtras.h" | 9 #include "wtf/MathExtras.h" |
| 10 | 10 |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 { | 350 { |
| 351 return rhs.type() == TimingFunction::LinearFunction; | 351 return rhs.type() == TimingFunction::LinearFunction; |
| 352 } | 352 } |
| 353 | 353 |
| 354 bool operator==(const CubicBezierTimingFunction& lhs, const TimingFunction& rhs) | 354 bool operator==(const CubicBezierTimingFunction& lhs, const TimingFunction& rhs) |
| 355 { | 355 { |
| 356 if (rhs.type() != TimingFunction::CubicBezierFunction) | 356 if (rhs.type() != TimingFunction::CubicBezierFunction) |
| 357 return false; | 357 return false; |
| 358 | 358 |
| 359 const CubicBezierTimingFunction& ctf = toCubicBezierTimingFunction(rhs); | 359 const CubicBezierTimingFunction& ctf = toCubicBezierTimingFunction(rhs); |
| 360 if ((lhs.subType() == CubicBezierTimingFunction::Custom) && (ctf.subType() =
= CubicBezierTimingFunction::Custom)) | 360 if ((lhs.subType() == CubicBezierTimingFunction::Custom) && (ctf.subType() =
= CubicBezierTimingFunction::Custom)) { |
| 361 return (lhs.x1() == ctf.x1()) && (lhs.y1() == ctf.y1()) && (lhs.x2() ==
ctf.x2()) && (lhs.y2() == ctf.y2()); | 361 return (lhs.x1() == ctf.x1()) && (lhs.y1() == ctf.y1()) && (lhs.x2() ==
ctf.x2()) && (lhs.y2() == ctf.y2()); |
| 362 } |
| 362 | 363 |
| 363 return lhs.subType() == ctf.subType(); | 364 return lhs.subType() == ctf.subType(); |
| 364 } | 365 } |
| 365 | 366 |
| 366 bool operator==(const StepsTimingFunction& lhs, const TimingFunction& rhs) | 367 bool operator==(const StepsTimingFunction& lhs, const TimingFunction& rhs) |
| 367 { | 368 { |
| 368 if (rhs.type() != TimingFunction::StepsFunction) | 369 if (rhs.type() != TimingFunction::StepsFunction) |
| 369 return false; | 370 return false; |
| 370 | 371 |
| 371 const StepsTimingFunction& stf = toStepsTimingFunction(rhs); | 372 const StepsTimingFunction& stf = toStepsTimingFunction(rhs); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 395 return false; | 396 return false; |
| 396 } | 397 } |
| 397 | 398 |
| 398 // No need to define specific operator!= as they can all come via this function. | 399 // No need to define specific operator!= as they can all come via this function. |
| 399 bool operator!=(const TimingFunction& lhs, const TimingFunction& rhs) | 400 bool operator!=(const TimingFunction& lhs, const TimingFunction& rhs) |
| 400 { | 401 { |
| 401 return !(lhs == rhs); | 402 return !(lhs == rhs); |
| 402 } | 403 } |
| 403 | 404 |
| 404 } // namespace blink | 405 } // namespace blink |
| OLD | NEW |