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

Unified Diff: tests/PathOpsExtendedTest.cpp

Issue 419113002: Fix thread unsafe mutex initialization. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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
« src/ports/SkMutex_pthread.h ('K') | « src/ports/SkMutex_win.h ('k') | no next file » | 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 2d741261a6dc9b4de60a703bee5efad5b2ea5403..05d00045b97e7d3d5b72800b05c5cd8f3ceb147e 100644
--- a/tests/PathOpsExtendedTest.cpp
+++ b/tests/PathOpsExtendedTest.cpp
@@ -316,6 +316,8 @@ void ShowTestArray() {
}
}
+SK_DECLARE_STATIC_MUTEX(compareDebugOut3);
+SK_DECLARE_STATIC_MUTEX(compareDebugOut4);
static int comparePaths(skiatest::Reporter* reporter, const char* testName, const SkPath& one,
const SkPath& scaledOne, const SkPath& two, const SkPath& scaledTwo, SkBitmap& bitmap,
const SkPath& a, const SkPath& b, const SkPathOp shapeOp, const SkMatrix& scale) {
@@ -329,13 +331,11 @@ static int comparePaths(skiatest::Reporter* reporter, const char* testName, cons
}
const int MAX_ERRORS = 8;
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) {
- SK_DECLARE_STATIC_MUTEX(compareDebugOut4);
SkAutoMutexAcquire autoM(compareDebugOut4);
showPathOpPath(testName, one, two, a, b, scaledOne, scaledTwo, shapeOp, scale);
}
@@ -402,6 +402,7 @@ static void outputToStream(const char* pathStr, const char* pathPrefix, const ch
outFile.flush();
}
+SK_DECLARE_STATIC_MUTEX(simplifyDebugOut);
bool testSimplify(SkPath& path, bool useXor, SkPath& out, PathOpsThreadState& state,
const char* pathStr) {
SkPath::FillType fillType = useXor ? SkPath::kEvenOdd_FillType : SkPath::kWinding_FillType;
@@ -421,7 +422,6 @@ bool testSimplify(SkPath& path, bool useXor, SkPath& out, PathOpsThreadState& st
}
int result = comparePaths(state.fReporter, NULL, path, out, *state.fBitmap);
if (result && gPathStrAssert) {
- SK_DECLARE_STATIC_MUTEX(simplifyDebugOut);
SkAutoMutexAcquire autoM(simplifyDebugOut);
char temp[8192];
sk_bzero(temp, sizeof(temp));
« src/ports/SkMutex_pthread.h ('K') | « src/ports/SkMutex_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698