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

Unified Diff: tests/PathOpsExtendedTest.cpp

Issue 23542056: path ops work in progress (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: verbose + mutex around file number access Created 7 years, 2 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/PathOpsCubicReduceOrderTest.cpp ('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 c32bfa1e061f5a4549e2c3735dc1b5639c5ea105..c3162abcc973a670d6039679ce02e9dac9ebe41a 100644
--- a/tests/PathOpsExtendedTest.cpp
+++ b/tests/PathOpsExtendedTest.cpp
@@ -9,6 +9,7 @@
#include "PathOpsThreadedCommon.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
+#include "SkForceLinking.h"
#include "SkMatrix.h"
#include "SkPaint.h"
#include "SkStream.h"
@@ -18,6 +19,8 @@
#include <sys/sysctl.h>
#endif
+__SK_FORCE_IMAGE_DECODER_LINKING;
+
static const char marker[] =
"</div>\n"
"\n"
@@ -627,29 +630,35 @@ bool testThreadedPathOp(skiatest::Reporter* reporter, const SkPath& a, const SkP
return innerPathOp(reporter, a, b, shapeOp, testName, true);
}
+SK_DECLARE_STATIC_MUTEX(gMutex);
+
int initializeTests(skiatest::Reporter* reporter, const char* test) {
#ifdef SK_DEBUG
SkPathOpsDebug::gMaxWindSum = 4;
SkPathOpsDebug::gMaxWindValue = 4;
#endif
-#if DEBUG_SHOW_TEST_NAME
- testName = test;
- size_t testNameSize = strlen(test);
- SkFILEStream inFile("../../experimental/Intersection/op.htm");
- if (inFile.isValid()) {
- SkTDArray<char> inData;
- inData.setCount(inFile.getLength());
- size_t inLen = inData.count();
- inFile.read(inData.begin(), inLen);
- inFile.setPath(NULL);
- char* insert = strstr(inData.begin(), marker);
- if (insert) {
- insert += sizeof(marker) - 1;
- const char* numLoc = insert + 4 /* indent spaces */ + testNameSize - 1;
- testNumber = atoi(numLoc) + 1;
+ if (reporter->verbose()) {
+ SkAutoMutexAcquire lock(gMutex);
+ testName = test;
+ size_t testNameSize = strlen(test);
+ SkFILEStream inFile("../../experimental/Intersection/op.htm");
+ if (inFile.isValid()) {
+ SkTDArray<char> inData;
+ inData.setCount(inFile.getLength());
+ size_t inLen = inData.count();
+ inFile.read(inData.begin(), inLen);
+ inFile.setPath(NULL);
+ char* insert = strstr(inData.begin(), marker);
+ if (insert) {
+ insert += sizeof(marker) - 1;
+ const char* numLoc = insert + 4 /* indent spaces */ + testNameSize - 1;
+ testNumber = atoi(numLoc) + 1;
+ }
}
+ } else {
+ testName = "pathOpTest";
+ testNumber = 1;
}
-#endif
return reporter->allowThreaded() ? SkThreadPool::kThreadPerCore : 1;
}
« no previous file with comments | « tests/PathOpsCubicReduceOrderTest.cpp ('k') | tests/PathOpsLineIntersectionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698