remove scaling from pathops
PathOps added a cheat some time ago to reduce
fuzzer bugs by scaling down very large paths,
with the hope that it would make the math more
sane.
This had the side-effect of causing small edges
to disappear altogether if the bounds is large
enough.
Removing the scaling causes a single regression to
one fuzz-generated bug. That path succeeeded with
scale by eliminating the troublesome tiny contour.
Eliminating the scale may fix the CCPR-related bug
discovered by Flutter, or at least uncover the next
bug.
I would expect more fuzzer bugs to appear with
this change; paths with large and small values will
no longer have the small values removed.
R=csmartdalton@google.com,reed@google.com,bsalomon@google.com
Bug: skia:8290
Change-Id: I3bfdb101c568e9cfa324858685eac1f9c368c291
Reviewed-on: https://skia-review.googlesource.com/150465
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/tests/PathOpsOpTest.cpp b/tests/PathOpsOpTest.cpp
index 6632a02..b664fa5 100644
--- a/tests/PathOpsOpTest.cpp
+++ b/tests/PathOpsOpTest.cpp
@@ -5170,6 +5170,9 @@
testPathOpCheck(reporter, path, pathB, kUnion_SkPathOp, filename, true);
}
+// we currently don't produce meaningful intersections when a path has extremely large segments
+// intersecting relatively small ones. This bug was reported as a fuzzer bug and wasn't expected
+// to produce meaningful results
static void crbug_526025(skiatest::Reporter* reporter, const char* filename) {
SkPath path;
path.setFillType((SkPath::FillType) 1);
@@ -5195,7 +5198,7 @@
path.close();
SkPath path2(path);
- testPathOp(reporter, path1, path2, (SkPathOp) 2, filename);
+ testPathOpFuzz(reporter, path1, path2, (SkPathOp) 2, filename);
}
static void fuzzX_392(skiatest::Reporter* reporter, const char* filename) {
@@ -9083,6 +9086,7 @@
#define TEST(name) { name, #name }
static struct TestDesc tests[] = {
+ TEST(crbug_526025),
TEST(bug8228),
TEST(op_4),
TEST(op_1),
@@ -9110,7 +9114,6 @@
TEST(cubics_d),
TEST(dean2),
TEST(fuzzX_392),
- TEST(crbug_526025),
TEST(fuzz38),
TEST(cubics44d),
TEST(cubics45u),