path ops near exact
Modify line intersections to first
- match exact ends
- compute intersections
- match near ends
where the exact ends are preferred, then near matches, then
computed matches. This pulls matches towards existing end points
when possible, and keeps intersection distances consistent with
different line/line line/quad and line/cubic computations.
BUG=
Review URL: https://codereview.chromium.org/19183003
git-svn-id: http://skia.googlecode.com/svn/trunk@10073 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/PathOpsQuadLineIntersectionTest.cpp b/tests/PathOpsQuadLineIntersectionTest.cpp
index 1615340..4227ee5 100644
--- a/tests/PathOpsQuadLineIntersectionTest.cpp
+++ b/tests/PathOpsQuadLineIntersectionTest.cpp
@@ -58,11 +58,13 @@
SkDQuad quad;
SkDLine line;
} oneOffs[] = {
+ {{{{1101, 10}, {1101, 8.3431453704833984}, {1099.828857421875, 7.1711997985839844}}},
+ {{{1099.828857421875,7.1711711883544922}, {1099.121337890625,7.8786783218383789}}}},
{{{{973, 507}, {973, 508.24264526367187}, {972.12158203125, 509.12161254882812}}},
{{{930, 467}, {973, 510}}}},
{{{{369.848602, 145.680267}, {382.360413, 121.298294}, {406.207703, 121.298294}}},
- {{{406.207703, 121.298294}, {348.781738, 123.864815}}}}
- };
+ {{{406.207703, 121.298294}, {348.781738, 123.864815}}}},
+};
static size_t oneOffs_count = SK_ARRAY_COUNT(oneOffs);
@@ -83,8 +85,11 @@
}
}
-static void PathOpsQuadLineIntersectionTest(skiatest::Reporter* reporter) {
+static void PathOpsQuadLineIntersectionTestOne(skiatest::Reporter* reporter) {
testOneOffs(reporter);
+}
+
+static void PathOpsQuadLineIntersectionTest(skiatest::Reporter* reporter) {
for (size_t index = 0; index < lineQuadTests_count; ++index) {
int iIndex = static_cast<int>(index);
const SkDQuad& quad = lineQuadTests[index].quad;
@@ -131,3 +136,5 @@
#include "TestClassDef.h"
DEFINE_TESTCLASS_SHORT(PathOpsQuadLineIntersectionTest)
+
+DEFINE_TESTCLASS_SHORT(PathOpsQuadLineIntersectionTestOne)