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 #ifndef SKSETTINGSWIDGET_H_ | 10 #ifndef SKSETTINGSWIDGET_H_ |
11 #define SKSETTINGSWIDGET_H_ | 11 #define SKSETTINGSWIDGET_H_ |
12 | 12 |
13 #include <QWidget> | 13 #include <QWidget> |
14 #include <QHBoxLayout> | 14 #include <QHBoxLayout> |
15 #include <QTextEdit> | 15 #include <QTextEdit> |
16 #include <QFrame> | 16 #include <QFrame> |
| 17 #include <QGroupBox> |
17 #include <QLabel> | 18 #include <QLabel> |
18 #include <QRadioButton> | 19 #include <QRadioButton> |
19 #include <QCheckBox> | 20 #include <QCheckBox> |
20 #include <QLineEdit> | 21 #include <QLineEdit> |
21 | 22 |
22 /** \class SkSettingsWidget | 23 /** \class SkSettingsWidget |
23 | 24 |
24 The SettingsWidget contains multiple checkboxes and toggles for altering | 25 The SettingsWidget contains multiple checkboxes and toggles for altering |
25 the visibility. | 26 the visibility. |
26 */ | 27 */ |
27 class SkSettingsWidget : public QWidget { | 28 class SkSettingsWidget : public QWidget { |
28 Q_OBJECT | 29 Q_OBJECT |
29 | 30 |
30 public: | 31 public: |
31 /** | 32 /** |
32 Constructs a widget with the specified parent for layout purposes. | 33 Constructs a widget with the specified parent for layout purposes. |
33 @param parent The parent container of this widget | 34 @param parent The parent container of this widget |
34 */ | 35 */ |
35 SkSettingsWidget(); | 36 SkSettingsWidget(); |
36 | 37 |
37 /** Sets the displayed user zoom level. A scale of 1.0 represents no zoom. *
/ | 38 /** Sets the displayed user zoom level. A scale of 1.0 represents no zoom. *
/ |
38 void setZoomText(float scale); | 39 void setZoomText(float scale); |
39 | 40 |
40 QRadioButton* getVisibilityButton(); | 41 QRadioButton* getVisibilityButton(); |
41 | 42 |
42 #if SK_SUPPORT_GPU | 43 #if SK_SUPPORT_GPU |
43 QCheckBox* getGLCheckBox() { | 44 bool isGLActive() { |
44 return &fGLCheckBox; | 45 return fGLCheckBox.isChecked(); |
45 } | 46 } |
| 47 |
| 48 int getGLSampleCount() { |
| 49 if (fGLMSAA4On.isChecked()) { |
| 50 return 4; |
| 51 } else if (fGLMSAA16On.isChecked()) { |
| 52 return 16; |
| 53 } |
| 54 return 0; |
| 55 } |
| 56 |
46 #endif | 57 #endif |
47 | 58 |
48 QCheckBox* getRasterCheckBox() { | 59 QCheckBox* getRasterCheckBox() { |
49 return &fRasterCheckBox; | 60 return &fRasterCheckBox; |
50 } | 61 } |
51 | 62 |
52 QCheckBox* getOverdrawVizCheckBox() { | 63 QCheckBox* getOverdrawVizCheckBox() { |
53 return &fOverdrawVizCheckBox; | 64 return &fOverdrawVizCheckBox; |
54 } | 65 } |
55 | 66 |
56 private slots: | 67 private slots: |
57 void updateCommand(int newCommand); | 68 void updateCommand(int newCommand); |
58 void updateHit(int newHit); | 69 void updateHit(int newHit); |
59 | 70 |
60 signals: | 71 signals: |
61 void scrollingPreferences(bool isStickyActivate); | 72 void scrollingPreferences(bool isStickyActivate); |
62 void showStyle(bool isSingleCommand); | 73 void showStyle(bool isSingleCommand); |
63 void visibilityFilter(bool isEnabled); | 74 void visibilityFilter(bool isEnabled); |
| 75 #if SK_SUPPORT_GPU |
| 76 void glSettingsChanged(); |
| 77 #endif |
64 | 78 |
65 private: | 79 private: |
66 QVBoxLayout mainFrameLayout; | 80 QVBoxLayout mainFrameLayout; |
67 QFrame mainFrame; | 81 QFrame mainFrame; |
68 QVBoxLayout fVerticalLayout; | 82 QVBoxLayout fVerticalLayout; |
69 | 83 |
70 QLabel fVisibileText; | 84 QLabel fVisibileText; |
71 QFrame fVisibleFrame; | 85 QFrame fVisibleFrame; |
72 QVBoxLayout fVisibleFrameLayout; | 86 QVBoxLayout fVisibleFrameLayout; |
73 QRadioButton fVisibleOn; | 87 QRadioButton fVisibleOn; |
(...skipping 20 matching lines...) Expand all Loading... |
94 QCheckBox fRasterCheckBox; | 108 QCheckBox fRasterCheckBox; |
95 | 109 |
96 QHBoxLayout fOverdrawVizLayout; | 110 QHBoxLayout fOverdrawVizLayout; |
97 QLabel fOverdrawVizLabel; | 111 QLabel fOverdrawVizLabel; |
98 QCheckBox fOverdrawVizCheckBox; | 112 QCheckBox fOverdrawVizCheckBox; |
99 | 113 |
100 #if SK_SUPPORT_GPU | 114 #if SK_SUPPORT_GPU |
101 QHBoxLayout fGLLayout; | 115 QHBoxLayout fGLLayout; |
102 QLabel fGLLabel; | 116 QLabel fGLLabel; |
103 QCheckBox fGLCheckBox; | 117 QCheckBox fGLCheckBox; |
| 118 QGroupBox fGLMSAAButtonGroup; |
| 119 QVBoxLayout fGLMSAALayout; |
| 120 QRadioButton fGLMSAAOff; |
| 121 QRadioButton fGLMSAA4On; |
| 122 QRadioButton fGLMSAA16On; |
104 #endif | 123 #endif |
105 | 124 |
106 QFrame fZoomFrame; | 125 QFrame fZoomFrame; |
107 QHBoxLayout fZoomLayout; | 126 QHBoxLayout fZoomLayout; |
108 QLabel fZoomSetting; | 127 QLabel fZoomSetting; |
109 QLineEdit fZoomBox; | 128 QLineEdit fZoomBox; |
110 }; | 129 }; |
111 | 130 |
112 #endif /* SKSETTINGSWIDGET_H_ */ | 131 #endif /* SKSETTINGSWIDGET_H_ */ |
OLD | NEW |