diff options
-rw-r--r-- | debugger/QT/SkDebuggerGUI.cpp | 109 | ||||
-rw-r--r-- | debugger/QT/SkDebuggerGUI.h | 35 | ||||
-rw-r--r-- | debugger/QT/SkSettingsWidget.cpp | 226 | ||||
-rw-r--r-- | debugger/QT/SkSettingsWidget.h | 96 |
4 files changed, 152 insertions, 314 deletions
diff --git a/debugger/QT/SkDebuggerGUI.cpp b/debugger/QT/SkDebuggerGUI.cpp index 25f70369fa..71d7b06a0b 100644 --- a/debugger/QT/SkDebuggerGUI.cpp +++ b/debugger/QT/SkDebuggerGUI.cpp @@ -94,22 +94,19 @@ SkDebuggerGUI::SkDebuggerGUI(QWidget *parent) : connect(&fActionClearBreakpoints, SIGNAL(triggered()), this, SLOT(actionClearBreakpoints())); connect(&fActionClearDeletes, SIGNAL(triggered()), this, SLOT(actionClearDeletes())); connect(&fActionClose, SIGNAL(triggered()), this, SLOT(actionClose())); - connect(&fSettingsWidget, SIGNAL(visibilityFilterChanged()), this, SLOT(actionCommandFilter())); #if SK_SUPPORT_GPU - connect(&fSettingsWidget, SIGNAL(glSettingsChanged()), this, SLOT(actionGLWidget())); + connect(&fSettingsWidget, SIGNAL(glSettingsChanged()), this, SLOT(actionGLSettingsChanged())); #endif + connect(&fSettingsWidget, SIGNAL(rasterSettingsChanged()), this, SLOT(actionRasterSettingsChanged())); + connect(&fSettingsWidget, SIGNAL(visualizationsChanged()), this, SLOT(actionVisualizationsChanged())); connect(&fSettingsWidget, SIGNAL(texFilterSettingsChanged()), this, SLOT(actionTextureFilter())); - connect(fSettingsWidget.getRasterCheckBox(), SIGNAL(toggled(bool)), this, SLOT(actionRasterWidget(bool))); - connect(fSettingsWidget.getOverdrawVizCheckBox(), SIGNAL(toggled(bool)), this, SLOT(actionOverdrawVizWidget(bool))); - connect(fSettingsWidget.getMegaVizCheckBox(), SIGNAL(toggled(bool)), this, SLOT(actionMegaVizWidget(bool))); - connect(fSettingsWidget.getPathOpsCheckBox(), SIGNAL(toggled(bool)), this, SLOT(actionPathOpsWidget(bool))); connect(&fActionPause, SIGNAL(toggled(bool)), this, SLOT(pauseDrawing(bool))); connect(&fActionCreateBreakpoint, SIGNAL(activated()), this, SLOT(toggleBreakpoint())); connect(&fActionShowDeletes, SIGNAL(triggered()), this, SLOT(showDeletes())); connect(&fCanvasWidget, SIGNAL(hitChanged(int)), this, SLOT(selectCommand(int))); - connect(&fCanvasWidget, SIGNAL(hitChanged(int)), &fSettingsWidget, SLOT(updateHit(int))); + connect(&fCanvasWidget, SIGNAL(hitChanged(int)), this, SLOT(updateHit(int))); connect(&fCanvasWidget, SIGNAL(scaleFactorChanged(float)), this, SLOT(actionScale(float))); - connect(&fCanvasWidget, SIGNAL(commandChanged(int)), &fSettingsWidget, SLOT(updateCommand(int))); + connect(&fCanvasWidget, SIGNAL(commandChanged(int)), this, SLOT(updateCommand(int))); connect(&fActionSaveAs, SIGNAL(triggered()), this, SLOT(actionSaveAs())); connect(&fActionSave, SIGNAL(triggered()), this, SLOT(actionSave())); @@ -120,6 +117,7 @@ SkDebuggerGUI::SkDebuggerGUI(QWidget *parent) : connect(&fActionZoomOut, SIGNAL(triggered()), &fMapper, SLOT(map())); connect(&fMapper, SIGNAL(mapped(int)), &fCanvasWidget, SLOT(zoom(int))); + fViewStateFrame.setDisabled(true); fInspectorWidget.setDisabled(true); fMenuEdit.setDisabled(true); fMenuNavigate.setDisabled(true); @@ -241,12 +239,6 @@ void SkDebuggerGUI::actionClearDeletes() { } } -void SkDebuggerGUI::actionCommandFilter() { - fDebugger.highlightCurrentCommand(fSettingsWidget.getVisibilityFilter()); - fCanvasWidget.drawTo(fListWidget.currentRow()); - fImageWidget.draw(); -} - void SkDebuggerGUI::actionClose() { this->close(); } @@ -283,7 +275,7 @@ void SkDebuggerGUI::actionDelete() { } #if SK_SUPPORT_GPU -void SkDebuggerGUI::actionGLWidget() { +void SkDebuggerGUI::actionGLSettingsChanged() { bool isToggled = fSettingsWidget.isGLActive(); if (isToggled) { fCanvasWidget.setGLSampleCount(fSettingsWidget.getGLSampleCount()); @@ -293,13 +285,11 @@ void SkDebuggerGUI::actionGLWidget() { #endif void SkDebuggerGUI::actionInspector() { - if (fInspectorWidget.isHidden()) { - fInspectorWidget.setHidden(false); - fImageWidget.setHidden(false); - } else { - fInspectorWidget.setHidden(true); - fImageWidget.setHidden(true); - } + bool newState = !fInspectorWidget.isHidden(); + + fInspectorWidget.setHidden(newState); + fViewStateFrame.setHidden(newState); + fImageWidget.setHidden(newState); } void SkDebuggerGUI::actionPlay() { @@ -314,23 +304,19 @@ void SkDebuggerGUI::actionPlay() { fListWidget.setCurrentRow(fListWidget.count() - 1); } -void SkDebuggerGUI::actionRasterWidget(bool isToggled) { - fCanvasWidget.setWidgetVisibility(SkCanvasWidget::kRaster_8888_WidgetType, !isToggled); -} - -void SkDebuggerGUI::actionOverdrawVizWidget(bool isToggled) { - fDebugger.setOverdrawViz(isToggled); - fCanvasWidget.update(); -} - -void SkDebuggerGUI::actionMegaVizWidget(bool isToggled) { - fDebugger.setMegaViz(isToggled); +void SkDebuggerGUI::actionRasterSettingsChanged() { + fCanvasWidget.setWidgetVisibility(SkCanvasWidget::kRaster_8888_WidgetType, + !fSettingsWidget.isRasterEnabled()); + fDebugger.setOverdrawViz(fSettingsWidget.isOverdrawVizEnabled()); fCanvasWidget.update(); } -void SkDebuggerGUI::actionPathOpsWidget(bool isToggled) { - fDebugger.setPathOps(isToggled); - fCanvasWidget.update(); +void SkDebuggerGUI::actionVisualizationsChanged() { + fDebugger.setMegaViz(fSettingsWidget.isMegaVizEnabled()); + fDebugger.setPathOps(fSettingsWidget.isPathOpsEnabled()); + fDebugger.highlightCurrentCommand(fSettingsWidget.isVisibilityFilterEnabled()); + fCanvasWidget.drawTo(fListWidget.currentRow()); + fImageWidget.draw(); } void SkDebuggerGUI::actionTextureFilter() { @@ -361,7 +347,7 @@ void SkDebuggerGUI::actionSaveAs() { } void SkDebuggerGUI::actionScale(float scaleFactor) { - fSettingsWidget.setZoomText(scaleFactor); + fZoomBox.setText(QString::number(scaleFactor * 100, 'f', 0).append("%")); } void SkDebuggerGUI::actionSettings() { @@ -458,6 +444,7 @@ void SkDebuggerGUI::registerListClick(QListWidgetItem *item) { } fInspectorWidget.setText(info, SkInspectorWidget::kDetail_TabType); fInspectorWidget.setDisabled(false); + fViewStateFrame.setDisabled(false); } setupClipStackText(); } @@ -632,21 +619,43 @@ void SkDebuggerGUI::setupUi(QMainWindow *SkDebuggerGUI) { QSizePolicy::Expanding); fInspectorWidget.setMaximumHeight(300); - fSettingsAndImageLayout.setSpacing(6); fSettingsAndImageLayout.addWidget(&fSettingsWidget); - fSettingsAndImageLayout.addWidget(&fImageWidget); - fSettingsWidget.setSizePolicy(QSizePolicy::Expanding, - QSizePolicy::Expanding); - fSettingsWidget.setMaximumWidth(250); + // View state group, part of inspector. + fViewStateFrame.setFrameStyle(QFrame::Panel); + fViewStateFrame.setLayout(&fViewStateFrameLayout); + fViewStateFrameLayout.addWidget(&fViewStateGroup); + fViewStateGroup.setTitle("View"); + fViewStateLayout.addRow("Zoom Level", &fZoomBox); + fZoomBox.setText("100%"); + fZoomBox.setMinimumSize(QSize(50,25)); + fZoomBox.setMaximumSize(QSize(50,25)); + fZoomBox.setAlignment(Qt::AlignRight); + fZoomBox.setReadOnly(true); + fViewStateLayout.addRow("Command HitBox", &fCommandHitBox); + fCommandHitBox.setText("0"); + fCommandHitBox.setMinimumSize(QSize(50,25)); + fCommandHitBox.setMaximumSize(QSize(50,25)); + fCommandHitBox.setAlignment(Qt::AlignRight); + fCommandHitBox.setReadOnly(true); + fViewStateLayout.addRow("Current Command", &fCurrentCommandBox); + fCurrentCommandBox.setText("0"); + fCurrentCommandBox.setMinimumSize(QSize(50,25)); + fCurrentCommandBox.setMaximumSize(QSize(50,25)); + fCurrentCommandBox.setAlignment(Qt::AlignRight); + fCurrentCommandBox.setReadOnly(true); + fViewStateGroup.setLayout(&fViewStateLayout); + fSettingsAndImageLayout.addWidget(&fViewStateFrame); + + fSettingsAndImageLayout.addWidget(&fImageWidget); fLeftColumnSplitter.addWidget(&fListWidget); fLeftColumnSplitter.addWidget(&fDirectoryWidget); fLeftColumnSplitter.setOrientation(Qt::Vertical); fCanvasSettingsAndImageLayout.setSpacing(6); - fCanvasSettingsAndImageLayout.addWidget(&fCanvasWidget); - fCanvasSettingsAndImageLayout.addLayout(&fSettingsAndImageLayout); + fCanvasSettingsAndImageLayout.addWidget(&fCanvasWidget, 1); + fCanvasSettingsAndImageLayout.addLayout(&fSettingsAndImageLayout, 0); fMainAndRightColumnLayout.setSpacing(6); fMainAndRightColumnLayout.addLayout(&fCanvasSettingsAndImageLayout); @@ -780,12 +789,13 @@ void SkDebuggerGUI::loadPicture(const SkString& fileName) { * TODO(chudy): This should be deprecated since fDebugger is not * recreated. * */ - fDebugger.highlightCurrentCommand(fSettingsWidget.getVisibilityFilter()); + fDebugger.highlightCurrentCommand(fSettingsWidget.isVisibilityFilterEnabled()); this->setupListWidget(); this->setupComboBox(); this->setupOverviewText(NULL, 0.0, 1); fInspectorWidget.setDisabled(false); + fViewStateFrame.setDisabled(false); fSettingsWidget.setDisabled(false); fMenuEdit.setDisabled(false); fMenuNavigate.setDisabled(false); @@ -863,3 +873,12 @@ void SkDebuggerGUI::setupComboBox() { QStandardItem* firstItem = model->itemFromIndex(firstIndex); firstItem->setSelectable(false); } + +void SkDebuggerGUI::updateCommand(int newCommand) { + fCurrentCommandBox.setText(QString::number(newCommand)); +} + +void SkDebuggerGUI::updateHit(int newHit) { + fCommandHitBox.setText(QString::number(newHit)); +} + diff --git a/debugger/QT/SkDebuggerGUI.h b/debugger/QT/SkDebuggerGUI.h index 2a514baef1..b07f37a8a3 100644 --- a/debugger/QT/SkDebuggerGUI.h +++ b/debugger/QT/SkDebuggerGUI.h @@ -104,11 +104,6 @@ private slots: void actionClearDeletes(); /** - Applies a visible filter to all drawing commands other than the previous. - */ - void actionCommandFilter(); - - /** Closes the application. */ void actionClose(); @@ -122,7 +117,7 @@ private slots: /** Updates the visibility of the GL canvas widget and sample count of the GL surface. */ - void actionGLWidget(); + void actionGLSettingsChanged(); #endif /** @@ -137,24 +132,14 @@ private slots: void actionPlay(); /** - Toggles the visibility of the raster canvas widget. - */ - void actionRasterWidget(bool isToggled); - - /** - Toggles the the overdraw visualization on and off + Sets the visibility of the raster canvas widget according to the settings widget. */ - void actionOverdrawVizWidget(bool isToggled); + void actionRasterSettingsChanged(); /** - Toggles the the mega visualization on and off + Sets the visualization settings according to the settings widget. */ - void actionMegaVizWidget(bool isToggled); - - /** - Toggles using path ops to simplify the clip stack - */ - void actionPathOpsWidget(bool ); + void actionVisualizationsChanged(); /** Applies the new texture filter override @@ -249,6 +234,8 @@ private slots: */ void toggleFilter(QString string); + void updateCommand(int newCommand); + void updateHit(int newHit); private: QSplitter fCentralSplitter; QStatusBar fStatusBar; @@ -298,6 +285,14 @@ private: SkInspectorWidget fInspectorWidget; SkSettingsWidget fSettingsWidget; + QFrame fViewStateFrame; + QVBoxLayout fViewStateFrameLayout; + QGroupBox fViewStateGroup; + QFormLayout fViewStateLayout; + QLineEdit fCurrentCommandBox; + QLineEdit fCommandHitBox; + QLineEdit fZoomBox; + QString fPath; SkString fFileName; SkTDArray<bool> fSkipCommands; // has a specific command been deleted? diff --git a/debugger/QT/SkSettingsWidget.cpp b/debugger/QT/SkSettingsWidget.cpp index dc9dc6e45c..90e358b7c3 100644 --- a/debugger/QT/SkSettingsWidget.cpp +++ b/debugger/QT/SkSettingsWidget.cpp @@ -12,206 +12,66 @@ #include <math.h> // TODO(chudy): See if the layout can't be attached to the frame post construction. -SkSettingsWidget::SkSettingsWidget() : QWidget() - , mainFrameLayout(this) - , fVerticalLayout(&mainFrame) - , fVisibleFrameLayout(&fVisibleFrame) - , fCommandLayout(&fCommandFrame) - , fCurrentCommandBox(&fCommandFrame) - , fCommandHitBox(&fCommandFrame) - , fCanvasLayout(&fCanvasFrame) - , fZoomLayout(&fZoomFrame) - , fZoomBox(&fZoomFrame) +SkSettingsWidget::SkSettingsWidget() : QFrame() { - // Sets up the container and it's alignment around the settings widget. - mainFrame.setFrameShape(QFrame::StyledPanel); - mainFrame.setFrameShadow(QFrame::Raised); - mainFrameLayout.setSpacing(6); - mainFrameLayout.setContentsMargins(0,0,0,0); - mainFrameLayout.addWidget(&mainFrame); - + this->setLayout(&fVerticalLayout); + this->setFrameStyle(QFrame::Panel); // Vertical Layout is the alignment inside of the main frame. - fVerticalLayout.setContentsMargins(11,11,11,11); fVerticalLayout.setAlignment(Qt::AlignTop); - // Visible Toggle - fVisibleText.setText("Visibility Filter"); - fVisibleFrame.setFrameShape(QFrame::StyledPanel); - fVisibleFrame.setFrameShadow(QFrame::Raised); - - fVisibilityCombo.addItem("Off", QVariant(false)); - fVisibilityCombo.addItem("On", QVariant(true)); - - fVisibleFrameLayout.setContentsMargins(11, 5, 11, 5); - fVisibleFrameLayout.addWidget(&fVisibilityCombo); - connect(&fVisibilityCombo, SIGNAL(activated(int)), this, - SIGNAL(visibilityFilterChanged())); - - // Canvas - fCanvasToggle.setText("Render Targets"); - fCanvasFrame.setFrameShape(QFrame::StyledPanel); - fCanvasFrame.setFrameShadow(QFrame::Raised); - - fRasterLabel.setText("Raster: "); - fRasterLabel.setMinimumWidth(178); - fRasterLabel.setMaximumWidth(178); - - fPathOpsLabel.setText("PathOps: "); - fPathOpsLabel.setMinimumWidth(178); - fPathOpsLabel.setMaximumWidth(178); - - fRasterCheckBox.setChecked(true); - - fOverdrawVizLabel.setText(" Overdraw Viz: "); - fOverdrawVizLabel.setMinimumWidth(178); - fOverdrawVizLabel.setMaximumWidth(178); - - fMegaVizLabel.setText(" Mega Viz: "); - fMegaVizLabel.setMinimumWidth(178); - fMegaVizLabel.setMaximumWidth(178); + // Visualizations toggles. + fVisualizationsGroup.setTitle("Visualizations"); + fVisibilityFilterCheckBox.setText("Visibility Filter"); + fVisualizationsLayout.addWidget(&fVisibilityFilterCheckBox); + fMegaVizCheckBox.setText("Mega Viz"); + fVisualizationsLayout.addWidget(&fMegaVizCheckBox); + fPathOpsCheckBox.setText("PathOps "); + fVisualizationsLayout.addWidget(&fPathOpsCheckBox); + fVisualizationsGroup.setLayout(&fVisualizationsLayout); + connect(&fVisibilityFilterCheckBox, SIGNAL(toggled(bool)), this, + SIGNAL(visualizationsChanged())); + connect(&fMegaVizCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(visualizationsChanged())); + connect(&fPathOpsCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(visualizationsChanged())); + + fVerticalLayout.addRow(&fVisualizationsGroup); + + // Raster toggles. + fRasterGroup.setTitle("Raster"); + fRasterGroup.setCheckable(true); + fOverdrawVizCheckBox.setText("Overdraw Viz"); + fRasterLayout.addWidget(&fOverdrawVizCheckBox); + fRasterGroup.setLayout(&fRasterLayout); + fVerticalLayout.addRow(&fRasterGroup); + + connect(&fRasterGroup, SIGNAL(toggled(bool)), this, SIGNAL(rasterSettingsChanged())); + connect(&fOverdrawVizCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(rasterSettingsChanged())); #if SK_SUPPORT_GPU - fGLLabel.setText("OpenGL: "); - fGLLabel.setMinimumWidth(178); - fGLLabel.setMaximumWidth(178); - - fGLMSAAButtonGroup.setTitle("MSAA"); - fGLMSAAButtonGroup.setMinimumWidth(178); - fGLMSAAButtonGroup.setMaximumWidth(178); - fGLMSAAButtonGroup.setEnabled(fGLCheckBox.isChecked()); - + fGLGroup.setTitle("OpenGL"); + fGLGroup.setCheckable(true); + fGLGroup.setChecked(false); fGLMSAACombo.addItem("Off", QVariant(0)); fGLMSAACombo.addItem("4", QVariant(4)); fGLMSAACombo.addItem("16", QVariant(16)); + fGLLayout.addRow("MSAA", &fGLMSAACombo); + fGLGroup.setLayout(&fGLLayout); - fGLMSAALayout.addWidget(&fGLMSAACombo); - fGLMSAAButtonGroup.setLayout(&fGLMSAALayout); - - connect(&fGLCheckBox, SIGNAL(toggled(bool)), &fGLMSAAButtonGroup, - SLOT(setEnabled(bool))); - connect(&fGLCheckBox, SIGNAL(toggled(bool)), this, + connect(&fGLGroup, SIGNAL(toggled(bool)), this, SIGNAL(glSettingsChanged())); connect(&fGLMSAACombo, SIGNAL(activated(int)), this, SIGNAL(glSettingsChanged())); -#endif - - { - // set up filter buttons - fFilterButtonGroup.setTitle("Filtering"); - fFilterButtonGroup.setMinimumWidth(178); - fFilterButtonGroup.setMaximumWidth(178); - - fFilterCombo.addItem("As encoded", QVariant(SkPaint::kNone_FilterLevel)); - fFilterCombo.addItem("None", QVariant(SkPaint::kNone_FilterLevel)); - fFilterCombo.addItem("Low", QVariant(SkPaint::kLow_FilterLevel)); - fFilterCombo.addItem("Medium", QVariant(SkPaint::kMedium_FilterLevel)); - fFilterCombo.addItem("High", QVariant(SkPaint::kHigh_FilterLevel)); - - fFilterLayout.addWidget(&fFilterCombo); - fFilterButtonGroup.setLayout(&fFilterLayout); - - connect(&fFilterCombo, SIGNAL(activated(int)), this, - SIGNAL(texFilterSettingsChanged())); - } - - fRasterLayout.addWidget(&fRasterLabel); - fRasterLayout.addWidget(&fRasterCheckBox); - fRasterLayout.addWidget(&fPathOpsLabel); - fRasterLayout.addWidget(&fPathOpsCheckBox); - fVizLayout.addWidget(&fOverdrawVizLabel); - fVizLayout.addWidget(&fOverdrawVizCheckBox); - fVizLayout.addWidget(&fMegaVizLabel); - fVizLayout.addWidget(&fMegaVizCheckBox); - -#if SK_SUPPORT_GPU - fGLLayout.addWidget(&fGLLabel); - fGLLayout.addWidget(&fGLCheckBox); -#endif - - fCanvasLayout.setSpacing(6); - fCanvasLayout.setContentsMargins(11,11,11,11); - fCanvasLayout.addLayout(&fRasterLayout); - fCanvasLayout.addLayout(&fVizLayout); -#if SK_SUPPORT_GPU - fCanvasLayout.addLayout(&fGLLayout); - fCanvasLayout.addWidget(&fGLMSAAButtonGroup); + fVerticalLayout.addRow(&fGLGroup); #endif - fCanvasLayout.addWidget(&fFilterButtonGroup); - - // Command Toggle - fCommandToggle.setText("Command Scrolling Preferences"); - fCommandFrame.setFrameShape(QFrame::StyledPanel); - fCommandFrame.setFrameShadow(QFrame::Raised); - - fCurrentCommandLabel.setText("Current Command: "); - fCurrentCommandLabel.setMinimumWidth(178); - fCurrentCommandLabel.setMaximumWidth(178); - fCurrentCommandBox.setText("0"); - fCurrentCommandBox.setMinimumSize(QSize(50,25)); - fCurrentCommandBox.setMaximumSize(QSize(50,25)); - fCurrentCommandBox.setAlignment(Qt::AlignRight); - - fCurrentCommandLayout.setSpacing(0); - fCurrentCommandLayout.setContentsMargins(0,0,0,0); - fCurrentCommandLayout.setAlignment(Qt::AlignLeft); - fCurrentCommandLayout.addWidget(&fCurrentCommandLabel); - fCurrentCommandLayout.addWidget(&fCurrentCommandBox); - - fCommandHitLabel.setText("Command HitBox: "); - fCommandHitLabel.setMinimumWidth(178); - fCommandHitLabel.setMaximumWidth(178); - fCommandHitBox.setText("0"); - fCommandHitBox.setMinimumSize(QSize(50,25)); - fCommandHitBox.setMaximumSize(QSize(50,25)); - fCommandHitBox.setAlignment(Qt::AlignRight); - fCommandHitLayout.setSpacing(0); - fCommandHitLayout.setContentsMargins(0,0,0,0); - fCommandHitLayout.setAlignment(Qt::AlignLeft); - fCommandHitLayout.addWidget(&fCommandHitLabel); - fCommandHitLayout.addWidget(&fCommandHitBox); - fCommandLayout.setSpacing(6); - fCommandLayout.setContentsMargins(11,11,11,11); - fCommandLayout.addLayout(&fCurrentCommandLayout); - fCommandLayout.addLayout(&fCommandHitLayout); - - // Zoom Info - fZoomSetting.setText("Zoom Level: "); - fZoomSetting.setMinimumWidth(178); - fZoomSetting.setMaximumWidth(178); - fZoomFrame.setFrameShape(QFrame::StyledPanel); - fZoomFrame.setFrameShadow(QFrame::Raised); - fZoomBox.setText("100%"); - fZoomBox.setMinimumSize(QSize(50,25)); - fZoomBox.setMaximumSize(QSize(50,25)); - fZoomBox.setAlignment(Qt::AlignRight); - fZoomLayout.setSpacing(6); - fZoomLayout.setContentsMargins(11,11,11,11); - fZoomLayout.addWidget(&fZoomSetting); - fZoomLayout.addWidget(&fZoomBox); - - // Adds all widgets to settings container - fVerticalLayout.addWidget(&fVisibleText); - fVerticalLayout.addWidget(&fVisibleFrame); - fVerticalLayout.addWidget(&fCommandToggle); - fVerticalLayout.addWidget(&fCommandFrame); - fVerticalLayout.addWidget(&fCanvasToggle); - fVerticalLayout.addWidget(&fCanvasFrame); - fVerticalLayout.addWidget(&fZoomFrame); + fFilterCombo.addItem("As encoded", QVariant(SkPaint::kNone_FilterLevel)); + fFilterCombo.addItem("None", QVariant(SkPaint::kNone_FilterLevel)); + fFilterCombo.addItem("Low", QVariant(SkPaint::kLow_FilterLevel)); + fFilterCombo.addItem("Medium", QVariant(SkPaint::kMedium_FilterLevel)); + fFilterCombo.addItem("High", QVariant(SkPaint::kHigh_FilterLevel)); + connect(&fFilterCombo, SIGNAL(activated(int)), this, SIGNAL(texFilterSettingsChanged())); + fVerticalLayout.addRow("Filtering", &fFilterCombo); this->setDisabled(true); } - -void SkSettingsWidget::updateCommand(int newCommand) { - fCurrentCommandBox.setText(QString::number(newCommand)); -} - -void SkSettingsWidget::updateHit(int newHit) { - fCommandHitBox.setText(QString::number(newHit)); -} - -void SkSettingsWidget::setZoomText(float scale) { - fZoomBox.setText(QString::number(scale*100, 'f', 0).append("%")); -} diff --git a/debugger/QT/SkSettingsWidget.h b/debugger/QT/SkSettingsWidget.h index f35df94010..70e8965341 100644 --- a/debugger/QT/SkSettingsWidget.h +++ b/debugger/QT/SkSettingsWidget.h @@ -19,15 +19,16 @@ #include <QCheckBox> #include <QLineEdit> #include <QComboBox> +#include <QFormLayout> #include "SkPaint.h" /** \class SkSettingsWidget The SettingsWidget contains multiple checkboxes and toggles for altering - the visibility. + the visualizations. */ -class SkSettingsWidget : public QWidget { +class SkSettingsWidget : public QFrame { Q_OBJECT public: @@ -37,16 +38,11 @@ public: */ SkSettingsWidget(); - /** Sets the displayed user zoom level. A scale of 1.0 represents no zoom. */ - void setZoomText(float scale); - - bool getVisibilityFilter() const { - return fVisibilityCombo.itemData(fVisibilityCombo.currentIndex()).toBool(); - } #if SK_SUPPORT_GPU + // GL settings. bool isGLActive() const { - return fGLCheckBox.isChecked(); + return fGLGroup.isChecked(); } int getGLSampleCount() const { @@ -62,91 +58,59 @@ public: return index > 0; } - QCheckBox* getRasterCheckBox() { - return &fRasterCheckBox; + + // Raster settings. + bool isRasterEnabled() { + return fRasterGroup.isChecked(); + } + + bool isOverdrawVizEnabled() { + return fOverdrawVizCheckBox.isChecked(); } - QCheckBox* getOverdrawVizCheckBox() { - return &fOverdrawVizCheckBox; + // Visualizations. + bool isVisibilityFilterEnabled() const { + return fVisibilityFilterCheckBox.isChecked(); } - QCheckBox* getMegaVizCheckBox() { - return &fMegaVizCheckBox; + bool isMegaVizEnabled() { + return fMegaVizCheckBox.isChecked(); } - QCheckBox* getPathOpsCheckBox() { - return &fPathOpsCheckBox; + bool isPathOpsEnabled() { + return fPathOpsCheckBox.isChecked(); } private slots: - void updateCommand(int newCommand); - void updateHit(int newHit); signals: - void scrollingPreferences(bool isStickyActivate); - void showStyle(bool isSingleCommand); - void visibilityFilterChanged(); + void visualizationsChanged(); void texFilterSettingsChanged(); #if SK_SUPPORT_GPU void glSettingsChanged(); #endif + void rasterSettingsChanged(); private: - QVBoxLayout mainFrameLayout; - QFrame mainFrame; - QVBoxLayout fVerticalLayout; - - QLabel fVisibleText; - QFrame fVisibleFrame; - QVBoxLayout fVisibleFrameLayout; - QComboBox fVisibilityCombo; + QFormLayout fVerticalLayout; - QLabel fCommandToggle; - QFrame fCommandFrame; - QVBoxLayout fCommandLayout; + QGroupBox fVisualizationsGroup; + QVBoxLayout fVisualizationsLayout; + QCheckBox fVisibilityFilterCheckBox; - QHBoxLayout fCurrentCommandLayout; - QLabel fCurrentCommandLabel; - QLineEdit fCurrentCommandBox; - - QHBoxLayout fCommandHitLayout; - QLabel fCommandHitLabel; - QLineEdit fCommandHitBox; - - QFrame fCanvasFrame; - QVBoxLayout fCanvasLayout; - QLabel fCanvasToggle; - - QHBoxLayout fRasterLayout; - QLabel fRasterLabel; - QCheckBox fRasterCheckBox; - - QHBoxLayout fVizLayout; - QLabel fOverdrawVizLabel; + QGroupBox fRasterGroup; + QVBoxLayout fRasterLayout; QCheckBox fOverdrawVizCheckBox; - QLabel fMegaVizLabel; QCheckBox fMegaVizCheckBox; - QLabel fPathOpsLabel; QCheckBox fPathOpsCheckBox; #if SK_SUPPORT_GPU - QHBoxLayout fGLLayout; - QLabel fGLLabel; - QCheckBox fGLCheckBox; - QGroupBox fGLMSAAButtonGroup; - QVBoxLayout fGLMSAALayout; + QGroupBox fGLGroup; + QFormLayout fGLLayout; QComboBox fGLMSAACombo; #endif - // for filtering group - QGroupBox fFilterButtonGroup; QComboBox fFilterCombo; - QVBoxLayout fFilterLayout; - - QFrame fZoomFrame; - QHBoxLayout fZoomLayout; - QLabel fZoomSetting; - QLineEdit fZoomBox; }; #endif /* SKSETTINGSWIDGET_H_ */ |