Index: dm/DMTask.cpp |
diff --git a/dm/DMTask.cpp b/dm/DMTask.cpp |
index 7725780d4ced9ec8377ddc04e6c0cfeaaef6aff1..e32249d410c425e3912e94dbdd2c8f4b96bda810 100644 |
--- a/dm/DMTask.cpp |
+++ b/dm/DMTask.cpp |
@@ -11,14 +11,18 @@ Task::Task(Reporter* reporter, TaskRunner* taskRunner) |
: fReporter(reporter) |
, fTaskRunner(taskRunner) |
, fDepth(0) { |
- fReporter->start(); |
+ fReporter->taskCreated(); |
} |
Task::Task(const Task& parent) |
: fReporter(parent.fReporter) |
, fTaskRunner(parent.fTaskRunner) |
, fDepth(parent.depth() + 1) { |
- fReporter->start(); |
+ fReporter->taskCreated(); |
+} |
+ |
+Task::~Task() { |
+ fReporter->taskDestroyed(); |
} |
void Task::fail(const char* msg) { |
@@ -34,7 +38,7 @@ void Task::start() { |
} |
void Task::finish() { |
- fReporter->finish(this->name(), SkTime::GetMSecs() - fStart); |
+ fReporter->printStatus(this->name(), SkTime::GetMSecs() - fStart); |
} |
void Task::spawnChildNext(CpuTask* task) { |
@@ -45,11 +49,11 @@ CpuTask::CpuTask(Reporter* reporter, TaskRunner* taskRunner) : Task(reporter, ta |
CpuTask::CpuTask(const Task& parent) : Task(parent) {} |
void CpuTask::run() { |
- this->start(); |
if (FLAGS_cpu && !this->shouldSkip()) { |
+ this->start(); |
this->draw(); |
+ this->finish(); |
} |
- this->finish(); |
SkDELETE(this); |
} |
@@ -63,11 +67,11 @@ void CpuTask::spawnChild(CpuTask* task) { |
GpuTask::GpuTask(Reporter* reporter, TaskRunner* taskRunner) : Task(reporter, taskRunner) {} |
void GpuTask::run(GrContextFactory& factory) { |
- this->start(); |
if (FLAGS_gpu && !this->shouldSkip()) { |
+ this->start(); |
this->draw(&factory); |
+ this->finish(); |
} |
- this->finish(); |
SkDELETE(this); |
} |