aboutsummaryrefslogtreecommitdiffhomepage
path: root/debugger
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2015-03-26 10:08:04 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-03-26 10:08:04 -0700
commit546db46a76ad5f7485cebeb27efaf8b4806fa914 (patch)
tree107661e571f74db9d8cc101b2a8d5ba31dad7f3c /debugger
parent0eed6df064e6d148ddc330531d584ddd1bd4e6db (diff)
Debugger: remove dead feature (SkPicture offset display) & fix bug (unbalanced indents)
Displaying the offset into an SkPicture hasn't worked for a while so this CL deletes the feature. When "Save Layer" was renamed to "SaveLayer" the code that computes the indent in the list view was broken. This CL patches the problem. Review URL: https://codereview.chromium.org/1034733004
Diffstat (limited to 'debugger')
-rw-r--r--debugger/QT/SkDebuggerGUI.cpp31
-rw-r--r--debugger/QT/SkDebuggerGUI.h6
-rw-r--r--debugger/QT/SkListWidget.cpp6
-rw-r--r--debugger/QT/SkListWidget.h15
4 files changed, 16 insertions, 42 deletions
diff --git a/debugger/QT/SkDebuggerGUI.cpp b/debugger/QT/SkDebuggerGUI.cpp
index ea3564ca0d..c51f24243d 100644
--- a/debugger/QT/SkDebuggerGUI.cpp
+++ b/debugger/QT/SkDebuggerGUI.cpp
@@ -32,7 +32,6 @@ SkDebuggerGUI::SkDebuggerGUI(QWidget *parent) :
, fToolBar(this)
, fActionOpen(this)
, fActionBreakpoint(this)
- , fActionToggleIndexStyle(this)
, fActionProfile(this)
, fActionCancel(this)
, fActionClearBreakpoints(this)
@@ -79,7 +78,6 @@ SkDebuggerGUI::SkDebuggerGUI(QWidget *parent) :
connect(&fActionStepBack, SIGNAL(triggered()), this, SLOT(actionStepBack()));
connect(&fActionStepForward, SIGNAL(triggered()), this, SLOT(actionStepForward()));
connect(&fActionBreakpoint, SIGNAL(triggered()), this, SLOT(actionBreakpoints()));
- connect(&fActionToggleIndexStyle, SIGNAL(triggered()), this, SLOT(actionToggleIndexStyle()));
connect(&fActionInspector, SIGNAL(triggered()), this, SLOT(actionInspector()));
connect(&fActionSettings, SIGNAL(triggered()), this, SLOT(actionSettings()));
connect(&fFilter, SIGNAL(activated(QString)), this, SLOT(toggleFilter(QString)));
@@ -126,14 +124,6 @@ void SkDebuggerGUI::actionBreakpoints() {
}
}
-void SkDebuggerGUI::actionToggleIndexStyle() {
- bool indexStyleToggle = fActionToggleIndexStyle.isChecked();
- SkListWidget* list = (SkListWidget*) fListWidget.itemDelegate();
- list->setIndexStyle(indexStyleToggle ? SkListWidget::kOffset_IndexStyle
- : SkListWidget::kIndex_IndexStyle);
- fListWidget.update();
-}
-
void SkDebuggerGUI::showDeletes() {
bool deletesActivated = fActionShowDeletes.isChecked();
for (int row = 0; row < fListWidget.count(); row++) {
@@ -483,10 +473,6 @@ void SkDebuggerGUI::setupUi(QMainWindow *SkDebuggerGUI) {
fActionBreakpoint.setText("Breakpoints");
fActionBreakpoint.setCheckable(true);
- fActionToggleIndexStyle.setShortcut(QKeySequence(tr("Ctrl+T")));
- fActionToggleIndexStyle.setText("Toggle Index Style");
- fActionToggleIndexStyle.setCheckable(true);
-
QIcon cancel;
cancel.addFile(QString::fromUtf8(":/reload.png"), QSize(),
QIcon::Normal, QIcon::Off);
@@ -704,7 +690,6 @@ void SkDebuggerGUI::setupUi(QMainWindow *SkDebuggerGUI) {
fMenuView.setTitle("View");
fMenuView.addAction(&fActionBreakpoint);
fMenuView.addAction(&fActionShowDeletes);
- fMenuView.addAction(&fActionToggleIndexStyle);
fMenuView.addAction(&fActionZoomIn);
fMenuView.addAction(&fActionZoomOut);
@@ -787,6 +772,19 @@ void SkDebuggerGUI::loadPicture(const SkString& fileName) {
}
void SkDebuggerGUI::setupListWidget() {
+
+ SkASSERT(!strcmp("Save",
+ SkDrawCommand::GetCommandString(SkDrawCommand::kSave_OpType)));
+ SkASSERT(!strcmp("SaveLayer",
+ SkDrawCommand::GetCommandString(SkDrawCommand::kSaveLayer_OpType)));
+ SkASSERT(!strcmp("Restore",
+ SkDrawCommand::GetCommandString(SkDrawCommand::kRestore_OpType)));
+ SkASSERT(!strcmp("BeginCommentGroup",
+ SkDrawCommand::GetCommandString(SkDrawCommand::kBeginCommentGroup_OpType)));
+ SkASSERT(!strcmp("EndCommentGroup",
+ SkDrawCommand::GetCommandString(SkDrawCommand::kEndCommentGroup_OpType)));
+
+
fListWidget.clear();
int counter = 0;
int indent = 0;
@@ -805,13 +803,12 @@ void SkDebuggerGUI::setupListWidget() {
item->setData(Qt::UserRole + 3, indent);
if (0 == strcmp("Save", commandString.c_str()) ||
- 0 == strcmp("Save Layer", commandString.c_str()) ||
+ 0 == strcmp("SaveLayer", commandString.c_str()) ||
0 == strcmp("BeginCommentGroup", commandString.c_str())) {
indent += 10;
}
item->setData(Qt::UserRole + 4, -1);
- item->setData(Qt::UserRole + 5, (int) command->offset());
fListWidget.addItem(item);
}
diff --git a/debugger/QT/SkDebuggerGUI.h b/debugger/QT/SkDebuggerGUI.h
index d6c3f49073..6ff4d4d90c 100644
--- a/debugger/QT/SkDebuggerGUI.h
+++ b/debugger/QT/SkDebuggerGUI.h
@@ -78,11 +78,6 @@ private slots:
void actionBreakpoints();
/**
- Toggles between count and offset style of command indexing in GUI
- */
- void actionToggleIndexStyle();
-
- /**
Profile the commands
*/
void actionProfile();
@@ -243,7 +238,6 @@ private:
QAction fActionOpen;
QAction fActionBreakpoint;
- QAction fActionToggleIndexStyle;
QAction fActionProfile;
QAction fActionCancel;
QAction fActionClearBreakpoints;
diff --git a/debugger/QT/SkListWidget.cpp b/debugger/QT/SkListWidget.cpp
index b5f9038d69..a027778473 100644
--- a/debugger/QT/SkListWidget.cpp
+++ b/debugger/QT/SkListWidget.cpp
@@ -61,11 +61,7 @@ void SkListWidget::paint (QPainter *painter,
QString drawCommandText = index.data(Qt::DisplayRole).toString();
QString drawCommandNumber;
- if (kIndex_IndexStyle == fIndexStyle) {
- drawCommandNumber = index.data(Qt::UserRole + 1).toString();
- } else {
- drawCommandNumber = index.data(Qt::UserRole + 5).toString();
- }
+ drawCommandNumber = index.data(Qt::UserRole + 1).toString();
float time = index.data(Qt::UserRole + 4).toFloat();
QString drawTime;
drawTime.setNum(time, 'f', 2);
diff --git a/debugger/QT/SkListWidget.h b/debugger/QT/SkListWidget.h
index d6e797ae9b..4a799a01fe 100644
--- a/debugger/QT/SkListWidget.h
+++ b/debugger/QT/SkListWidget.h
@@ -19,16 +19,11 @@
*/
class SkListWidget : public QAbstractItemDelegate {
public:
- enum IndexStyle {
- kIndex_IndexStyle,
- kOffset_IndexStyle,
- };
-
/**
Constructs the list widget with the specified parent for layout purposes.
@param parent The parent container of this widget
*/
- SkListWidget(QObject* parent = NULL) : fIndexStyle(kIndex_IndexStyle) {}
+ SkListWidget(QObject* parent = NULL) {}
virtual ~SkListWidget() {}
@@ -43,14 +38,6 @@ public:
*/
QSize sizeHint(const QStyleOptionViewItem& option,
const QModelIndex& index) const;
-
-
- void setIndexStyle(IndexStyle indexStyle) {
- fIndexStyle = indexStyle;
- }
-
-protected:
- IndexStyle fIndexStyle;
};
#endif