DM: tweak output.
Show task name in verbose mode only, and add task runtime.
BUG=skia:
R=reed@google.com, bsalomon@google.com, mtklein@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/185233004
git-svn-id: http://skia.googlecode.com/svn/trunk@13639 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/dm/DMTask.cpp b/dm/DMTask.cpp
index 1c4cc25..419463a 100644
--- a/dm/DMTask.cpp
+++ b/dm/DMTask.cpp
@@ -25,8 +25,12 @@
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(const Task& parent) : Task(parent) {}
void CpuTask::run() {
+ this->start();
if (!this->shouldSkip()) {
this->draw();
}
@@ -47,6 +52,7 @@
GpuTask::GpuTask(Reporter* reporter, TaskRunner* taskRunner) : Task(reporter, taskRunner) {}
void GpuTask::run(GrContextFactory& factory) {
+ this->start();
if (!this->shouldSkip()) {
this->draw(&factory);
}