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

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: rename a function 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
Index: debugger/QT/SkDebuggerGUI.cpp
diff --git a/debugger/QT/SkDebuggerGUI.cpp b/debugger/QT/SkDebuggerGUI.cpp
index 1b5a366aa45a96f5a85dde87326bc404403fac8e..ac88fcb2773d0b0c35dc3cfb31d2759bd4f238f2 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,9 +403,19 @@ void SkDebuggerGUI::pauseDrawing(bool isPaused) {
}
}
-void SkDebuggerGUI::registerListClick(QListWidgetItem *item) {
- if(!fLoading) {
- int currentRow = fListWidget.currentRow();
+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 {
+ fInspectorWidget.setDisabled(false);
+ fViewStateFrame.setDisabled(false);
robertphillips 2015/01/05 19:14:09 Don't we no longer need this "currentRow != -1" te
Kimmo Kinnunen 2015/01/07 07:33:48 Done. (Sorry, that was a rebase error, too many pa
if (currentRow != -1) {
if (!this->isPaused()) {
@@ -428,9 +437,17 @@ void SkDebuggerGUI::registerListClick(QListWidgetItem *item) {
fInspectorWidget.setDisabled(false);
fViewStateFrame.setDisabled(false);
}
- setupClipStackText();
+ } else {
+ fInspectorWidget.setText("", SkInspectorWidget::kDetail_TabType);
}
+ SkString clipStack;
+ fDebugger.getClipStackText(&clipStack);
+ fInspectorWidget.setText(clipStack.c_str(), SkInspectorWidget::kClipStack_TabType);
+
+ fCurrentCommandBox.setText(QString::number(currentRow));
+
+ fDrawCommandGeometryWidget.setDrawCommandIndex(currentRow);
}
}
@@ -783,6 +800,8 @@ void SkDebuggerGUI::loadPicture(const SkString& fileName) {
fActionSave.setDisabled(false);
fActionSaveAs.setDisabled(false);
fActionPause.setChecked(false);
+ fDrawCommandGeometryWidget.setDrawCommandIndex(-1);
+
fLoading = false;
actionPlay();
}
@@ -826,11 +845,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 +869,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));
}

Powered by Google App Engine
This is Rietveld 408576698