aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PathOpsThreeWayTest.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/PathOpsThreeWayTest.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/PathOpsThreeWayTest.cpp')
-rw-r--r--tests/PathOpsThreeWayTest.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/PathOpsThreeWayTest.cpp b/tests/PathOpsThreeWayTest.cpp
index 15d6e54927..bf634f9f7e 100644
--- a/tests/PathOpsThreeWayTest.cpp
+++ b/tests/PathOpsThreeWayTest.cpp
@@ -49,14 +49,16 @@ static void testSetTest(skiatest::Reporter* reporter, int index) {
const Curve& iTest = testSet.tests[inner];
SkIntersections* i = combos.append();
sk_bzero(i, sizeof(SkIntersections));
+ SkDLine oLine = {{ oTest.curve[0], oTest.curve[1] }};
+ SkDLine iLine = {{ iTest.curve[0], iTest.curve[1] }};
if (oTest.ptCount == 1 && iTest.ptCount == 1) {
- i->intersect(*(const SkDLine*) &oTest.curve, *(const SkDLine*) &iTest.curve);
+ i->intersect(oLine, iLine);
} else if (oTest.ptCount == 1 && iTest.ptCount == 4) {
- i->intersect(iTest.curve, *(const SkDLine*) &oTest.curve);
+ i->intersect(iTest.curve, oLine);
} else if (oTest.ptCount == 4 && iTest.ptCount == 1) {
- i->intersect(oTest.curve, *(const SkDLine*) &oTest.curve);
+ i->intersect(oTest.curve, iLine);
} else if (oTest.ptCount == 4 && iTest.ptCount == 4) {
- i->intersectB(oTest.curve, iTest.curve);
+ i->intersect(oTest.curve, iTest.curve);
} else {
SkASSERT(0);
}