fix pathops fuzzers and debugging
En route to fixing fuzzer bugs, I discovered that most
debugging in pathops was broken. Pathops has extensive
runtime functions that trace links and connections between
data structures that are invaluable to debugging. The
only practical way to use these functions is to call them
from the debugger in immediate mode.
Some time, some where, the MSVS Immediate Window ceased
to be able to call functions that are members of structs
or classes, and functions that take templated parameters.
I can find no mention of this on the web, so I assume
that something about our setup is triggering this, but
I've had no luck finding the culprit.
In the meantime, I've added global functions wrapped in
a namespace to sneak calls to these functions without
MSVS being any the wiser. While this works, it is likely
to bitrot by tomorrow or next Tuesday so I will continue
to try to find and fix the root cause.
This also fixes the fuzzer bugs; generally one-line edits
that change asserts to fails. All pathops tests succeed
with this. To run all tests, do:
./out/debug/pathops_unittest -V -x
./out/release/pathops_unittest -V -x
TBR=caryclark@google.com
Bug: skia:
Change-Id: I956ae3d8df6d25e155e62bd6dede64519c7fbdb1
Reviewed-on: https://skia-review.googlesource.com/114321
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
diff --git a/src/pathops/SkOpCoincidence.cpp b/src/pathops/SkOpCoincidence.cpp
index 8fa42a5..3251ec4 100644
--- a/src/pathops/SkOpCoincidence.cpp
+++ b/src/pathops/SkOpCoincidence.cpp
@@ -691,7 +691,7 @@
if (overlap && os && oe && overlap->contains(os, oe)) {
return true;
}
- SkASSERT(!cs || !cs->deleted());
+ FAIL_IF(cs && cs->deleted());
FAIL_IF(os && os->deleted());
SkASSERT(!ce || !ce->deleted());
FAIL_IF(oe && oe->deleted());
@@ -1098,7 +1098,7 @@
FAIL_IF(windValue == -1);
start->setWindValue(windValue);
start->setOppValue(oppValue);
- FAIL_IF(oWindValue == -1);
+ FAIL_IF(oWindValue <= -1);
oStart->setWindValue(oWindValue);
oStart->setOppValue(oOppValue);
if (!windValue && !oppValue) {