diff options
author | caryclark <caryclark@google.com> | 2014-10-28 10:33:09 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-28 10:33:09 -0700 |
commit | 6f726addf3178b01949bb389ef83cf14a1d7b6b2 (patch) | |
tree | f075358dcfe429a50ba7b3c67e26c95d4dc9277d /tests/PathOpsDebug.cpp | |
parent | 8f0d69e48eef2b87d0149729adcfa058e8c42c81 (diff) |
These tests stress pathops by describing the union of circle-like paths that have tiny line segments embedded and double back to create near-coincident conditions.
The fixes include
- detect when finding the active top loops between two possible answers
- preflight chasing winding to ensure answer is consistent
- binary search more often when quadratic intersection fails
- add more failure paths when an intersect is missed
While this fixes the chrome bug, reenabling path ops in svg should be deferred until additional fixes are landed.
TBR=
BUG=421132
Review URL: https://codereview.chromium.org/633393002
Diffstat (limited to 'tests/PathOpsDebug.cpp')
-rwxr-xr-x | tests/PathOpsDebug.cpp | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/tests/PathOpsDebug.cpp b/tests/PathOpsDebug.cpp index 8ac38aaf6d..c4fbbfa695 100755 --- a/tests/PathOpsDebug.cpp +++ b/tests/PathOpsDebug.cpp @@ -19,6 +19,9 @@ inline void DebugDumpFloat(float x) { } } +inline void DebugDumpHexFloat(float x) { + SkDebugf("SkBits2Float(0x%08x)", SkFloat2Bits(x)); +} #if DEBUG_SHOW_TEST_NAME @@ -413,6 +416,17 @@ void SkDPoint::Dump(const SkPoint& pt) { SkDebugf("}"); } +void SkDPoint::DumpHex(const SkPoint& pt) { + SkDebugf("{"); + DebugDumpHexFloat(pt.fX); + SkDebugf(", "); + DebugDumpHexFloat(pt.fY); + SkDebugf("}"); +} + +void SkDQuad::dump() const { + dumpComma(""); +} void SkDQuad::dumpComma(const char* comma) const { SkDebugf("{{"); @@ -425,10 +439,6 @@ void SkDQuad::dumpComma(const char* comma) const { SkDebugf("}}%s\n", comma ? comma : ""); } -void SkDQuad::dump() const { - dumpComma(""); -} - void SkIntersectionHelper::dump() const { SkDPoint::Dump(pts()[0]); SkDPoint::Dump(pts()[1]); @@ -492,6 +502,18 @@ void SkOpSegment::dumpPts() const { SkDebugf("}}\n"); } +void SkOpSegment::dumpHexPts() const { + int last = SkPathOpsVerbToPoints(fVerb); + SkDebugf("((SkOpSegment*) 0x%p) [%d] {{", this, debugID()); + int index = 0; + do { + SkDPoint::DumpHex(fPts[index]); + SkDebugf(", "); + } while (++index < last); + SkDPoint::DumpHex(fPts[index]); + SkDebugf("}}\n"); +} + void SkOpSegment::dumpDPts() const { int count = SkPathOpsVerbToPoints(fVerb); SkDebugf("((SkOpSegment*) 0x%p) [%d] {{", this, debugID()); |