aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2018-06-06 15:22:08 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-06 20:27:34 +0000
commit3a4a3215f55212820d39853597ec268c5d84aa98 (patch)
tree6d8aac33b299fbf83ebf862465b0087e3971083b /tests
parente0aeeddb78f18086799aa5e86da2b9e2f4ffa1dc (diff)
fix ops for very close rects
Pathops sorts line intersections to determine which edges to keep. If the intersections are very short, they may get discarded and the adjacent edge is used instead. If a pair of edges are 180 degrees apart, and an adjacent edge is part of the sort, it is ambiguous whether it is inside or outside the span. Add logic to look for this and evaluate the original data rather than the adjacent edge. In a separate CL, I'll add a specialization for rect/rect ops. R=halcanary@google.com Bug: skia:8049 Change-Id: I8d88d5520051d41303ea683e7d6b844f2afa9937 Reviewed-on: https://skia-review.googlesource.com/132661 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Hal Canary <halcanary@google.com> Auto-Submit: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/PathOpsOpTest.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/PathOpsOpTest.cpp b/tests/PathOpsOpTest.cpp
index 6a379be586..cfa9a450a0 100644
--- a/tests/PathOpsOpTest.cpp
+++ b/tests/PathOpsOpTest.cpp
@@ -5720,6 +5720,15 @@ static void seanbug(skiatest::Reporter* reporter, const char* filename) {
testPathOp(reporter, path, path2, kIntersect_SkPathOp, filename);
}
+static void halbug(skiatest::Reporter* reporter, const char* filename) {
+ SkPath path, path2;
+ path.setFillType(SkPath::kEvenOdd_FillType);
+ path.addRect(SkRect{278.653992f, 155.747406f, 580.15918f, 593.602051f});
+ path2.setFillType(SkPath::kWinding_FillType);
+ path2.addRect(SkRect{278.657715f, 155.747314f, 580.238281f, 594.114014f});
+ testPathOp(reporter, path, path2, kIntersect_SkPathOp, filename);
+}
+
static void (*skipTest)(skiatest::Reporter* , const char* filename) = 0;
static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0;
static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0;
@@ -5727,6 +5736,7 @@ static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0;
#define TEST(name) { name, #name }
static struct TestDesc tests[] = {
+ TEST(halbug),
TEST(seanbug),
TEST(android1),
TEST(bug5240),