diff options
author | caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-07-15 13:29:13 +0000 |
---|---|---|
committer | caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-07-15 13:29:13 +0000 |
commit | fa2aeee27af27f2934ee52a9732148f66481fb03 (patch) | |
tree | 55bd975ad23945da95bdbe6e4a57aa5688baee28 /tests/PathOpsQuadLineIntersectionTest.cpp | |
parent | c2050e3a3ecfb8738b36e2add15c526e8e0f21fe (diff) |
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
Diffstat (limited to 'tests/PathOpsQuadLineIntersectionTest.cpp')
-rw-r--r-- | tests/PathOpsQuadLineIntersectionTest.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/PathOpsQuadLineIntersectionTest.cpp b/tests/PathOpsQuadLineIntersectionTest.cpp index 16153404c4..4227ee5277 100644 --- a/tests/PathOpsQuadLineIntersectionTest.cpp +++ b/tests/PathOpsQuadLineIntersectionTest.cpp @@ -58,11 +58,13 @@ static struct oneLineQuad { 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 testOneOffs(skiatest::Reporter* reporter) { } } -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 @@ static void PathOpsQuadLineIntersectionTest(skiatest::Reporter* reporter) { #include "TestClassDef.h" DEFINE_TESTCLASS_SHORT(PathOpsQuadLineIntersectionTest) + +DEFINE_TESTCLASS_SHORT(PathOpsQuadLineIntersectionTestOne) |