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

Side by Side Diff: dm/DMTaskRunner.h

Issue 179403010: Revert of Let DM run unit tests. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 9 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 unified diff | Download patch
« no previous file with comments | « dm/DMTask.cpp ('k') | dm/DMTaskRunner.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #ifndef DMTaskRunner_DEFINED 1 #ifndef DMTaskRunner_DEFINED
2 #define DMTaskRunner_DEFINED 2 #define DMTaskRunner_DEFINED
3 3
4 #include "GrContextFactory.h"
5 #include "SkThreadPool.h" 4 #include "SkThreadPool.h"
6 #include "SkTypes.h" 5 #include "SkTypes.h"
7 6
8 // TaskRunner runs Tasks on one of two threadpools depending on the Task's usesG pu() method. This 7 // TaskRunner runs Tasks on one of two threadpools depending on the Task's usesG pu() method.
9 // lets us drive the GPU from a single thread while parallelizing CPU-bound work . 8 // This lets us drive the GPU with a small number of threads (e.g. 2 or 4 can be faster than 1)
9 // while not swamping it with requests from the full fleet of threads that CPU-b ound tasks run on.
10 10
11 namespace DM { 11 namespace DM {
12 12
13 class Task; 13 class Task;
14 14
15 class TaskRunner : SkNoncopyable { 15 class TaskRunner : SkNoncopyable {
16 public: 16 public:
17 explicit TaskRunner(int cputhreads); 17 TaskRunner(int cputhreads, int gpuThreads);
18 18
19 void add(Task* task); 19 void add(Task* task);
20 void wait(); 20 void wait();
21 21
22 // This can only be safely called from a GPU task's draw() method.
23 GrContextFactory* getGrContextFactory() const { return fGrContextFactory; }
24
25 private: 22 private:
26 SkThreadPool fMain, fGpu; 23 SkThreadPool fMain, fGpu;
27 GrContextFactory* fGrContextFactory; // Created and destroyed on fGpu threa dpool.
28 }; 24 };
29 25
30 } // namespace DM 26 } // namespace DM
31 27
32 #endif // DMTaskRunner_DEFINED 28 #endif // DMTaskRunner_DEFINED
OLDNEW
« no previous file with comments | « dm/DMTask.cpp ('k') | dm/DMTaskRunner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698