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

Side by Side Diff: dm/DMTask.cpp

Issue 179403010: Revert of Let DM run unit tests. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/DMTask.h ('k') | dm/DMTaskRunner.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "DMTask.h" 1 #include "DMTask.h"
2 2
3 #include "DMTaskRunner.h" 3 #include "DMTaskRunner.h"
4 #include "DMUtil.h" 4 #include "DMUtil.h"
5 #include "SkBitmap.h" 5 #include "SkBitmap.h"
6 #include "SkCommandLineFlags.h" 6 #include "SkCommandLineFlags.h"
7 7
8 namespace DM { 8 namespace DM {
9 9
10 Task::Task(Reporter* reporter, TaskRunner* taskRunner) 10 Task::Task(Reporter* reporter, TaskRunner* taskRunner)
11 : fReporter(reporter), fTaskRunner(taskRunner), fDepth(0) { 11 : fReporter(reporter), fTaskRunner(taskRunner), fDepth(0) {
12 fReporter->start(); 12 fReporter->start();
13 } 13 }
14 14
15 Task::Task(const Task& parent) 15 Task::Task(const Task& parent)
16 : INHERITED(parent) 16 : INHERITED(parent)
17 , fReporter(parent.fReporter) 17 , fReporter(parent.fReporter)
18 , fTaskRunner(parent.fTaskRunner) 18 , fTaskRunner(parent.fTaskRunner)
19 , fDepth(parent.depth()+1) { 19 , fDepth(parent.depth()+1) {
20 fReporter->start(); 20 fReporter->start();
21 } 21 }
22 22
23 Task::~Task() {} 23 Task::~Task() {}
24 24
25 void Task::run() { 25 void Task::run() {
26 if (!this->shouldSkip()) { 26 if (!this->shouldSkip()) {
27 this->draw(); 27 this->draw();
28 } 28 }
29 fReporter->finish(this->name()); 29 fReporter->finish();
30 fReporter->updateStatusLine();
30 delete this; 31 delete this;
31 } 32 }
32 33
33 void Task::spawnChild(Task* task) { 34 void Task::spawnChild(Task* task) {
34 if (!task->usesGpu()) { 35 if (!task->usesGpu()) {
35 fTaskRunner->add(task); 36 fTaskRunner->add(task);
36 } else { 37 } else {
37 SkDEBUGFAIL("Sorry, we can't spawn GPU tasks. :( See comment in TaskRun ner::wait()."); 38 SkDEBUGFAIL("Sorry, we can't spawn GPU tasks. :( See comment in TaskRun ner::wait().");
38 } 39 }
39 } 40 }
40 41
41 void Task::fail(const char* msg) { 42 void Task::fail() {
42 SkString failure(this->name()); 43 fReporter->fail(this->name());
43 if (msg) {
44 failure.appendf(": %s", msg);
45 }
46 fReporter->fail(failure);
47 } 44 }
48 45
49 } // namespace DM 46 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DMTask.h ('k') | dm/DMTaskRunner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698