diff options
author | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-03-07 19:32:45 +0000 |
---|---|---|
committer | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-03-07 19:32:45 +0000 |
commit | 20beb481ec72b9723c63f9ed5480adad0ff5a9a0 (patch) | |
tree | 4f89981e247a00f2d268592d9ea4c905009cb724 | |
parent | 6918d482d64f045a4c980b2fb267bc939953638e (diff) |
Normalize the debugger's profile times by the repeat count
https://codereview.appspot.com/7520043/
git-svn-id: http://skia.googlecode.com/svn/trunk@8025 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | debugger/QT/SkDebuggerGUI.cpp | 12 | ||||
-rw-r--r-- | debugger/QT/SkDebuggerGUI.h | 2 | ||||
-rw-r--r-- | debugger/QT/SkListWidget.cpp | 1 |
3 files changed, 9 insertions, 6 deletions
diff --git a/debugger/QT/SkDebuggerGUI.cpp b/debugger/QT/SkDebuggerGUI.cpp index f1f4694d03..83dd17ff8b 100644 --- a/debugger/QT/SkDebuggerGUI.cpp +++ b/debugger/QT/SkDebuggerGUI.cpp @@ -404,7 +404,7 @@ void SkDebuggerGUI::actionProfile() { item->setData(Qt::UserRole + 4, 100.0*temp); } - setupOverviewText(picture.typeTimes(), picture.totTime()); + setupOverviewText(picture.typeTimes(), picture.totTime(), kNumRepeats); } void SkDebuggerGUI::actionCancel() { @@ -1032,7 +1032,7 @@ void SkDebuggerGUI::loadPicture(const SkString& fileName) { setupListWidget(commands); setupComboBox(commands); - setupOverviewText(NULL, 0.0); + setupOverviewText(NULL, 0.0, 1); fInspectorWidget.setDisabled(false); fSettingsWidget.setDisabled(false); fMenuEdit.setDisabled(false); @@ -1070,7 +1070,9 @@ void SkDebuggerGUI::setupListWidget(SkTArray<SkString>* command) { } } -void SkDebuggerGUI::setupOverviewText(const SkTDArray<double>* typeTimes, double totTime) { +void SkDebuggerGUI::setupOverviewText(const SkTDArray<double>* typeTimes, + double totTime, + int numRuns) { const SkTDArray<SkDrawCommand*>& commands = fDebugger.getDrawCommands(); @@ -1101,7 +1103,7 @@ void SkDebuggerGUI::setupOverviewText(const SkTDArray<double>* typeTimes, double overview.append(QString::number(counts[i])); if (NULL != typeTimes) { overview.append(" - "); - overview.append(QString::number((*typeTimes)[i], 'f', 1)); + overview.append(QString::number((*typeTimes)[i]/(float)numRuns, 'f', 1)); overview.append("ms"); overview.append(" - "); double percent = 100.0*(*typeTimes)[i]/totTime; @@ -1124,7 +1126,7 @@ void SkDebuggerGUI::setupOverviewText(const SkTDArray<double>* typeTimes, double if (totTime > 0.0) { overview.append("Total Time: "); - overview.append(QString::number(totTime, 'f', 2)); + overview.append(QString::number(totTime/(float)numRuns, 'f', 2)); overview.append("ms"); #ifdef SK_DEBUG overview.append(" "); diff --git a/debugger/QT/SkDebuggerGUI.h b/debugger/QT/SkDebuggerGUI.h index bb3d6ceb49..f9960a32d9 100644 --- a/debugger/QT/SkDebuggerGUI.h +++ b/debugger/QT/SkDebuggerGUI.h @@ -323,7 +323,7 @@ private: /** Fills in the overview pane with text */ - void setupOverviewText(const SkTDArray<double>* typeTimes, double totTime); + void setupOverviewText(const SkTDArray<double>* typeTimes, double totTime, int numRuns); /** Render the supplied picture several times tracking the time consumed diff --git a/debugger/QT/SkListWidget.cpp b/debugger/QT/SkListWidget.cpp index b797cc0bf7..cc94ff8111 100644 --- a/debugger/QT/SkListWidget.cpp +++ b/debugger/QT/SkListWidget.cpp @@ -68,6 +68,7 @@ void SkListWidget::paint (QPainter *painter, float time = index.data(Qt::UserRole + 4).toFloat(); QString drawTime; drawTime.setNum(time, 'f', 2); + drawTime += "%"; /* option.rect is a struct that Qt uses as a target to draw into. Following * the format (x1,y1,x2,y2) x1 and y1 represent where the painter can start |