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

Unified Diff: trunk/debugger/QT/SkDebuggerGUI.cpp

Issue 12449006: NaCl Debugger: Implement overview and filters, cleanup (Closed) Base URL: http://skia.googlecode.com/svn/
Patch Set: Created 7 years, 9 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 | « nacl/src/nacl_interface.cpp ('k') | trunk/debugger/SkDebugger.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/debugger/QT/SkDebuggerGUI.cpp
===================================================================
--- trunk/debugger/QT/SkDebuggerGUI.cpp (revision 7896)
+++ trunk/debugger/QT/SkDebuggerGUI.cpp (working copy)
@@ -1071,84 +1071,9 @@
}
void SkDebuggerGUI::setupOverviewText(const SkTDArray<double>* typeTimes, double totTime) {
-
- const SkTDArray<SkDrawCommand*>& commands = fDebugger.getDrawCommands();
-
- SkTDArray<int> counts;
- counts.setCount(LAST_DRAWTYPE_ENUM+1);
- for (int i = 0; i < LAST_DRAWTYPE_ENUM+1; ++i) {
- counts[i] = 0;
- }
-
- for (int i = 0; i < commands.count(); i++) {
- counts[commands[i]->getType()]++;
- }
-
- QString overview;
- int total = 0;
-#ifdef SK_DEBUG
- double totPercent = 0, tempSum = 0;
-#endif
- for (int i = 0; i < LAST_DRAWTYPE_ENUM+1; ++i) {
- if (0 == counts[i]) {
- // if there were no commands of this type then they should've consumed no time
- SkASSERT(NULL == typeTimes || 0.0 == (*typeTimes)[i]);
- continue;
- }
-
- overview.append(SkDrawCommand::GetCommandString((DrawType) i));
- overview.append(": ");
- overview.append(QString::number(counts[i]));
- if (NULL != typeTimes) {
- overview.append(" - ");
- overview.append(QString::number((*typeTimes)[i], 'f', 1));
- overview.append("ms");
- overview.append(" - ");
- double percent = 100.0*(*typeTimes)[i]/totTime;
- overview.append(QString::number(percent, 'f', 1));
- overview.append("%");
-#ifdef SK_DEBUG
- totPercent += percent;
- tempSum += (*typeTimes)[i];
-#endif
- }
- overview.append("<br/>");
- total += counts[i];
- }
-#ifdef SK_DEBUG
- if (NULL != typeTimes) {
- SkASSERT(SkScalarNearlyEqual(totPercent, 100.0));
- SkASSERT(SkScalarNearlyEqual(tempSum, totTime));
- }
-#endif
-
- if (totTime > 0.0) {
- overview.append("Total Time: ");
- overview.append(QString::number(totTime, 'f', 2));
- overview.append("ms");
-#ifdef SK_DEBUG
- overview.append(" ");
- overview.append(QString::number(totPercent));
- overview.append("% ");
-#endif
- overview.append("<br/>");
- }
-
- QString totalStr;
- totalStr.append("Total Draw Commands: ");
- totalStr.append(QString::number(total));
- totalStr.append("<br/>");
- overview.insert(0, totalStr);
-
- overview.append("<br/>");
- overview.append("SkPicture Width: ");
- // NOTE(chudy): This is where we can pull out the SkPictures width.
- overview.append(QString::number(fDebugger.pictureWidth()));
- overview.append("px<br/>");
- overview.append("SkPicture Height: ");
- overview.append(QString::number(fDebugger.pictureHeight()));
- overview.append("px");
- fInspectorWidget.setText(overview, SkInspectorWidget::kOverview_TabType);
+ SkString overview;
+ fDebugger.getOverviewText(typeTimes, totTime, &overview);
+ fInspectorWidget.setText(overview.c_str(), SkInspectorWidget::kOverview_TabType);
}
void SkDebuggerGUI::setupComboBox(SkTArray<SkString>* command) {
« no previous file with comments | « nacl/src/nacl_interface.cpp ('k') | trunk/debugger/SkDebugger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698