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

Unified Diff: tests/SkpSkGrTest.cpp

Issue 531653002: SkThreadPool ~~> SkTaskGroup (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Lazy and leaky -> proactive and clean. 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 c1883a989033f783dc40851bfd7ad0c2e9b9e804..c882654650a1af564519d05955eca2856fc55ebf 100644
--- a/tests/SkpSkGrTest.cpp
+++ b/tests/SkpSkGrTest.cpp
@@ -23,7 +23,7 @@
#include "SkString.h"
#include "SkTArray.h"
#include "SkTDArray.h"
-#include "SkThreadPool.h"
+#include "SkTaskGroup.h"
#include "SkTime.h"
#include "Test.h"
@@ -125,14 +125,12 @@ struct SkpSkGrThreadState {
};
struct SkpSkGrThreadedTestRunner {
- SkpSkGrThreadedTestRunner(skiatest::Reporter* reporter, int threadCount)
- : fNumThreads(threadCount)
- , fReporter(reporter) {
+ SkpSkGrThreadedTestRunner(skiatest::Reporter* reporter)
+ : fReporter(reporter) {
}
~SkpSkGrThreadedTestRunner();
void render();
- int fNumThreads;
SkTDArray<SkpSkGrThreadedRunnable*> fRunnables;
skiatest::Reporter* fReporter;
};
@@ -164,9 +162,9 @@ SkpSkGrThreadedTestRunner::~SkpSkGrThreadedTestRunner() {
}
void SkpSkGrThreadedTestRunner::render() {
- SkThreadPool pool(fNumThreads);
+ SkTaskGroup tg;
for (int index = 0; index < fRunnables.count(); ++ index) {
- pool.add(fRunnables[index]);
+ tg.add(fRunnables[index]);
}
}
@@ -676,8 +674,7 @@ DEF_TEST(SkpSkGrThreaded, reporter) {
if (!initTest()) {
return;
}
- int threadCount = reporter->allowThreaded() ? 3 : 1;
- SkpSkGrThreadedTestRunner testRunner(reporter, threadCount);
+ SkpSkGrThreadedTestRunner testRunner(reporter);
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