aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PathOpsSimplifyTest.cpp
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2015-03-26 07:52:43 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-03-26 07:52:43 -0700
commit54359294a7c9dc54802d512a5d891a35c1663392 (patch)
tree7339bbad708bb43a4a96f7b76075c84ff7732189 /tests/PathOpsSimplifyTest.cpp
parentc08330f1601aeca7f10aeb2194118decbfbf83e1 (diff)
cumulative pathops patch
Replace the implicit curve intersection with a geometric curve intersection. The implicit intersection proved mathematically unstable and took a long time to zero in on an answer. Use pointers instead of indices to refer to parts of curves. Indices required awkward renumbering. Unify t and point values so that small intervals can be eliminated in one pass. Break cubics up front to eliminate loops and cusps. Make the Simplify and Op code more regular and eliminate arbitrary differences. Add a builder that takes an array of paths and operators. Delete unused code. BUG=skia:3588 R=reed@google.com Review URL: https://codereview.chromium.org/1037573004
Diffstat (limited to 'tests/PathOpsSimplifyTest.cpp')
-rw-r--r--tests/PathOpsSimplifyTest.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/tests/PathOpsSimplifyTest.cpp b/tests/PathOpsSimplifyTest.cpp
index 88547a0f04..6a7b42510b 100644
--- a/tests/PathOpsSimplifyTest.cpp
+++ b/tests/PathOpsSimplifyTest.cpp
@@ -3649,7 +3649,7 @@ static void testTriangles2(skiatest::Reporter* reporter, const char* filename) {
testSimplify(reporter, path, filename);
}
-// A test this for this case:
+// A test for this case:
// contourA has two segments that are coincident
// contourB has two segments that are coincident in the same place
// each ends up with +2/0 pairs for winding count
@@ -4506,8 +4506,6 @@ static void testQuads47(skiatest::Reporter* reporter, const char* filename) {
testSimplify(reporter, path, filename);
}
-// this fails because there is a short unorderable segment and the unordered state isn't handled
-// correctly later on.
static void testQuads46x(skiatest::Reporter* reporter, const char* filename) {
SkPath path;
path.setFillType(SkPath::kEvenOdd_FillType);
@@ -4679,7 +4677,9 @@ static void testRect3(skiatest::Reporter* reporter, const char* filename) {
testSimplify(reporter, path, filename);
}
-static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0;
+static void (*skipTest)(skiatest::Reporter* , const char* filename) = 0;
+static void (*firstTest)(skiatest::Reporter* , const char* filename) = testCubic2;
+static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0;
static TestDesc tests[] = {
TEST(testRect3),
@@ -4738,7 +4738,7 @@ static TestDesc tests[] = {
TEST(testQuadralateral3),
TEST(testDegenerate5),
TEST(testQuad12),
- TEST(testQuadratic51), // has unorderable angles
+ TEST(testQuadratic51),
TEST(testQuad8),
TEST(testQuad11),
TEST(testQuad10),
@@ -5111,14 +5111,13 @@ static void (*firstSubTest)(skiatest::Reporter* , const char* filename) = 0;
static bool runSubTests = false;
static bool runSubTestsFirst = false;
static bool runReverse = false;
-static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0;
DEF_TEST(PathOpsSimplify, reporter) {
if (runSubTests && runSubTestsFirst) {
- RunTestSet(reporter, subTests, subTestCount, firstSubTest, stopTest, runReverse);
+ RunTestSet(reporter, subTests, subTestCount, firstSubTest, NULL, stopTest, runReverse);
}
- RunTestSet(reporter, tests, testCount, firstTest, stopTest, runReverse);
+ RunTestSet(reporter, tests, testCount, firstTest, skipTest, stopTest, runReverse);
if (runSubTests && !runSubTestsFirst) {
- RunTestSet(reporter, subTests, subTestCount, firstSubTest, stopTest, runReverse);
+ RunTestSet(reporter, subTests, subTestCount, firstSubTest, NULL, stopTest, runReverse);
}
}