Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkDebuggerGUI.h" | 8 #include "SkDebuggerGUI.h" |
| 9 #include "SkForceLinking.h" | 9 #include "SkForceLinking.h" |
| 10 #include "SkGraphics.h" | 10 #include "SkGraphics.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 connect(&fActionClearDeletes, SIGNAL(triggered()), this, SLOT(actionClearDel etes())); | 94 connect(&fActionClearDeletes, SIGNAL(triggered()), this, SLOT(actionClearDel etes())); |
| 95 connect(&fActionClose, SIGNAL(triggered()), this, SLOT(actionClose())); | 95 connect(&fActionClose, SIGNAL(triggered()), this, SLOT(actionClose())); |
| 96 connect(&fSettingsWidget, SIGNAL(visibilityFilterChanged()), this, SLOT(acti onCommandFilter())); | 96 connect(&fSettingsWidget, SIGNAL(visibilityFilterChanged()), this, SLOT(acti onCommandFilter())); |
| 97 #if SK_SUPPORT_GPU | 97 #if SK_SUPPORT_GPU |
| 98 connect(&fSettingsWidget, SIGNAL(glSettingsChanged()), this, SLOT(actionGLWi dget())); | 98 connect(&fSettingsWidget, SIGNAL(glSettingsChanged()), this, SLOT(actionGLWi dget())); |
| 99 #endif | 99 #endif |
| 100 connect(&fSettingsWidget, SIGNAL(texFilterSettingsChanged()), this, SLOT(act ionTextureFilter())); | 100 connect(&fSettingsWidget, SIGNAL(texFilterSettingsChanged()), this, SLOT(act ionTextureFilter())); |
| 101 connect(fSettingsWidget.getRasterCheckBox(), SIGNAL(toggled(bool)), this, SL OT(actionRasterWidget(bool))); | 101 connect(fSettingsWidget.getRasterCheckBox(), SIGNAL(toggled(bool)), this, SL OT(actionRasterWidget(bool))); |
| 102 connect(fSettingsWidget.getOverdrawVizCheckBox(), SIGNAL(toggled(bool)), thi s, SLOT(actionOverdrawVizWidget(bool))); | 102 connect(fSettingsWidget.getOverdrawVizCheckBox(), SIGNAL(toggled(bool)), thi s, SLOT(actionOverdrawVizWidget(bool))); |
| 103 connect(fSettingsWidget.getMegaVizCheckBox(), SIGNAL(toggled(bool)), this, S LOT(actionMegaVizWidget(bool))); | 103 connect(fSettingsWidget.getMegaVizCheckBox(), SIGNAL(toggled(bool)), this, S LOT(actionMegaVizWidget(bool))); |
| 104 connect(fSettingsWidget.getPathOpsCheckBox(), SIGNAL(toggled(bool)), this, S LOT(actionPathOpsWidget(bool))); | |
| 104 connect(&fActionPause, SIGNAL(toggled(bool)), this, SLOT(pauseDrawing(bool)) ); | 105 connect(&fActionPause, SIGNAL(toggled(bool)), this, SLOT(pauseDrawing(bool)) ); |
| 105 connect(&fActionCreateBreakpoint, SIGNAL(activated()), this, SLOT(toggleBrea kpoint())); | 106 connect(&fActionCreateBreakpoint, SIGNAL(activated()), this, SLOT(toggleBrea kpoint())); |
| 106 connect(&fActionShowDeletes, SIGNAL(triggered()), this, SLOT(showDeletes())) ; | 107 connect(&fActionShowDeletes, SIGNAL(triggered()), this, SLOT(showDeletes())) ; |
| 107 connect(&fCanvasWidget, SIGNAL(hitChanged(int)), this, SLOT(selectCommand(in t))); | 108 connect(&fCanvasWidget, SIGNAL(hitChanged(int)), this, SLOT(selectCommand(in t))); |
| 108 connect(&fCanvasWidget, SIGNAL(hitChanged(int)), &fSettingsWidget, SLOT(upda teHit(int))); | 109 connect(&fCanvasWidget, SIGNAL(hitChanged(int)), &fSettingsWidget, SLOT(upda teHit(int))); |
| 109 connect(&fCanvasWidget, SIGNAL(scaleFactorChanged(float)), this, SLOT(action Scale(float))); | 110 connect(&fCanvasWidget, SIGNAL(scaleFactorChanged(float)), this, SLOT(action Scale(float))); |
| 110 connect(&fCanvasWidget, SIGNAL(commandChanged(int)), &fSettingsWidget, SLOT( updateCommand(int))); | 111 connect(&fCanvasWidget, SIGNAL(commandChanged(int)), &fSettingsWidget, SLOT( updateCommand(int))); |
| 111 connect(&fActionSaveAs, SIGNAL(triggered()), this, SLOT(actionSaveAs())); | 112 connect(&fActionSaveAs, SIGNAL(triggered()), this, SLOT(actionSaveAs())); |
| 112 connect(&fActionSave, SIGNAL(triggered()), this, SLOT(actionSave())); | 113 connect(&fActionSave, SIGNAL(triggered()), this, SLOT(actionSave())); |
| 113 | 114 |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 407 | 408 |
| 408 // extract the individual command times from the SkTimedPlaybackPicture | 409 // extract the individual command times from the SkTimedPlaybackPicture |
| 409 for (int i = 0; i < picture->count(); ++i) { | 410 for (int i = 0; i < picture->count(); ++i) { |
| 410 double temp = picture->time(i); | 411 double temp = picture->time(i); |
| 411 | 412 |
| 412 QListWidgetItem* item = fListWidget.item(i); | 413 QListWidgetItem* item = fListWidget.item(i); |
| 413 | 414 |
| 414 item->setData(Qt::UserRole + 4, 100.0*temp); | 415 item->setData(Qt::UserRole + 4, 100.0*temp); |
| 415 } | 416 } |
| 416 | 417 |
| 417 setupOverviewText(picture->typeTimes(), picture->totTime(), kNumRepeats); | 418 setupOverviewText(picture->typeTimes(), picture->totTime(), kNumRepeats); |
|
robertphillips
2014/05/16 12:21:24
this-> ?
caryclark
2014/05/16 13:49:02
Since the surrounding isn't written 'this' way, ch
| |
| 419 setupClipStackText(); | |
| 418 } | 420 } |
| 419 | 421 |
| 420 void SkDebuggerGUI::actionCancel() { | 422 void SkDebuggerGUI::actionCancel() { |
| 421 for (int row = 0; row < fListWidget.count(); row++) { | 423 for (int row = 0; row < fListWidget.count(); row++) { |
| 422 fListWidget.item(row)->setHidden(false); | 424 fListWidget.item(row)->setHidden(false); |
| 423 } | 425 } |
| 424 } | 426 } |
| 425 | 427 |
| 426 void SkDebuggerGUI::actionClearBreakpoints() { | 428 void SkDebuggerGUI::actionClearBreakpoints() { |
| 427 for (int row = 0; row < fListWidget.count(); row++) { | 429 for (int row = 0; row < fListWidget.count(); row++) { |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 528 void SkDebuggerGUI::actionOverdrawVizWidget(bool isToggled) { | 530 void SkDebuggerGUI::actionOverdrawVizWidget(bool isToggled) { |
| 529 fDebugger.setOverdrawViz(isToggled); | 531 fDebugger.setOverdrawViz(isToggled); |
| 530 fCanvasWidget.update(); | 532 fCanvasWidget.update(); |
| 531 } | 533 } |
| 532 | 534 |
| 533 void SkDebuggerGUI::actionMegaVizWidget(bool isToggled) { | 535 void SkDebuggerGUI::actionMegaVizWidget(bool isToggled) { |
| 534 fDebugger.setMegaViz(isToggled); | 536 fDebugger.setMegaViz(isToggled); |
| 535 fCanvasWidget.update(); | 537 fCanvasWidget.update(); |
| 536 } | 538 } |
| 537 | 539 |
| 540 void SkDebuggerGUI::actionPathOpsWidget(bool isToggled) { | |
| 541 fDebugger.setPathOps(isToggled); | |
| 542 fCanvasWidget.update(); | |
| 543 } | |
| 544 | |
| 538 void SkDebuggerGUI::actionTextureFilter() { | 545 void SkDebuggerGUI::actionTextureFilter() { |
| 539 SkPaint::FilterLevel level; | 546 SkPaint::FilterLevel level; |
| 540 bool enabled = fSettingsWidget.getFilterOverride(&level); | 547 bool enabled = fSettingsWidget.getFilterOverride(&level); |
| 541 fDebugger.setTexFilterOverride(enabled, level); | 548 fDebugger.setTexFilterOverride(enabled, level); |
| 542 fCanvasWidget.update(); | 549 fCanvasWidget.update(); |
| 543 } | 550 } |
| 544 | 551 |
| 545 void SkDebuggerGUI::actionRewind() { | 552 void SkDebuggerGUI::actionRewind() { |
| 546 fListWidget.setCurrentRow(0); | 553 fListWidget.setCurrentRow(0); |
| 547 } | 554 } |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 654 if (currInfo) { | 661 if (currInfo) { |
| 655 QString info; | 662 QString info; |
| 656 info.append("<b>Parameters: </b><br/>"); | 663 info.append("<b>Parameters: </b><br/>"); |
| 657 for (int i = 0; i < currInfo->count(); i++) { | 664 for (int i = 0; i < currInfo->count(); i++) { |
| 658 | 665 |
| 659 info.append(QString((*currInfo)[i]->c_str())); | 666 info.append(QString((*currInfo)[i]->c_str())); |
| 660 info.append("<br/>"); | 667 info.append("<br/>"); |
| 661 } | 668 } |
| 662 fInspectorWidget.setText(info, SkInspectorWidget::kDetail_TabTyp e); | 669 fInspectorWidget.setText(info, SkInspectorWidget::kDetail_TabTyp e); |
| 663 fInspectorWidget.setDisabled(false); | 670 fInspectorWidget.setDisabled(false); |
| 664 } | 671 } |
|
robertphillips
2014/05/16 12:21:24
Can this just be this->setupClipStackText?
caryclark
2014/05/16 13:49:02
I completely missed that!
| |
| 672 SkString clipStack; | |
| 673 fDebugger.getClipStackText(&clipStack); | |
| 674 QString qClipStack; | |
| 675 qClipStack.append(clipStack.c_str()); | |
| 676 fInspectorWidget.setText(qClipStack, SkInspectorWidget::kClipStack_T abType); | |
| 665 } | 677 } |
| 666 | 678 |
| 667 } | 679 } |
| 668 } | 680 } |
| 669 | 681 |
| 670 void SkDebuggerGUI::selectCommand(int command) { | 682 void SkDebuggerGUI::selectCommand(int command) { |
| 671 if (fPause) { | 683 if (fPause) { |
| 672 fListWidget.setCurrentRow(command); | 684 fListWidget.setCurrentRow(command); |
| 673 } | 685 } |
| 674 } | 686 } |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1036 } | 1048 } |
| 1037 | 1049 |
| 1038 void SkDebuggerGUI::setupOverviewText(const SkTDArray<double>* typeTimes, | 1050 void SkDebuggerGUI::setupOverviewText(const SkTDArray<double>* typeTimes, |
| 1039 double totTime, | 1051 double totTime, |
| 1040 int numRuns) { | 1052 int numRuns) { |
| 1041 SkString overview; | 1053 SkString overview; |
| 1042 fDebugger.getOverviewText(typeTimes, totTime, &overview, numRuns); | 1054 fDebugger.getOverviewText(typeTimes, totTime, &overview, numRuns); |
| 1043 fInspectorWidget.setText(overview.c_str(), SkInspectorWidget::kOverview_TabT ype); | 1055 fInspectorWidget.setText(overview.c_str(), SkInspectorWidget::kOverview_TabT ype); |
| 1044 } | 1056 } |
| 1045 | 1057 |
| 1058 void SkDebuggerGUI::setupClipStackText() { | |
| 1059 SkString clipStack; | |
| 1060 fDebugger.getClipStackText(&clipStack); | |
| 1061 fInspectorWidget.setText(clipStack.c_str(), SkInspectorWidget::kClipStack_Ta bType); | |
| 1062 } | |
| 1063 | |
| 1046 void SkDebuggerGUI::setupComboBox(SkTArray<SkString>* command) { | 1064 void SkDebuggerGUI::setupComboBox(SkTArray<SkString>* command) { |
| 1047 fFilter.clear(); | 1065 fFilter.clear(); |
| 1048 fFilter.addItem("--Filter By Available Commands--"); | 1066 fFilter.addItem("--Filter By Available Commands--"); |
| 1049 | 1067 |
| 1050 std::map<std::string, int> map; | 1068 std::map<std::string, int> map; |
| 1051 for (int i = 0; i < command->count(); i++) { | 1069 for (int i = 0; i < command->count(); i++) { |
| 1052 map[(*command)[i].c_str()]++; | 1070 map[(*command)[i].c_str()]++; |
| 1053 } | 1071 } |
| 1054 | 1072 |
| 1055 for (std::map<std::string, int>::iterator it = map.begin(); it != map.end(); | 1073 for (std::map<std::string, int>::iterator it = map.begin(); it != map.end(); |
| 1056 ++it) { | 1074 ++it) { |
| 1057 fFilter.addItem((it->first).c_str()); | 1075 fFilter.addItem((it->first).c_str()); |
| 1058 } | 1076 } |
| 1059 | 1077 |
| 1060 // NOTE(chudy): Makes first item unselectable. | 1078 // NOTE(chudy): Makes first item unselectable. |
| 1061 QStandardItemModel* model = qobject_cast<QStandardItemModel*>( | 1079 QStandardItemModel* model = qobject_cast<QStandardItemModel*>( |
| 1062 fFilter.model()); | 1080 fFilter.model()); |
| 1063 QModelIndex firstIndex = model->index(0, fFilter.modelColumn(), | 1081 QModelIndex firstIndex = model->index(0, fFilter.modelColumn(), |
| 1064 fFilter.rootModelIndex()); | 1082 fFilter.rootModelIndex()); |
| 1065 QStandardItem* firstItem = model->itemFromIndex(firstIndex); | 1083 QStandardItem* firstItem = model->itemFromIndex(firstIndex); |
| 1066 firstItem->setSelectable(false); | 1084 firstItem->setSelectable(false); |
| 1067 } | 1085 } |
| OLD | NEW |