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"); |
robertphillips | f42fca4 | 2016-01-27 05:00:04 -0800 | [diff] [blame] | 24 | |
kkinnunen | 41c79cc | 2014-12-30 22:49:58 -0800 | [diff] [blame] | 25 | fVisibilityFilterCheckBox.setText("Visibility Filter"); |
| 26 | fVisualizationsLayout.addWidget(&fVisibilityFilterCheckBox); |
robertphillips | f42fca4 | 2016-01-27 05:00:04 -0800 | [diff] [blame] | 27 | |
kkinnunen | 41c79cc | 2014-12-30 22:49:58 -0800 | [diff] [blame] | 28 | fMegaVizCheckBox.setText("Mega Viz"); |
| 29 | fVisualizationsLayout.addWidget(&fMegaVizCheckBox); |
robertphillips | f42fca4 | 2016-01-27 05:00:04 -0800 | [diff] [blame] | 30 | |
kkinnunen | 41c79cc | 2014-12-30 22:49:58 -0800 | [diff] [blame] | 31 | fPathOpsCheckBox.setText("PathOps "); |
| 32 | fVisualizationsLayout.addWidget(&fPathOpsCheckBox); |
robertphillips | f42fca4 | 2016-01-27 05:00:04 -0800 | [diff] [blame] | 33 | |
| 34 | fOverdrawVizCheckBox.setText("Overdraw Viz"); |
| 35 | fVisualizationsLayout.addWidget(&fOverdrawVizCheckBox); |
| 36 | |
kkinnunen | 41c79cc | 2014-12-30 22:49:58 -0800 | [diff] [blame] | 37 | fVisualizationsGroup.setLayout(&fVisualizationsLayout); |
robertphillips | f42fca4 | 2016-01-27 05:00:04 -0800 | [diff] [blame] | 38 | |
kkinnunen | 41c79cc | 2014-12-30 22:49:58 -0800 | [diff] [blame] | 39 | connect(&fVisibilityFilterCheckBox, SIGNAL(toggled(bool)), this, |
| 40 | SIGNAL(visualizationsChanged())); |
| 41 | connect(&fMegaVizCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(visualizationsChanged())); |
| 42 | connect(&fPathOpsCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(visualizationsChanged())); |
robertphillips | f42fca4 | 2016-01-27 05:00:04 -0800 | [diff] [blame] | 43 | connect(&fOverdrawVizCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(visualizationsChanged())); |
commit-bot@chromium.org | 22d3933 | 2013-11-21 15:37:29 +0000 | [diff] [blame] | 44 | |
kkinnunen | 41c79cc | 2014-12-30 22:49:58 -0800 | [diff] [blame] | 45 | fVerticalLayout.addRow(&fVisualizationsGroup); |
commit-bot@chromium.org | 22d3933 | 2013-11-21 15:37:29 +0000 | [diff] [blame] | 46 | |
kkinnunen | 41c79cc | 2014-12-30 22:49:58 -0800 | [diff] [blame] | 47 | // Raster toggles. |
| 48 | fRasterGroup.setTitle("Raster"); |
| 49 | fRasterGroup.setCheckable(true); |
kkinnunen | 41c79cc | 2014-12-30 22:49:58 -0800 | [diff] [blame] | 50 | fRasterGroup.setLayout(&fRasterLayout); |
| 51 | fVerticalLayout.addRow(&fRasterGroup); |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 52 | |
kkinnunen | 41c79cc | 2014-12-30 22:49:58 -0800 | [diff] [blame] | 53 | connect(&fRasterGroup, SIGNAL(toggled(bool)), this, SIGNAL(rasterSettingsChanged())); |
commit-bot@chromium.org | 768ac85 | 2014-03-03 16:32:17 +0000 | [diff] [blame] | 54 | |
robertphillips@google.com | e8fe4bc | 2013-02-13 13:26:13 +0000 | [diff] [blame] | 55 | #if SK_SUPPORT_GPU |
kkinnunen | 41c79cc | 2014-12-30 22:49:58 -0800 | [diff] [blame] | 56 | fGLGroup.setTitle("OpenGL"); |
| 57 | fGLGroup.setCheckable(true); |
| 58 | fGLGroup.setChecked(false); |
commit-bot@chromium.org | 22d3933 | 2013-11-21 15:37:29 +0000 | [diff] [blame] | 59 | fGLMSAACombo.addItem("Off", QVariant(0)); |
| 60 | fGLMSAACombo.addItem("4", QVariant(4)); |
| 61 | fGLMSAACombo.addItem("16", QVariant(16)); |
kkinnunen | 41c79cc | 2014-12-30 22:49:58 -0800 | [diff] [blame] | 62 | fGLLayout.addRow("MSAA", &fGLMSAACombo); |
| 63 | fGLGroup.setLayout(&fGLLayout); |
commit-bot@chromium.org | fde1e7c | 2013-08-02 13:59:50 +0000 | [diff] [blame] | 64 | |
kkinnunen | 41c79cc | 2014-12-30 22:49:58 -0800 | [diff] [blame] | 65 | connect(&fGLGroup, SIGNAL(toggled(bool)), this, |
commit-bot@chromium.org | 22d3933 | 2013-11-21 15:37:29 +0000 | [diff] [blame] | 66 | SIGNAL(glSettingsChanged())); |
| 67 | connect(&fGLMSAACombo, SIGNAL(activated(int)), this, |
| 68 | SIGNAL(glSettingsChanged())); |
kkinnunen | 41c79cc | 2014-12-30 22:49:58 -0800 | [diff] [blame] | 69 | |
| 70 | fVerticalLayout.addRow(&fGLGroup); |
robertphillips@google.com | e8fe4bc | 2013-02-13 13:26:13 +0000 | [diff] [blame] | 71 | #endif |
chudy@google.com | ea5488b | 2012-07-26 19:38:22 +0000 | [diff] [blame] | 72 | |
reed | 93a1215 | 2015-03-16 10:08:34 -0700 | [diff] [blame] | 73 | fFilterCombo.addItem("As encoded", QVariant(kNone_SkFilterQuality)); |
| 74 | fFilterCombo.addItem("None", QVariant(kNone_SkFilterQuality)); |
| 75 | fFilterCombo.addItem("Low", QVariant(kLow_SkFilterQuality)); |
| 76 | fFilterCombo.addItem("Medium", QVariant(kMedium_SkFilterQuality)); |
| 77 | fFilterCombo.addItem("High", QVariant(kHigh_SkFilterQuality)); |
kkinnunen | 41c79cc | 2014-12-30 22:49:58 -0800 | [diff] [blame] | 78 | connect(&fFilterCombo, SIGNAL(activated(int)), this, SIGNAL(texFilterSettingsChanged())); |
robertphillips@google.com | 32bbcf8 | 2013-10-17 17:56:10 +0000 | [diff] [blame] | 79 | |
kkinnunen | 41c79cc | 2014-12-30 22:49:58 -0800 | [diff] [blame] | 80 | fVerticalLayout.addRow("Filtering", &fFilterCombo); |
chudy@google.com | e606d6e | 2012-07-12 14:31:25 +0000 | [diff] [blame] | 81 | this->setDisabled(true); |
chudy@google.com | 902ebe5 | 2012-06-29 14:21:22 +0000 | [diff] [blame] | 82 | } |
| 83 | |