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

Unified Diff: dm/DMTask.cpp

Issue 185233004: DM: tweak output. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: ws 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dm/DMTask.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « dm/DMTask.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698