Index: dm/DMTask.cpp |
diff --git a/dm/DMTask.cpp b/dm/DMTask.cpp |
index 1c4cc25693be54962990808caade6e7cdb84f60a..419463a5b4e3e7dd11d6341b4c6490acf2a983a9 100644 |
--- a/dm/DMTask.cpp |
+++ b/dm/DMTask.cpp |
@@ -25,8 +25,12 @@ void Task::fail(const char* msg) { |
fReporter->fail(failure); |
} |
+void Task::start() { |
+ fStart = SkTime::GetMSecs(); |
+} |
+ |
void Task::finish() { |
- fReporter->finish(this->name()); |
+ fReporter->finish(this->name(), SkTime::GetMSecs() - fStart); |
} |
void Task::spawnChild(CpuTask* task) { |
@@ -37,6 +41,7 @@ CpuTask::CpuTask(Reporter* reporter, TaskRunner* taskRunner) : Task(reporter, ta |
CpuTask::CpuTask(const Task& parent) : Task(parent) {} |
void CpuTask::run() { |
+ this->start(); |
if (!this->shouldSkip()) { |
this->draw(); |
} |
@@ -47,6 +52,7 @@ void CpuTask::run() { |
GpuTask::GpuTask(Reporter* reporter, TaskRunner* taskRunner) : Task(reporter, taskRunner) {} |
void GpuTask::run(GrContextFactory& factory) { |
+ this->start(); |
if (!this->shouldSkip()) { |
this->draw(&factory); |
} |