Line | Source | Count |
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
12 | | - |
13 | | - |
14 | | - |
15 | | - |
16 | | - |
17 | | - |
18 | | - |
19 | | - |
20 | | - |
21 | | - |
22 | | - |
23 | | - |
24 | | - |
25 | | - |
26 | | - |
27 | | - |
28 | | - |
29 | | - |
30 | | - |
31 | | - |
32 | | - |
33 | | - |
34 | | - |
35 | | - |
36 | | - |
37 | | - |
38 | | - |
39 | | - |
40 | | - |
41 | | - |
42 | | - |
43 | #include "qopenglfunctions_3_3_core.h" | - |
44 | #include "qopenglcontext.h" | - |
45 | | - |
46 | QT_BEGIN_NAMESPACE | - |
47 | | - |
48 | | - |
49 | | - |
50 | | - |
51 | | - |
52 | | - |
53 | | - |
54 | | - |
55 | | - |
56 | | - |
57 | | - |
58 | | - |
59 | | - |
60 | | - |
61 | | - |
62 | QOpenGLFunctions_3_3_Core::QOpenGLFunctions_3_3_Core() | - |
63 | : QAbstractOpenGLFunctions() | - |
64 | , d_1_0_Core(0) | - |
65 | , d_1_1_Core(0) | - |
66 | , d_1_2_Core(0) | - |
67 | , d_1_3_Core(0) | - |
68 | , d_1_4_Core(0) | - |
69 | , d_1_5_Core(0) | - |
70 | , d_2_0_Core(0) | - |
71 | , d_2_1_Core(0) | - |
72 | , d_3_0_Core(0) | - |
73 | , d_3_1_Core(0) | - |
74 | , d_3_2_Core(0) | - |
75 | , d_3_3_Core(0) | - |
76 | { | - |
77 | } never executed: end of block | 0 |
78 | | - |
79 | QOpenGLFunctions_3_3_Core::~QOpenGLFunctions_3_3_Core() | - |
80 | { | - |
81 | if (d_1_0_Core && !d_1_0_Core->refs.deref()) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
82 | QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Core->context, QOpenGLFunctions_1_0_CoreBackend::versionStatus()); | - |
83 | delete d_1_0_Core; | - |
84 | } never executed: end of block | 0 |
85 | if (d_1_1_Core && !d_1_1_Core->refs.deref()) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
86 | QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Core->context, QOpenGLFunctions_1_1_CoreBackend::versionStatus()); | - |
87 | delete d_1_1_Core; | - |
88 | } never executed: end of block | 0 |
89 | if (d_1_2_Core && !d_1_2_Core->refs.deref()) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
90 | QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Core->context, QOpenGLFunctions_1_2_CoreBackend::versionStatus()); | - |
91 | delete d_1_2_Core; | - |
92 | } never executed: end of block | 0 |
93 | if (d_1_3_Core && !d_1_3_Core->refs.deref()) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
94 | QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Core->context, QOpenGLFunctions_1_3_CoreBackend::versionStatus()); | - |
95 | delete d_1_3_Core; | - |
96 | } never executed: end of block | 0 |
97 | if (d_1_4_Core && !d_1_4_Core->refs.deref()) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
98 | QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Core->context, QOpenGLFunctions_1_4_CoreBackend::versionStatus()); | - |
99 | delete d_1_4_Core; | - |
100 | } never executed: end of block | 0 |
101 | if (d_1_5_Core && !d_1_5_Core->refs.deref()) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
102 | QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_5_Core->context, QOpenGLFunctions_1_5_CoreBackend::versionStatus()); | - |
103 | delete d_1_5_Core; | - |
104 | } never executed: end of block | 0 |
105 | if (d_2_0_Core && !d_2_0_Core->refs.deref()) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
106 | QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_0_Core->context, QOpenGLFunctions_2_0_CoreBackend::versionStatus()); | - |
107 | delete d_2_0_Core; | - |
108 | } never executed: end of block | 0 |
109 | if (d_2_1_Core && !d_2_1_Core->refs.deref()) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
110 | QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_1_Core->context, QOpenGLFunctions_2_1_CoreBackend::versionStatus()); | - |
111 | delete d_2_1_Core; | - |
112 | } never executed: end of block | 0 |
113 | if (d_3_0_Core && !d_3_0_Core->refs.deref()) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
114 | QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_0_Core->context, QOpenGLFunctions_3_0_CoreBackend::versionStatus()); | - |
115 | delete d_3_0_Core; | - |
116 | } never executed: end of block | 0 |
117 | if (d_3_1_Core && !d_3_1_Core->refs.deref()) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
118 | QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_1_Core->context, QOpenGLFunctions_3_1_CoreBackend::versionStatus()); | - |
119 | delete d_3_1_Core; | - |
120 | } never executed: end of block | 0 |
121 | if (d_3_2_Core && !d_3_2_Core->refs.deref()) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
122 | QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_2_Core->context, QOpenGLFunctions_3_2_CoreBackend::versionStatus()); | - |
123 | delete d_3_2_Core; | - |
124 | } never executed: end of block | 0 |
125 | if (d_3_3_Core && !d_3_3_Core->refs.deref()) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
126 | QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_3_Core->context, QOpenGLFunctions_3_3_CoreBackend::versionStatus()); | - |
127 | delete d_3_3_Core; | - |
128 | } never executed: end of block | 0 |
129 | } never executed: end of block | 0 |
130 | | - |
131 | bool QOpenGLFunctions_3_3_Core::initializeOpenGLFunctions() | - |
132 | { | - |
133 | if ( isInitialized() )TRUE | never evaluated | FALSE | never evaluated |
| 0 |
134 | return true; never executed: return true; | 0 |
135 | | - |
136 | QOpenGLContext* context = QOpenGLContext::currentContext(); | - |
137 | | - |
138 | | - |
139 | | - |
140 | if (((owningContext() && owningContext() == context) || !owningContext())TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
141 | && QOpenGLFunctions_3_3_Core::isContextCompatible(context))TRUE | never evaluated | FALSE | never evaluated |
| 0 |
142 | { | - |
143 | | - |
144 | | - |
145 | QOpenGLVersionFunctionsBackend* d = 0; | - |
146 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus()); | - |
147 | if (!d) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
148 | d = new QOpenGLFunctions_1_0_CoreBackend(context); | - |
149 | QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus(), d); | - |
150 | } never executed: end of block | 0 |
151 | d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d); | - |
152 | d->refs.ref(); | - |
153 | | - |
154 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus()); | - |
155 | if (!d) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
156 | d = new QOpenGLFunctions_1_1_CoreBackend(context); | - |
157 | QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus(), d); | - |
158 | } never executed: end of block | 0 |
159 | d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d); | - |
160 | d->refs.ref(); | - |
161 | | - |
162 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus()); | - |
163 | if (!d) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
164 | d = new QOpenGLFunctions_1_2_CoreBackend(context); | - |
165 | QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus(), d); | - |
166 | } never executed: end of block | 0 |
167 | d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d); | - |
168 | d->refs.ref(); | - |
169 | | - |
170 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus()); | - |
171 | if (!d) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
172 | d = new QOpenGLFunctions_1_3_CoreBackend(context); | - |
173 | QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus(), d); | - |
174 | } never executed: end of block | 0 |
175 | d_1_3_Core = static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d); | - |
176 | d->refs.ref(); | - |
177 | | - |
178 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus()); | - |
179 | if (!d) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
180 | d = new QOpenGLFunctions_1_4_CoreBackend(context); | - |
181 | QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus(), d); | - |
182 | } never executed: end of block | 0 |
183 | d_1_4_Core = static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d); | - |
184 | d->refs.ref(); | - |
185 | | - |
186 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus()); | - |
187 | if (!d) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
188 | d = new QOpenGLFunctions_1_5_CoreBackend(context); | - |
189 | QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus(), d); | - |
190 | } never executed: end of block | 0 |
191 | d_1_5_Core = static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d); | - |
192 | d->refs.ref(); | - |
193 | | - |
194 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus()); | - |
195 | if (!d) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
196 | d = new QOpenGLFunctions_2_0_CoreBackend(context); | - |
197 | QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus(), d); | - |
198 | } never executed: end of block | 0 |
199 | d_2_0_Core = static_cast<QOpenGLFunctions_2_0_CoreBackend*>(d); | - |
200 | d->refs.ref(); | - |
201 | | - |
202 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus()); | - |
203 | if (!d) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
204 | d = new QOpenGLFunctions_2_1_CoreBackend(context); | - |
205 | QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus(), d); | - |
206 | } never executed: end of block | 0 |
207 | d_2_1_Core = static_cast<QOpenGLFunctions_2_1_CoreBackend*>(d); | - |
208 | d->refs.ref(); | - |
209 | | - |
210 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus()); | - |
211 | if (!d) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
212 | d = new QOpenGLFunctions_3_0_CoreBackend(context); | - |
213 | QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus(), d); | - |
214 | } never executed: end of block | 0 |
215 | d_3_0_Core = static_cast<QOpenGLFunctions_3_0_CoreBackend*>(d); | - |
216 | d->refs.ref(); | - |
217 | | - |
218 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus()); | - |
219 | if (!d) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
220 | d = new QOpenGLFunctions_3_1_CoreBackend(context); | - |
221 | QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus(), d); | - |
222 | } never executed: end of block | 0 |
223 | d_3_1_Core = static_cast<QOpenGLFunctions_3_1_CoreBackend*>(d); | - |
224 | d->refs.ref(); | - |
225 | | - |
226 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus()); | - |
227 | if (!d) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
228 | d = new QOpenGLFunctions_3_2_CoreBackend(context); | - |
229 | QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus(), d); | - |
230 | } never executed: end of block | 0 |
231 | d_3_2_Core = static_cast<QOpenGLFunctions_3_2_CoreBackend*>(d); | - |
232 | d->refs.ref(); | - |
233 | | - |
234 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus()); | - |
235 | if (!d) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
236 | d = new QOpenGLFunctions_3_3_CoreBackend(context); | - |
237 | QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus(), d); | - |
238 | } never executed: end of block | 0 |
239 | d_3_3_Core = static_cast<QOpenGLFunctions_3_3_CoreBackend*>(d); | - |
240 | d->refs.ref(); | - |
241 | | - |
242 | QAbstractOpenGLFunctions::initializeOpenGLFunctions(); | - |
243 | } never executed: end of block | 0 |
244 | return isInitialized(); never executed: return isInitialized(); | 0 |
245 | } | - |
246 | | - |
247 | bool QOpenGLFunctions_3_3_Core::isContextCompatible(QOpenGLContext *context) | - |
248 | { | - |
249 | Q_ASSERT(context); | - |
250 | QSurfaceFormat f = context->format(); | - |
251 | const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion()); | - |
252 | if (v < qMakePair(3, 3))TRUE | never evaluated | FALSE | never evaluated |
| 0 |
253 | return false; never executed: return false; | 0 |
254 | | - |
255 | return true; never executed: return true; | 0 |
256 | } | - |
257 | | - |
258 | QOpenGLVersionProfile QOpenGLFunctions_3_3_Core::versionProfile() | - |
259 | { | - |
260 | QOpenGLVersionProfile v; | - |
261 | v.setVersion(3, 3); | - |
262 | v.setProfile(QSurfaceFormat::CoreProfile); | - |
263 | return v; never executed: return v; | 0 |
264 | } | - |
265 | | - |
266 | QT_END_NAMESPACE | - |
| | |