Index: tests/SkpSkGrTest.cpp |
diff --git a/tests/SkpSkGrTest.cpp b/tests/SkpSkGrTest.cpp |
index c882654650a1af564519d05955eca2856fc55ebf..c1883a989033f783dc40851bfd7ad0c2e9b9e804 100644 |
--- a/tests/SkpSkGrTest.cpp |
+++ b/tests/SkpSkGrTest.cpp |
@@ -23,7 +23,7 @@ |
#include "SkString.h" |
#include "SkTArray.h" |
#include "SkTDArray.h" |
-#include "SkTaskGroup.h" |
+#include "SkThreadPool.h" |
#include "SkTime.h" |
#include "Test.h" |
@@ -125,12 +125,14 @@ |
}; |
struct SkpSkGrThreadedTestRunner { |
- SkpSkGrThreadedTestRunner(skiatest::Reporter* reporter) |
- : fReporter(reporter) { |
+ SkpSkGrThreadedTestRunner(skiatest::Reporter* reporter, int threadCount) |
+ : fNumThreads(threadCount) |
+ , fReporter(reporter) { |
} |
~SkpSkGrThreadedTestRunner(); |
void render(); |
+ int fNumThreads; |
SkTDArray<SkpSkGrThreadedRunnable*> fRunnables; |
skiatest::Reporter* fReporter; |
}; |
@@ -162,9 +164,9 @@ |
} |
void SkpSkGrThreadedTestRunner::render() { |
- SkTaskGroup tg; |
+ SkThreadPool pool(fNumThreads); |
for (int index = 0; index < fRunnables.count(); ++ index) { |
- tg.add(fRunnables[index]); |
+ pool.add(fRunnables[index]); |
} |
} |
@@ -674,7 +676,8 @@ |
if (!initTest()) { |
return; |
} |
- SkpSkGrThreadedTestRunner testRunner(reporter); |
+ int threadCount = reporter->allowThreaded() ? 3 : 1; |
+ SkpSkGrThreadedTestRunner testRunner(reporter, threadCount); |
for (int dirIndex = 1; dirIndex <= 100; ++dirIndex) { |
SkString pictDir = make_in_dir_name(dirIndex); |
if (pictDir.size() == 0) { |