fix security bug
This fix is a tradeoff. It changes intersection to
treat a case where one coincident run is intersected at one point
and the other edge is not as continuing to be a span.
The old code tried to treat this as a single point.
The old code is probably right, but this change alone
made the data structures inconsistent. Later, extending
the coincident runs would fail by incorrectly discarding
the single point intersection.
As a result, this fixes the security test and one other, but
makes a different test fail. Isolating the failure uncovered
a reduced case that fails with and without the change, so
there are more serious problems here. Those problems are
addressed in a separate CL.
Many of the test edits below remove ill-thought out debugging
messaging that fire off global state, which isn't usable
in a multi-threaded test environment.
In the end, with this fix, all existing tests (modulo one
new failure and one new non-failure) pass in debug and
in the extended release test suites.
TBR=reed@google.com
BUG=614248
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2018513003
Review-Url: https://codereview.chromium.org/2018513003
diff --git a/tests/PathOpsExtendedTest.cpp b/tests/PathOpsExtendedTest.cpp
index c96cbcd..b5bf5b8 100644
--- a/tests/PathOpsExtendedTest.cpp
+++ b/tests/PathOpsExtendedTest.cpp
@@ -299,8 +299,6 @@
return errors2x2 > MAX_ERRORS ? errors2x2 : 0;
}
-const int gTestFirst = 41;
-static int gTestNo = gTestFirst;
static SkTDArray<SkPathOp> gTestOp;
static void showPathOpPath(const char* testName, const SkPath& one, const SkPath& two,
@@ -310,10 +308,9 @@
if (!testName) {
testName = "xOp";
}
- SkDebugf("static void %s%d%s(skiatest::Reporter* reporter, const char* filename) {\n",
- testName, gTestNo, opSuffixes[shapeOp]);
+ SkDebugf("static void %s_%s(skiatest::Reporter* reporter, const char* filename) {\n",
+ testName, opSuffixes[shapeOp]);
*gTestOp.append() = shapeOp;
- ++gTestNo;
SkDebugf(" SkPath path, pathB;\n");
SkPathOpsDebug::ShowOnePath(a, "path", false);
SkPathOpsDebug::ShowOnePath(b, "pathB", false);
@@ -322,15 +319,6 @@
drawAsciiPaths(scaledOne, scaledTwo, true);
}
-void ShowTestArray(const char* testName) {
- if (!testName) {
- testName = "xOp";
- }
- for (int x = gTestFirst; x < gTestNo; ++x) {
- SkDebugf(" TEST(%s%d%s),\n", testName, x, opSuffixes[gTestOp[x - gTestFirst]]);
- }
-}
-
SK_DECLARE_STATIC_MUTEX(compareDebugOut3);
static int comparePaths(skiatest::Reporter* reporter, const char* testName, const SkPath& one,