Revert "Ensure arcTo (SVG) ends at the targeted point"
This reverts commit 31143100ee2a5e95a552b3d9ed559b068c8df76b.
Reason for revert: need to guard this, to stage changes to test images
Original change's description:
> Ensure arcTo (SVG) ends at the targeted point
>
> Floating-point errors in the calculations in arcTo can cause the final
> point to differ significantly enough from the supplied target point that
> a subsequent 'close' operation inserts a lineTo to close the curve. This
> can result in bad miters on curves with thick outlines.
>
> The fix is to ensure that the final point used is *exactly* the point
> that was supplied.
>
> Bug: chromium:1001768
> Change-Id: I75c740ab25fb05153bc852a204be957977674cd2
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270000
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
TBR=reed@google.com,iapres@microsoft.com
Change-Id: If331924a4db83294769b28501bba875238a521bd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:1001768
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/270356
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index 751d80a..5afe53a 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -1262,10 +1262,6 @@
this->conicTo(mapped[0], mapped[1], w);
startTheta = endTheta;
}
-
- // The final point should match the input point (by definition); replace it to
- // ensure that rounding errors in the above math don't cause any problems.
- this->setLastPt(x, y);
return *this;
}
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp
index 63f7980..b94c45f 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -3908,18 +3908,6 @@
p.reset();
p.arcTo(noOvalHeight, 0, 360, false);
REPORTER_ASSERT(reporter, p.isEmpty());
-
- // Inspired by http://code.google.com/p/chromium/issues/detail?id=1001768
- {
- p.reset();
- p.moveTo(216, 216);
- p.arcTo(216, 108, 0, SkPath::ArcSize::kLarge_ArcSize, SkPathDirection::kCW, 216, 0);
- p.arcTo(270, 135, 0, SkPath::ArcSize::kLarge_ArcSize, SkPathDirection::kCCW, 216, 216);
-
- // The 'arcTo' call should end up exactly at the starting location.
- int n = p.countPoints();
- REPORTER_ASSERT(reporter, p.getPoint(0) == p.getPoint(n - 1));
- }
}
static void test_addPath(skiatest::Reporter* reporter) {