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

Unified Diff: debugger/QT/SkDebuggerGUI.cpp

Issue 835903002: debugger: Update inspector view data consistently while paused (Closed) Base URL: https://skia.googlesource.com/skia.git@debugger-small-things-02-debuggergui-redundant-variables
Patch Set: address review commits Created 5 years, 11 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 | « debugger/QT/SkDebuggerGUI.h ('k') | debugger/QT/SkDrawCommandGeometryWidget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: debugger/QT/SkDebuggerGUI.cpp
diff --git a/debugger/QT/SkDebuggerGUI.cpp b/debugger/QT/SkDebuggerGUI.cpp
index 1b5a366aa45a96f5a85dde87326bc404403fac8e..dade56768d59049b862e8dc4f7f233cb55e5c33f 100644
--- a/debugger/QT/SkDebuggerGUI.cpp
+++ b/debugger/QT/SkDebuggerGUI.cpp
@@ -66,7 +66,8 @@ SkDebuggerGUI::SkDebuggerGUI(QWidget *parent) :
{
setupUi(this);
fListWidget.setSelectionMode(QAbstractItemView::ExtendedSelection);
- connect(&fListWidget, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(registerListClick(QListWidgetItem *)));
+ connect(&fListWidget, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this,
+ SLOT(updateDrawCommandInfo()));
connect(&fActionOpen, SIGNAL(triggered()), this, SLOT(openFile()));
connect(&fActionDirectory, SIGNAL(triggered()), this, SLOT(toggleDirectory()));
connect(&fDirectoryWidget, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), this, SLOT(loadFile(QListWidgetItem *)));
@@ -98,8 +99,6 @@ SkDebuggerGUI::SkDebuggerGUI(QWidget *parent) :
connect(&fCanvasWidget, SIGNAL(hitChanged(int)), this, SLOT(selectCommand(int)));
connect(&fCanvasWidget, SIGNAL(hitChanged(int)), this, SLOT(updateHit(int)));
connect(&fCanvasWidget, SIGNAL(scaleFactorChanged(float)), this, SLOT(actionScale(float)));
- connect(&fCanvasWidget, SIGNAL(commandChanged(int)), this, SLOT(updateCommand(int)));
- connect(&fCanvasWidget, SIGNAL(commandChanged(int)), &fDrawCommandGeometryWidget, SLOT(updateImage()));
connect(&fActionSaveAs, SIGNAL(triggered()), this, SLOT(actionSaveAs()));
connect(&fActionSave, SIGNAL(triggered()), this, SLOT(actionSave()));
@@ -404,33 +403,44 @@ void SkDebuggerGUI::pauseDrawing(bool isPaused) {
}
}
-void SkDebuggerGUI::registerListClick(QListWidgetItem *item) {
- if(!fLoading) {
- int currentRow = fListWidget.currentRow();
-
- if (currentRow != -1) {
- if (!this->isPaused()) {
- fCanvasWidget.drawTo(currentRow);
- }
- const SkTDArray<SkString*> *currInfo = fDebugger.getCommandInfo(currentRow);
-
- /* TODO(chudy): Add command type before parameters. Rename v
- * to something more informative. */
- if (currInfo) {
- QString info;
- info.append("<b>Parameters: </b><br/>");
- for (int i = 0; i < currInfo->count(); i++) {
-
- info.append(QString((*currInfo)[i]->c_str()));
- info.append("<br/>");
- }
- fInspectorWidget.setText(info, SkInspectorWidget::kDetail_TabType);
- fInspectorWidget.setDisabled(false);
- fViewStateFrame.setDisabled(false);
+void SkDebuggerGUI::updateDrawCommandInfo() {
+ int currentRow = -1;
+ if (!fLoading) {
+ currentRow = fListWidget.currentRow();
+ }
+ if (currentRow == -1) {
+ fInspectorWidget.setText("", SkInspectorWidget::kDetail_TabType);
+ fInspectorWidget.setText("", SkInspectorWidget::kClipStack_TabType);
+ fCurrentCommandBox.setText("");
+ fDrawCommandGeometryWidget.setDrawCommandIndex(-1);
+ } else {
+ if (!this->isPaused()) {
+ fCanvasWidget.drawTo(currentRow);
+ }
+ const SkTDArray<SkString*> *currInfo = fDebugger.getCommandInfo(currentRow);
+
+ /* TODO(chudy): Add command type before parameters. Rename v
+ * to something more informative. */
+ if (currInfo) {
+ QString info;
+ info.append("<b>Parameters: </b><br/>");
+ for (int i = 0; i < currInfo->count(); i++) {
+ info.append(QString((*currInfo)[i]->c_str()));
+ info.append("<br/>");
}
- setupClipStackText();
+ fInspectorWidget.setText(info, SkInspectorWidget::kDetail_TabType);
}
+ SkString clipStack;
+ fDebugger.getClipStackText(&clipStack);
+ fInspectorWidget.setText(clipStack.c_str(), SkInspectorWidget::kClipStack_TabType);
+
+ fCurrentCommandBox.setText(QString::number(currentRow));
+
+ fDrawCommandGeometryWidget.setDrawCommandIndex(currentRow);
+
+ fInspectorWidget.setDisabled(false);
+ fViewStateFrame.setDisabled(false);
}
}
@@ -783,6 +793,8 @@ void SkDebuggerGUI::loadPicture(const SkString& fileName) {
fActionSave.setDisabled(false);
fActionSaveAs.setDisabled(false);
fActionPause.setChecked(false);
+ fDrawCommandGeometryWidget.setDrawCommandIndex(-1);
+
fLoading = false;
actionPlay();
}
@@ -826,11 +838,6 @@ void SkDebuggerGUI::setupOverviewText(const SkTDArray<double>* typeTimes,
fInspectorWidget.setText(overview.c_str(), SkInspectorWidget::kOverview_TabType);
}
-void SkDebuggerGUI::setupClipStackText() {
- SkString clipStack;
- fDebugger.getClipStackText(&clipStack);
- fInspectorWidget.setText(clipStack.c_str(), SkInspectorWidget::kClipStack_TabType);
-}
void SkDebuggerGUI::setupComboBox() {
fFilter.clear();
@@ -855,10 +862,6 @@ void SkDebuggerGUI::setupComboBox() {
firstItem->setSelectable(false);
}
-void SkDebuggerGUI::updateCommand(int newCommand) {
- fCurrentCommandBox.setText(QString::number(newCommand));
-}
-
void SkDebuggerGUI::updateHit(int newHit) {
fCommandHitBox.setText(QString::number(newHit));
}
« no previous file with comments | « debugger/QT/SkDebuggerGUI.h ('k') | debugger/QT/SkDrawCommandGeometryWidget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698