Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: tests/PathOpsExtendedTest.cpp

Issue 19374003: harden and speed up path op unit tests (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rename threaded to single Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/PathOpsExtendedTest.h ('k') | tests/PathOpsLineIntersectionTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PathOpsExtendedTest.cpp
diff --git a/tests/PathOpsExtendedTest.cpp b/tests/PathOpsExtendedTest.cpp
index 93280d746df5dadaba4e6cfed4b730061c30b802..b85644dca5a854b55e7c55d3f7f315405fdb70df 100644
--- a/tests/PathOpsExtendedTest.cpp
+++ b/tests/PathOpsExtendedTest.cpp
@@ -41,7 +41,6 @@ static const char* opSuffixes[] = {
};
static bool gShowPath = false;
-static bool gComparePaths = true;
static bool gComparePathsAssert = true;
static bool gPathStrAssert = true;
@@ -512,7 +511,7 @@ bool testSimplify(SkPath& path, bool useXor, SkPath& out, PathOpsThreadState& st
REPORTER_ASSERT(state.fReporter, 0);
return false;
}
- if (!gComparePaths) {
+ if (!state.fReporter->verbose()) {
return true;
}
int result = comparePaths(state.fReporter, path, out, *state.fBitmap);
@@ -563,8 +562,8 @@ void DebugShowPath(const SkPath& a, const SkPath& b, SkPathOp shapeOp, const cha
}
#endif
-bool testPathOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
- const SkPathOp shapeOp, const char* testName) {
+static bool innerPathOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
+ const SkPathOp shapeOp, const char* testName, bool threaded) {
#if DEBUG_SHOW_TEST_NAME
if (testName == NULL) {
SkDebugf("\n");
@@ -581,6 +580,9 @@ bool testPathOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
REPORTER_ASSERT(reporter, 0);
return false;
}
+ if (threaded && !reporter->verbose()) {
+ return true;
+ }
SkPath pathOut, scaledPathOut;
SkRegion rgnA, rgnB, openClip, rgnOut;
openClip.setRect(-16000, -16000, 16000, 16000);
@@ -614,6 +616,16 @@ bool testPathOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
return result == 0;
}
+bool testPathOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
+ const SkPathOp shapeOp, const char* testName) {
+ return innerPathOp(reporter, a, b, shapeOp, testName, false);
+}
+
+bool testThreadedPathOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
+ const SkPathOp shapeOp, const char* testName) {
+ return innerPathOp(reporter, a, b, shapeOp, testName, true);
+}
+
int initializeTests(skiatest::Reporter* reporter, const char* test) {
#ifdef SK_DEBUG
gDebugMaxWindSum = 4;
« no previous file with comments | « tests/PathOpsExtendedTest.h ('k') | tests/PathOpsLineIntersectionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698