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

Unified Diff: src/utils/SkTaskGroup.cpp

Issue 636593002: Restore a really single-threaded mode to DM. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 | « src/utils/SkTaskGroup.h ('k') | tools/flags/SkCommonFlags.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/SkTaskGroup.cpp
diff --git a/src/utils/SkTaskGroup.cpp b/src/utils/SkTaskGroup.cpp
index 7449eb65655c4231863c323318717a8af28b388c..a93b34fd1636512913f31a7dc8c81eaa1723c73c 100644
--- a/src/utils/SkTaskGroup.cpp
+++ b/src/utils/SkTaskGroup.cpp
@@ -67,7 +67,7 @@ private:
};
explicit ThreadPool(int threads) : fDraining(false) {
- if (threads == 0) {
+ if (threads == -1) {
threads = num_cores();
}
for (int i = 0; i < threads; i++) {
@@ -133,11 +133,12 @@ ThreadPool* ThreadPool::gGlobal = NULL;
SkTaskGroup::Enabler::Enabler(int threads) {
SkASSERT(ThreadPool::gGlobal == NULL);
- ThreadPool::gGlobal = SkNEW_ARGS(ThreadPool, (threads));
+ if (threads != 0) {
+ ThreadPool::gGlobal = SkNEW_ARGS(ThreadPool, (threads));
+ }
}
SkTaskGroup::Enabler::~Enabler() {
- SkASSERT(ThreadPool::gGlobal != NULL);
SkDELETE(ThreadPool::gGlobal);
}
« no previous file with comments | « src/utils/SkTaskGroup.h ('k') | tools/flags/SkCommonFlags.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698