aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PathOpsLineIntersectionTest.cpp
diff options
context:
space:
mode:
authorGravatar caryclark <caryclark@google.com>2014-06-17 05:15:38 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-06-17 05:15:38 -0700
commitdac1d17027dcaa5596885a9f333979418b35001c (patch)
tree923c6ca762654144254565240de5e9ec6598c41f /tests/PathOpsLineIntersectionTest.cpp
parentd6043b20b63f895d384b4794205ac914abfafa71 (diff)
Enabling the canvas bit to turn the clip stack into a flat replace exposed around 100 failures when testing the 800K skp set generated from the top 1M web sites.
This fixes all but one of those failures. Major changes include: - Replace angle indices with angle pointers. This was motivated by the need to add angles later but not renumber existing angles. - Aggressive segment chase. When the winding is known on a segment, more aggressively passing that winding to adjacent segments allows fragmented data sets to succeed. - Line segments with ends nearly the same are treated as coincident first. - Transfer partial coincidence by observing that if segment A is partially coincident to B and C then B and C may be partially coincident. TBR=reed Author: caryclark@google.com Review URL: https://codereview.chromium.org/272153002
Diffstat (limited to 'tests/PathOpsLineIntersectionTest.cpp')
-rw-r--r--tests/PathOpsLineIntersectionTest.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/PathOpsLineIntersectionTest.cpp b/tests/PathOpsLineIntersectionTest.cpp
index 9885178603..379c2f16f9 100644
--- a/tests/PathOpsLineIntersectionTest.cpp
+++ b/tests/PathOpsLineIntersectionTest.cpp
@@ -50,7 +50,10 @@ static const SkDLine noIntersect[][2] = {
static const size_t noIntersect_count = SK_ARRAY_COUNT(noIntersect);
static const SkDLine coincidentTests[][2] = {
- {{{{0,482.5}, {-4.4408921e-016,682.5}}},
+ {{{ { 10105, 2510 }, { 10123, 2509.98999f } }},
+ {{{10105, 2509.98999f}, { 10123, 2510 } }}},
+
+ {{ { { 0, 482.5 }, { -4.4408921e-016, 682.5 } } },
{{{0,683}, {0,482}}}},
{{{{1.77635684e-015,312}, {-1.24344979e-014,348}}},
@@ -76,9 +79,12 @@ static void check_results(skiatest::Reporter* reporter, const SkDLine& line1, co
for (int i = 0; i < ts.used(); ++i) {
SkDPoint result1 = line1.ptAtT(ts[0][i]);
SkDPoint result2 = line2.ptAtT(ts[1][i]);
- if (!result1.approximatelyEqual(result2)) {
+ if (!result1.approximatelyEqual(result2) && !ts.nearlySame(i)) {
REPORTER_ASSERT(reporter, ts.used() != 1);
result2 = line2.ptAtT(ts[1][i ^ 1]);
+ if (!result1.approximatelyEqual(result2)) {
+ SkDebugf(".");
+ }
REPORTER_ASSERT(reporter, result1.approximatelyEqual(result2));
REPORTER_ASSERT(reporter, result1.approximatelyEqual(ts.pt(i).asSkPoint()));
}