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

Side by Side Diff: dm/DMTask.h

Issue 178473006: DM: also run benches once. (Closed) Base URL: https://skia.googlesource.com/skia.git@dm
Patch Set: add note Created 6 years, 10 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/DMGpuTask.cpp ('k') | dm/DMTask.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 DMTask_DEFINED 1 #ifndef DMTask_DEFINED
2 #define DMTask_DEFINED 2 #define DMTask_DEFINED
3 3
4 #include "DMReporter.h" 4 #include "DMReporter.h"
5 #include "GrContextFactory.h"
5 #include "SkRunnable.h" 6 #include "SkRunnable.h"
6 #include "SkThreadPool.h" 7 #include "SkThreadPool.h"
7 8
8 // DM will run() these tasks on one of two threadpools, depending on the result 9 // DM will run() these tasks on one of two threadpools, depending on the result
9 // of usesGpu(). The subclasses can call fail() to mark this task as failed, 10 // of usesGpu(). The subclasses can call fail() to mark this task as failed,
10 // or make any number of spawnChild() calls to kick off dependent tasks. 11 // or make any number of spawnChild() calls to kick off dependent tasks.
11 // 12 //
12 // Task deletes itself when run. 13 // Task deletes itself when run.
13 14
14 namespace DM { 15 namespace DM {
(...skipping 14 matching lines...) Expand all
29 virtual SkString name() const = 0; 30 virtual SkString name() const = 0;
30 31
31 // Returns the number of parents above this task. 32 // Returns the number of parents above this task.
32 // Top-level tasks return 0, their children 1, and so on. 33 // Top-level tasks return 0, their children 1, and so on.
33 int depth() const { return fDepth; } 34 int depth() const { return fDepth; }
34 35
35 protected: 36 protected:
36 void spawnChild(Task* task); 37 void spawnChild(Task* task);
37 void fail(const char* msg = NULL); 38 void fail(const char* msg = NULL);
38 39
40 // This can only be safely called from a GPU task's draw() method.
41 GrContextFactory* getGrContextFactory() const;
42
39 private: 43 private:
40 // Both unowned. 44 // Both unowned.
41 Reporter* fReporter; 45 Reporter* fReporter;
42 TaskRunner* fTaskRunner; 46 TaskRunner* fTaskRunner;
43 int fDepth; 47 int fDepth;
44 48
45 typedef SkRunnable INHERITED; 49 typedef SkRunnable INHERITED;
46 }; 50 };
47 51
48 } // namespace DM 52 } // namespace DM
49 53
50 #endif // DMTask_DEFINED 54 #endif // DMTask_DEFINED
OLDNEW
« no previous file with comments | « dm/DMGpuTask.cpp ('k') | dm/DMTask.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698