Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(412)

Unified Diff: tests/PathOpsOpTest.cpp

Issue 556433002: fail when coincidence is too far apart (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: merge fix from trunk for issue 410552 Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pathops/SkOpSegment.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PathOpsOpTest.cpp
diff --git a/tests/PathOpsOpTest.cpp b/tests/PathOpsOpTest.cpp
index 2c674499508267cfee025b1d178e15ab9cb1fa98..866b5b216c1938550fd6eed4d2a7e509e74343e2 100644
--- a/tests/PathOpsOpTest.cpp
+++ b/tests/PathOpsOpTest.cpp
@@ -3771,7 +3771,52 @@ static void bufferOverflow(skiatest::Reporter* reporter, const char* filename) {
testPathFailOp(reporter, path, pathB, kUnion_PathOp, filename);
}
+// m 100,0 60,170 -160,-110 200,0 -170,11000000000 z
+static void fuzz433(skiatest::Reporter* reporter, const char* filename) {
+ SkPath path1, path2;
+ path1.moveTo(100,0);
+ path1.lineTo(60,170);
+ path1.lineTo(-160,-110);
+ path1.lineTo(200,0);
+ path1.lineTo(-170,11000000000.0f);
+ path1.close();
+
+ path2.moveTo(100 + 20,0 + 20);
+ path2.lineTo(60 + 20,170 + 20);
+ path2.lineTo(-160 + 20,-110 + 20);
+ path2.lineTo(200 + 20,0 + 20);
+ path2.lineTo(-170 + 20,11000000000.0f + 20);
+ path2.close();
+
+ testPathFailOp(reporter, path1, path2, kIntersect_PathOp, filename);
+}
+
+static void fuzz433b(skiatest::Reporter* reporter, const char* filename) {
+ SkPath path1, path2;
+ path1.setFillType(SkPath::kEvenOdd_FillType);
+ path1.moveTo(140, 40);
+ path1.lineTo(200, 210);
+ path1.lineTo(40, 100);
+ path1.lineTo(240, 100);
+ path1.lineTo(70, 1.1e+10f);
+ path1.lineTo(140, 40);
+ path1.close();
+
+ path1.setFillType(SkPath::kWinding_FillType);
+ path2.moveTo(190, 60);
+ path2.lineTo(250, 230);
+ path2.lineTo(90, 120);
+ path2.lineTo(290, 120);
+ path2.lineTo(120, 1.1e+10f);
+ path2.lineTo(190, 60);
+ path2.close();
+
+ testPathFailOp(reporter, path1, path2, kUnion_PathOp, filename);
+}
+
static struct TestDesc failTests[] = {
+ TEST(fuzz433b),
+ TEST(fuzz433),
TEST(bufferOverflow),
};
« no previous file with comments | « src/pathops/SkOpSegment.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698