aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PathOpsSimplifyTest.cpp
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2015-04-20 08:31:59 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-04-20 08:31:59 -0700
commit1049f1246e7be4ccb68001361efceb8933e6f81c (patch)
tree9c71ceb245856cbe2173913eaec3b0ebb490dd74 /tests/PathOpsSimplifyTest.cpp
parent5c476fb2776639bdbf0e974dd38d1c5d4c4ff1aa (diff)
Now, path ops natively intersect conics, quads, and cubics in any combination. There are still a class of cubic tests that fail and a handful of undiagnosed failures from skps and fuzz tests, but things are much better overall.
Extended tests (150M+) run to completion in release in about 6 minutes; the standard test suite exceeds 100K and finishes in a few seconds on desktops. TBR=reed BUG=skia:3588 Review URL: https://codereview.chromium.org/1037953004
Diffstat (limited to 'tests/PathOpsSimplifyTest.cpp')
-rw-r--r--tests/PathOpsSimplifyTest.cpp55
1 files changed, 54 insertions, 1 deletions
diff --git a/tests/PathOpsSimplifyTest.cpp b/tests/PathOpsSimplifyTest.cpp
index 6a7b42510b..599fb1a785 100644
--- a/tests/PathOpsSimplifyTest.cpp
+++ b/tests/PathOpsSimplifyTest.cpp
@@ -4677,11 +4677,64 @@ static void testRect3(skiatest::Reporter* reporter, const char* filename) {
testSimplify(reporter, path, filename);
}
+static void testRect4(skiatest::Reporter* reporter, const char* filename) {
+ SkPath path;
+ path.setFillType(SkPath::kEvenOdd_FillType);
+ path.addRect(0, 0, 30, 60, SkPath::kCCW_Direction);
+ path.addRect(10, 0, 40, 30, SkPath::kCCW_Direction);
+ path.addRect(20, 0, 30, 40, SkPath::kCCW_Direction);
+ path.addRect(32, 0, 36, 41, SkPath::kCCW_Direction);
+ testSimplify(reporter, path, filename);
+}
+
+static void testQuads62(skiatest::Reporter* reporter, const char* filename) {
+ SkPath path;
+ path.moveTo(3, 2);
+ path.quadTo(1, 3, 3, 3);
+ path.lineTo(3, 3);
+ path.close();
+ path.moveTo(0, 0);
+ path.lineTo(2, 0);
+ path.quadTo(1, 3, 3, 3);
+ path.close();
+ testSimplify(reporter, path, filename);
+}
+
+static void testQuads63(skiatest::Reporter* reporter,const char* filename) {
+ SkPath path;
+ path.moveTo(3, 0);
+ path.quadTo(0, 1, 1, 2);
+ path.lineTo(3, 3);
+ path.close();
+ path.moveTo(0, 0);
+ path.lineTo(1, 1);
+ path.quadTo(0, 2, 3, 3);
+ path.close();
+ testSimplify(reporter, path, filename);
+}
+
+static void testQuads64(skiatest::Reporter* reporter,const char* filename) {
+ SkPath path;
+ path.moveTo(3, 0);
+ path.quadTo(0, 1, 1, 2);
+ path.lineTo(2, 2);
+ path.close();
+ path.moveTo(1, 0);
+ path.lineTo(1, 1);
+ path.quadTo(0, 2, 3, 3);
+ path.close();
+ testSimplify(reporter, path, filename);
+}
+
static void (*skipTest)(skiatest::Reporter* , const char* filename) = 0;
-static void (*firstTest)(skiatest::Reporter* , const char* filename) = testCubic2;
+static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0;
static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0;
static TestDesc tests[] = {
+ TEST(testQuads64),
+ TEST(testQuads63),
+ TEST(testQuads62),
+ TEST(testRect4),
TEST(testRect3),
TEST(testQuadralateral10),
TEST(testQuads61),