diff options
author | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-10-17 17:56:10 +0000 |
---|---|---|
committer | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-10-17 17:56:10 +0000 |
commit | 32bbcf828d66ad244fa25b468bc3a229e531491f (patch) | |
tree | a06033b7e1f2ad4799c587c9553659655cb485e1 /debugger/QT | |
parent | c2cc1dbe818c8a5a699fbe18c4fc79b9d93daa94 (diff) |
Add texture filtering override to debugger
https://codereview.chromium.org/27716003/
git-svn-id: http://skia.googlecode.com/svn/trunk@11846 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'debugger/QT')
-rw-r--r-- | debugger/QT/SkDebuggerGUI.cpp | 8 | ||||
-rw-r--r-- | debugger/QT/SkDebuggerGUI.h | 5 | ||||
-rw-r--r-- | debugger/QT/SkSettingsWidget.cpp | 29 | ||||
-rw-r--r-- | debugger/QT/SkSettingsWidget.h | 31 |
4 files changed, 73 insertions, 0 deletions
diff --git a/debugger/QT/SkDebuggerGUI.cpp b/debugger/QT/SkDebuggerGUI.cpp index 4383f65771..fad5c0cd55 100644 --- a/debugger/QT/SkDebuggerGUI.cpp +++ b/debugger/QT/SkDebuggerGUI.cpp @@ -94,6 +94,7 @@ SkDebuggerGUI::SkDebuggerGUI(QWidget *parent) : #if SK_SUPPORT_GPU connect(&fSettingsWidget, SIGNAL(glSettingsChanged()), this, SLOT(actionGLWidget())); #endif + 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(&fActionPause, SIGNAL(toggled(bool)), this, SLOT(pauseDrawing(bool))); @@ -521,6 +522,13 @@ void SkDebuggerGUI::actionOverdrawVizWidget(bool isToggled) { fCanvasWidget.update(); } +void SkDebuggerGUI::actionTextureFilter() { + SkPaint::FilterLevel level; + bool enabled = fSettingsWidget.getFilterOverride(&level); + fDebugger.setTexFilterOverride(enabled, level); + fCanvasWidget.update(); +} + void SkDebuggerGUI::actionRewind() { fListWidget.setCurrentRow(0); } diff --git a/debugger/QT/SkDebuggerGUI.h b/debugger/QT/SkDebuggerGUI.h index 13ec181c27..a478428505 100644 --- a/debugger/QT/SkDebuggerGUI.h +++ b/debugger/QT/SkDebuggerGUI.h @@ -141,6 +141,11 @@ private slots: void actionOverdrawVizWidget(bool isToggled); /** + Applies the new texture filter override + */ + void actionTextureFilter(); + + /** Rewinds from the current step back to the start of the commands. */ void actionRewind(); diff --git a/debugger/QT/SkSettingsWidget.cpp b/debugger/QT/SkSettingsWidget.cpp index fa619eafe5..ca0436e182 100644 --- a/debugger/QT/SkSettingsWidget.cpp +++ b/debugger/QT/SkSettingsWidget.cpp @@ -91,6 +91,34 @@ SkSettingsWidget::SkSettingsWidget() : QWidget() connect(&fGLMSAA16On, SIGNAL(toggled(bool)), this, SIGNAL(glSettingsChanged())); #endif + { + // set up filter buttons + fFilterButtonGroup.setTitle("Filtering"); + fFilterButtonGroup.setMinimumWidth(178); + fFilterButtonGroup.setMaximumWidth(178); + + fFilterDefault.setText("As encoded"); + fFilterDefault.setChecked(true); + fFilterNone.setText("None"); + fFilterLow.setText("Low"); + fFilterMed.setText("Med"); + fFilterHigh.setText("High"); + + fFilterLayout.addWidget(&fFilterDefault); + fFilterLayout.addWidget(&fFilterNone); + fFilterLayout.addWidget(&fFilterLow); + fFilterLayout.addWidget(&fFilterMed); + fFilterLayout.addWidget(&fFilterHigh); + + fFilterButtonGroup.setLayout(&fFilterLayout); + + connect(&fFilterDefault, SIGNAL(toggled(bool)), this, SIGNAL(texFilterSettingsChanged())); + connect(&fFilterNone, SIGNAL(toggled(bool)), this, SIGNAL(texFilterSettingsChanged())); + connect(&fFilterLow, SIGNAL(toggled(bool)), this, SIGNAL(texFilterSettingsChanged())); + connect(&fFilterMed, SIGNAL(toggled(bool)), this, SIGNAL(texFilterSettingsChanged())); + connect(&fFilterHigh, SIGNAL(toggled(bool)), this, SIGNAL(texFilterSettingsChanged())); + } + fRasterLayout.addWidget(&fRasterLabel); fRasterLayout.addWidget(&fRasterCheckBox); @@ -110,6 +138,7 @@ SkSettingsWidget::SkSettingsWidget() : QWidget() fCanvasLayout.addLayout(&fGLLayout); fCanvasLayout.addWidget(&fGLMSAAButtonGroup); #endif + fCanvasLayout.addWidget(&fFilterButtonGroup); // Command Toggle fCommandToggle.setText("Command Scrolling Preferences"); diff --git a/debugger/QT/SkSettingsWidget.h b/debugger/QT/SkSettingsWidget.h index e5662ee875..fc8fda7c6e 100644 --- a/debugger/QT/SkSettingsWidget.h +++ b/debugger/QT/SkSettingsWidget.h @@ -20,6 +20,8 @@ #include <QCheckBox> #include <QLineEdit> +#include "SkPaint.h" + /** \class SkSettingsWidget The SettingsWidget contains multiple checkboxes and toggles for altering @@ -56,6 +58,25 @@ public: #endif + bool getFilterOverride(SkPaint::FilterLevel* filterLevel) { + if (fFilterDefault.isChecked()) { + *filterLevel = SkPaint::kNone_FilterLevel; + return false; + } + + if (fFilterNone.isChecked()) { + *filterLevel = SkPaint::kNone_FilterLevel; + } else if (fFilterLow.isChecked()) { + *filterLevel = SkPaint::kLow_FilterLevel; + } else if (fFilterMed.isChecked()) { + *filterLevel = SkPaint::kMedium_FilterLevel; + } else { + *filterLevel = SkPaint::kHigh_FilterLevel; + } + + return true; + } + QCheckBox* getRasterCheckBox() { return &fRasterCheckBox; } @@ -72,6 +93,7 @@ signals: void scrollingPreferences(bool isStickyActivate); void showStyle(bool isSingleCommand); void visibilityFilter(bool isEnabled); + void texFilterSettingsChanged(); #if SK_SUPPORT_GPU void glSettingsChanged(); #endif @@ -122,6 +144,15 @@ private: QRadioButton fGLMSAA16On; #endif + // for filtering group + QGroupBox fFilterButtonGroup; + QVBoxLayout fFilterLayout; + QRadioButton fFilterDefault; + QRadioButton fFilterNone; + QRadioButton fFilterLow; + QRadioButton fFilterMed; + QRadioButton fFilterHigh; + QFrame fZoomFrame; QHBoxLayout fZoomLayout; QLabel fZoomSetting; |