From dac1d17027dcaa5596885a9f333979418b35001c Mon Sep 17 00:00:00 2001 From: caryclark Date: Tue, 17 Jun 2014 05:15:38 -0700 Subject: 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 --- tests/PathOpsExtendedTest.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tests/PathOpsExtendedTest.cpp') diff --git a/tests/PathOpsExtendedTest.cpp b/tests/PathOpsExtendedTest.cpp index 280307a775..fe3d24d6a0 100644 --- a/tests/PathOpsExtendedTest.cpp +++ b/tests/PathOpsExtendedTest.cpp @@ -156,6 +156,11 @@ static void showPathData(const SkPath& path) { while ((verb = iter.next(pts)) != SkPath::kDone_Verb) { switch (verb) { case SkPath::kMove_Verb: + if (firstPtSet && lastPtSet && firstPt != lastPt) { + SkDebugf("{{%1.9g,%1.9g}, {%1.9g,%1.9g}},\n", lastPt.fX, lastPt.fY, + firstPt.fX, firstPt.fY); + lastPtSet = false; + } firstPt = pts[0]; firstPtSet = true; continue; @@ -190,6 +195,10 @@ static void showPathData(const SkPath& path) { return; } } + if (firstPtSet && lastPtSet && firstPt != lastPt) { + SkDebugf("{{%1.9g,%1.9g}, {%1.9g,%1.9g}},\n", lastPt.fX, lastPt.fY, + firstPt.fX, firstPt.fY); + } } #endif @@ -410,7 +419,6 @@ static void showPathOpPath(const char* testName, const SkPath& one, const SkPath SkDebugf("static void %s(skiatest::Reporter* reporter, const char* filename) {\n", testName); *gTestOp.append() = shapeOp; ++gTestNo; - SkDebugf("\n*** this test fails ***\n"); SkDebugf(" SkPath path, pathB;\n"); showPath(a, "path", false); showPath(b, "pathB", false); @@ -440,6 +448,7 @@ static int comparePaths(skiatest::Reporter* reporter, const char* testName, cons if (errors2x2 > MAX_ERRORS && gComparePathsAssert) { SK_DECLARE_STATIC_MUTEX(compareDebugOut3); SkAutoMutexAcquire autoM(compareDebugOut3); + SkDebugf("\n*** this test fails ***\n"); showPathOpPath(testName, one, two, a, b, scaledOne, scaledTwo, shapeOp, scale); REPORTER_ASSERT(reporter, 0); } else if (gShowPath || errors2x2 == MAX_ERRORS || errors2x2 == MAX_ERRORS - 1) { -- cgit v1.2.3