OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "SkSettingsWidget.h" | 10 #include "SkSettingsWidget.h" |
11 #include <iostream> | 11 #include <iostream> |
12 #include <math.h> | 12 #include <math.h> |
13 | 13 |
14 // TODO(chudy): See if the layout can't be attached to the frame post constructi
on. | 14 // TODO(chudy): See if the layout can't be attached to the frame post constructi
on. |
15 SkSettingsWidget::SkSettingsWidget() : QFrame() | 15 SkSettingsWidget::SkSettingsWidget() : QFrame() |
16 { | 16 { |
17 this->setLayout(&fVerticalLayout); | 17 this->setLayout(&fVerticalLayout); |
18 this->setFrameStyle(QFrame::Panel); | 18 this->setFrameStyle(QFrame::Panel); |
19 // Vertical Layout is the alignment inside of the main frame. | 19 // Vertical Layout is the alignment inside of the main frame. |
20 fVerticalLayout.setAlignment(Qt::AlignTop); | 20 fVerticalLayout.setAlignment(Qt::AlignTop); |
21 | 21 |
22 // Visualizations toggles. | 22 // Visualizations toggles. |
23 fVisualizationsGroup.setTitle("Visualizations"); | 23 fVisualizationsGroup.setTitle("Visualizations"); |
24 | |
25 fVisibilityFilterCheckBox.setText("Visibility Filter"); | 24 fVisibilityFilterCheckBox.setText("Visibility Filter"); |
26 fVisualizationsLayout.addWidget(&fVisibilityFilterCheckBox); | 25 fVisualizationsLayout.addWidget(&fVisibilityFilterCheckBox); |
27 | |
28 fMegaVizCheckBox.setText("Mega Viz"); | 26 fMegaVizCheckBox.setText("Mega Viz"); |
29 fVisualizationsLayout.addWidget(&fMegaVizCheckBox); | 27 fVisualizationsLayout.addWidget(&fMegaVizCheckBox); |
30 | |
31 fPathOpsCheckBox.setText("PathOps "); | 28 fPathOpsCheckBox.setText("PathOps "); |
32 fVisualizationsLayout.addWidget(&fPathOpsCheckBox); | 29 fVisualizationsLayout.addWidget(&fPathOpsCheckBox); |
33 | |
34 fOverdrawVizCheckBox.setText("Overdraw Viz"); | |
35 fVisualizationsLayout.addWidget(&fOverdrawVizCheckBox); | |
36 | |
37 fVisualizationsGroup.setLayout(&fVisualizationsLayout); | 30 fVisualizationsGroup.setLayout(&fVisualizationsLayout); |
38 | |
39 connect(&fVisibilityFilterCheckBox, SIGNAL(toggled(bool)), this, | 31 connect(&fVisibilityFilterCheckBox, SIGNAL(toggled(bool)), this, |
40 SIGNAL(visualizationsChanged())); | 32 SIGNAL(visualizationsChanged())); |
41 connect(&fMegaVizCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(visualization
sChanged())); | 33 connect(&fMegaVizCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(visualization
sChanged())); |
42 connect(&fPathOpsCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(visualization
sChanged())); | 34 connect(&fPathOpsCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(visualization
sChanged())); |
43 connect(&fOverdrawVizCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(visualiza
tionsChanged())); | |
44 | 35 |
45 fVerticalLayout.addRow(&fVisualizationsGroup); | 36 fVerticalLayout.addRow(&fVisualizationsGroup); |
46 | 37 |
47 // Raster toggles. | 38 // Raster toggles. |
48 fRasterGroup.setTitle("Raster"); | 39 fRasterGroup.setTitle("Raster"); |
49 fRasterGroup.setCheckable(true); | 40 fRasterGroup.setCheckable(true); |
| 41 fOverdrawVizCheckBox.setText("Overdraw Viz"); |
| 42 fRasterLayout.addWidget(&fOverdrawVizCheckBox); |
50 fRasterGroup.setLayout(&fRasterLayout); | 43 fRasterGroup.setLayout(&fRasterLayout); |
51 fVerticalLayout.addRow(&fRasterGroup); | 44 fVerticalLayout.addRow(&fRasterGroup); |
52 | 45 |
53 connect(&fRasterGroup, SIGNAL(toggled(bool)), this, SIGNAL(rasterSettingsCha
nged())); | 46 connect(&fRasterGroup, SIGNAL(toggled(bool)), this, SIGNAL(rasterSettingsCha
nged())); |
| 47 connect(&fOverdrawVizCheckBox, SIGNAL(toggled(bool)), this, SIGNAL(rasterSet
tingsChanged())); |
54 | 48 |
55 #if SK_SUPPORT_GPU | 49 #if SK_SUPPORT_GPU |
56 fGLGroup.setTitle("OpenGL"); | 50 fGLGroup.setTitle("OpenGL"); |
57 fGLGroup.setCheckable(true); | 51 fGLGroup.setCheckable(true); |
58 fGLGroup.setChecked(false); | 52 fGLGroup.setChecked(false); |
59 fGLMSAACombo.addItem("Off", QVariant(0)); | 53 fGLMSAACombo.addItem("Off", QVariant(0)); |
60 fGLMSAACombo.addItem("4", QVariant(4)); | 54 fGLMSAACombo.addItem("4", QVariant(4)); |
61 fGLMSAACombo.addItem("16", QVariant(16)); | 55 fGLMSAACombo.addItem("16", QVariant(16)); |
62 fGLLayout.addRow("MSAA", &fGLMSAACombo); | 56 fGLLayout.addRow("MSAA", &fGLMSAACombo); |
63 fGLGroup.setLayout(&fGLLayout); | 57 fGLGroup.setLayout(&fGLLayout); |
(...skipping 10 matching lines...) Expand all Loading... |
74 fFilterCombo.addItem("None", QVariant(kNone_SkFilterQuality)); | 68 fFilterCombo.addItem("None", QVariant(kNone_SkFilterQuality)); |
75 fFilterCombo.addItem("Low", QVariant(kLow_SkFilterQuality)); | 69 fFilterCombo.addItem("Low", QVariant(kLow_SkFilterQuality)); |
76 fFilterCombo.addItem("Medium", QVariant(kMedium_SkFilterQuality)); | 70 fFilterCombo.addItem("Medium", QVariant(kMedium_SkFilterQuality)); |
77 fFilterCombo.addItem("High", QVariant(kHigh_SkFilterQuality)); | 71 fFilterCombo.addItem("High", QVariant(kHigh_SkFilterQuality)); |
78 connect(&fFilterCombo, SIGNAL(activated(int)), this, SIGNAL(texFilterSetting
sChanged())); | 72 connect(&fFilterCombo, SIGNAL(activated(int)), this, SIGNAL(texFilterSetting
sChanged())); |
79 | 73 |
80 fVerticalLayout.addRow("Filtering", &fFilterCombo); | 74 fVerticalLayout.addRow("Filtering", &fFilterCombo); |
81 this->setDisabled(true); | 75 this->setDisabled(true); |
82 } | 76 } |
83 | 77 |
OLD | NEW |