chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 1 | |
| 2 | /* |
| 3 | * Copyright 2012 Google Inc. |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
| 7 | */ |
| 8 | |
| 9 | |
| 10 | #include "SkSettingsWidget.h" |
chudy@google.com | 7dcae67 | 2012-07-09 20:26:53 +0000 | [diff] [blame] | 11 | #include <iostream> |
| 12 | #include <math.h> |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 13 | |
chudy@google.com | ea5488b | 2012-07-26 19:38:22 +0000 | [diff] [blame] | 14 | // TODO(chudy): See if the layout can't be attached to the frame post construction. |
kkinnunen | 41c79cc | 2014-12-30 22:49:58 -0800 | [diff] [blame] | 15 | SkSettingsWidget::SkSettingsWidget() : QFrame() |
chudy@google.com | 7dcae67 | 2012-07-09 20:26:53 +0000 | [diff] [blame] | 16 | { |
kkinnunen | 41c79cc | 2014-12-30 22:49:58 -0800 | [diff] [blame] | 17 | this->setLayout(&fVerticalLayout); |
| 18 | this->setFrameStyle(QFrame::Panel); |
chudy@google.com | 7dcae67 | 2012-07-09 20:26:53 +0000 | [diff] [blame] | 19 | // Vertical Layout is the alignment inside of the main frame. |
chudy@google.com | 7dcae67 | 2012-07-09 20:26:53 +0000 | [diff] [blame] | 20 | fVerticalLayout.setAlignment(Qt::AlignTop); |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 21 | |
kkinnunen | 41c79cc | 2014-12-30 22:49:58 -0800 | [diff] [blame] | 22 | // Visualizations toggles. |
| 23 | fVisualizationsGroup.setTitle("Visualizations"); |
| 24 | fVisibilityFilterCheckBox.setText("Visibility Filter"); |
| 25 | fVisualizationsLayout.addWidget(&fVisibilityFilterCheckBox); |
| 26 | fMegaVizCheckBox.setText("Mega Viz"); |
| 27 | fVisualizationsLayout.addWidget(&fMegaVizCheckBox); |
| 28 | fPathOpsCheckBox.setText("PathOps "); |
| 29 | fVisualizationsLayout.addWidget(&fPathOpsCheckBox); |
| 30 | fVisualizationsGroup.setLayout(&fVisualizationsLayout); |
| 31 | connect(&fVisibilityFilterCheckBox, SIGNAL(toggled(bool)), this, |
| 32 | SIGNAL(visualizationsChanged())); |
| 33 | connect(&fMegaVizCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(visualizationsChanged())); |
| 34 | connect(&fPathOpsCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(visualizationsChanged())); |
commit-bot@chromium.org | 22d3933 | 2013-11-21 15:37:29 +0000 | [diff] [blame] | 35 | |
kkinnunen | 41c79cc | 2014-12-30 22:49:58 -0800 | [diff] [blame] | 36 | fVerticalLayout.addRow(&fVisualizationsGroup); |
commit-bot@chromium.org | 22d3933 | 2013-11-21 15:37:29 +0000 | [diff] [blame] | 37 | |
kkinnunen | 41c79cc | 2014-12-30 22:49:58 -0800 | [diff] [blame] | 38 | // Raster toggles. |
| 39 | fRasterGroup.setTitle("Raster"); |
| 40 | fRasterGroup.setCheckable(true); |
| 41 | fOverdrawVizCheckBox.setText("Overdraw Viz"); |
| 42 | fRasterLayout.addWidget(&fOverdrawVizCheckBox); |
| 43 | fRasterGroup.setLayout(&fRasterLayout); |
| 44 | fVerticalLayout.addRow(&fRasterGroup); |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 45 | |
kkinnunen | 41c79cc | 2014-12-30 22:49:58 -0800 | [diff] [blame] | 46 | connect(&fRasterGroup, SIGNAL(toggled(bool)), this, SIGNAL(rasterSettingsChanged())); |
| 47 | connect(&fOverdrawVizCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(rasterSettingsChanged())); |
commit-bot@chromium.org | 768ac85 | 2014-03-03 16:32:17 +0000 | [diff] [blame] | 48 | |
robertphillips@google.com | e8fe4bc | 2013-02-13 13:26:13 +0000 | [diff] [blame] | 49 | #if SK_SUPPORT_GPU |
kkinnunen | 41c79cc | 2014-12-30 22:49:58 -0800 | [diff] [blame] | 50 | fGLGroup.setTitle("OpenGL"); |
| 51 | fGLGroup.setCheckable(true); |
| 52 | fGLGroup.setChecked(false); |
commit-bot@chromium.org | 22d3933 | 2013-11-21 15:37:29 +0000 | [diff] [blame] | 53 | fGLMSAACombo.addItem("Off", QVariant(0)); |
| 54 | fGLMSAACombo.addItem("4", QVariant(4)); |
| 55 | fGLMSAACombo.addItem("16", QVariant(16)); |
kkinnunen | 41c79cc | 2014-12-30 22:49:58 -0800 | [diff] [blame] | 56 | fGLLayout.addRow("MSAA", &fGLMSAACombo); |
| 57 | fGLGroup.setLayout(&fGLLayout); |
commit-bot@chromium.org | fde1e7c | 2013-08-02 13:59:50 +0000 | [diff] [blame] | 58 | |
kkinnunen | 41c79cc | 2014-12-30 22:49:58 -0800 | [diff] [blame] | 59 | connect(&fGLGroup, SIGNAL(toggled(bool)), this, |
commit-bot@chromium.org | 22d3933 | 2013-11-21 15:37:29 +0000 | [diff] [blame] | 60 | SIGNAL(glSettingsChanged())); |
| 61 | connect(&fGLMSAACombo, SIGNAL(activated(int)), this, |
| 62 | SIGNAL(glSettingsChanged())); |
kkinnunen | 41c79cc | 2014-12-30 22:49:58 -0800 | [diff] [blame] | 63 | |
| 64 | fVerticalLayout.addRow(&fGLGroup); |
robertphillips@google.com | e8fe4bc | 2013-02-13 13:26:13 +0000 | [diff] [blame] | 65 | #endif |
chudy@google.com | ea5488b | 2012-07-26 19:38:22 +0000 | [diff] [blame] | 66 | |
reed | 93a1215 | 2015-03-16 10:08:34 -0700 | [diff] [blame] | 67 | fFilterCombo.addItem("As encoded", QVariant(kNone_SkFilterQuality)); |
| 68 | fFilterCombo.addItem("None", QVariant(kNone_SkFilterQuality)); |
| 69 | fFilterCombo.addItem("Low", QVariant(kLow_SkFilterQuality)); |
| 70 | fFilterCombo.addItem("Medium", QVariant(kMedium_SkFilterQuality)); |
| 71 | fFilterCombo.addItem("High", QVariant(kHigh_SkFilterQuality)); |
kkinnunen | 41c79cc | 2014-12-30 22:49:58 -0800 | [diff] [blame] | 72 | connect(&fFilterCombo, SIGNAL(activated(int)), this, SIGNAL(texFilterSettingsChanged())); |
robertphillips@google.com | 32bbcf8 | 2013-10-17 17:56:10 +0000 | [diff] [blame] | 73 | |
kkinnunen | 41c79cc | 2014-12-30 22:49:58 -0800 | [diff] [blame] | 74 | fVerticalLayout.addRow("Filtering", &fFilterCombo); |
chudy@google.com | e606d6e | 2012-07-12 14:31:25 +0000 | [diff] [blame] | 75 | this->setDisabled(true); |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 76 | } |
| 77 | |