Chromium Code Reviews| Index: include/core/SkPath.h |
| diff --git a/include/core/SkPath.h b/include/core/SkPath.h |
| index 99f8242ff7de59167a0e69a1004c8fe8e3120c4b..b3de26720f407e1746f87600a50c4da7fc77123c 100644 |
| --- a/include/core/SkPath.h |
| +++ b/include/core/SkPath.h |
| @@ -206,8 +206,8 @@ public: |
| @return true if the line is of zero length; otherwise false. |
| */ |
| - static bool IsLineDegenerate(const SkPoint& p1, const SkPoint& p2) { |
| - return p1.equalsWithinTolerance(p2); |
| + static bool IsLineDegenerate(const SkPoint& p1, const SkPoint& p2, bool exact) { |
| + return exact ? p1 == p2 : p1.equalsWithinTolerance(p2); |
| } |
| /** Test a quad for zero length |
| @@ -215,8 +215,8 @@ public: |
| @return true if the quad is of zero length; otherwise false. |
| */ |
| static bool IsQuadDegenerate(const SkPoint& p1, const SkPoint& p2, |
| - const SkPoint& p3) { |
| - return p1.equalsWithinTolerance(p2) && |
| + const SkPoint& p3, bool exact) { |
| + return exact ? p1 == p2 && p2 == p3 : p1.equalsWithinTolerance(p2) && |
| p2.equalsWithinTolerance(p3); |
| } |
| @@ -225,8 +225,8 @@ public: |
| @return true if the cubic is of zero length; otherwise false. |
| */ |
| static bool IsCubicDegenerate(const SkPoint& p1, const SkPoint& p2, |
| - const SkPoint& p3, const SkPoint& p4) { |
| - return p1.equalsWithinTolerance(p2) && |
| + const SkPoint& p3, const SkPoint& p4, bool exact) { |
| + return exact ? p1 == p2 && p2 == p3 && p3 == p4 : p1.equalsWithinTolerance(p2) && |
| p2.equalsWithinTolerance(p3) && |
| p3.equalsWithinTolerance(p4); |
| } |
| @@ -802,9 +802,9 @@ public: |
| deemed degenerate (too short) and skip those. |
|
robertphillips
2015/07/13 17:49:11
@param exact if true perform exact comparison ...
caryclark
2015/07/13 18:23:41
Done. Good catch -- I forgot about updating the do
|
| @return The verb for the current segment |
| */ |
| - Verb next(SkPoint pts[4], bool doConsumeDegerates = true) { |
| + Verb next(SkPoint pts[4], bool doConsumeDegerates = true, bool exact = false) { |
| if (doConsumeDegerates) { |
| - this->consumeDegenerateSegments(); |
| + this->consumeDegenerateSegments(exact); |
| } |
| return this->doNext(pts); |
| } |
| @@ -844,7 +844,7 @@ public: |
| inline const SkPoint& cons_moveTo(); |
| Verb autoClose(SkPoint pts[2]); |
| - void consumeDegenerateSegments(); |
| + void consumeDegenerateSegments(bool exact); |
| Verb doNext(SkPoint pts[4]); |
| }; |