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

Unified Diff: tests/SkpSkGrTest.cpp

Issue 533393002: Revert of SkThreadPool ~~> SkTaskGroup (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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/PathOpsTightBoundsTest.cpp ('k') | tests/Test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « tests/PathOpsTightBoundsTest.cpp ('k') | tests/Test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698