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_4_0_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_4_0_Core::QOpenGLFunctions_4_0_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 | , d_4_0_Core(0) | - |
77 | { | - |
78 | } never executed: end of block | 0 |
79 | | - |
80 | QOpenGLFunctions_4_0_Core::~QOpenGLFunctions_4_0_Core() | - |
81 | { | - |
82 | if (d_1_0_Core && !d_1_0_Core->refs.deref()) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
83 | QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_0_Core->context, QOpenGLFunctions_1_0_CoreBackend::versionStatus()); | - |
84 | delete d_1_0_Core; | - |
85 | } never executed: end of block | 0 |
86 | if (d_1_1_Core && !d_1_1_Core->refs.deref()) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
87 | QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_1_Core->context, QOpenGLFunctions_1_1_CoreBackend::versionStatus()); | - |
88 | delete d_1_1_Core; | - |
89 | } never executed: end of block | 0 |
90 | if (d_1_2_Core && !d_1_2_Core->refs.deref()) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
91 | QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_2_Core->context, QOpenGLFunctions_1_2_CoreBackend::versionStatus()); | - |
92 | delete d_1_2_Core; | - |
93 | } never executed: end of block | 0 |
94 | if (d_1_3_Core && !d_1_3_Core->refs.deref()) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
95 | QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_3_Core->context, QOpenGLFunctions_1_3_CoreBackend::versionStatus()); | - |
96 | delete d_1_3_Core; | - |
97 | } never executed: end of block | 0 |
98 | if (d_1_4_Core && !d_1_4_Core->refs.deref()) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
99 | QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_4_Core->context, QOpenGLFunctions_1_4_CoreBackend::versionStatus()); | - |
100 | delete d_1_4_Core; | - |
101 | } never executed: end of block | 0 |
102 | if (d_1_5_Core && !d_1_5_Core->refs.deref()) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
103 | QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_1_5_Core->context, QOpenGLFunctions_1_5_CoreBackend::versionStatus()); | - |
104 | delete d_1_5_Core; | - |
105 | } never executed: end of block | 0 |
106 | if (d_2_0_Core && !d_2_0_Core->refs.deref()) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
107 | QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_0_Core->context, QOpenGLFunctions_2_0_CoreBackend::versionStatus()); | - |
108 | delete d_2_0_Core; | - |
109 | } never executed: end of block | 0 |
110 | if (d_2_1_Core && !d_2_1_Core->refs.deref()) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
111 | QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_2_1_Core->context, QOpenGLFunctions_2_1_CoreBackend::versionStatus()); | - |
112 | delete d_2_1_Core; | - |
113 | } never executed: end of block | 0 |
114 | if (d_3_0_Core && !d_3_0_Core->refs.deref()) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
115 | QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_0_Core->context, QOpenGLFunctions_3_0_CoreBackend::versionStatus()); | - |
116 | delete d_3_0_Core; | - |
117 | } never executed: end of block | 0 |
118 | if (d_3_1_Core && !d_3_1_Core->refs.deref()) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
119 | QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_1_Core->context, QOpenGLFunctions_3_1_CoreBackend::versionStatus()); | - |
120 | delete d_3_1_Core; | - |
121 | } never executed: end of block | 0 |
122 | if (d_3_2_Core && !d_3_2_Core->refs.deref()) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
123 | QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_2_Core->context, QOpenGLFunctions_3_2_CoreBackend::versionStatus()); | - |
124 | delete d_3_2_Core; | - |
125 | } never executed: end of block | 0 |
126 | if (d_3_3_Core && !d_3_3_Core->refs.deref()) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
127 | QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_3_3_Core->context, QOpenGLFunctions_3_3_CoreBackend::versionStatus()); | - |
128 | delete d_3_3_Core; | - |
129 | } never executed: end of block | 0 |
130 | if (d_4_0_Core && !d_4_0_Core->refs.deref()) {TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
131 | QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend(d_4_0_Core->context, QOpenGLFunctions_4_0_CoreBackend::versionStatus()); | - |
132 | delete d_4_0_Core; | - |
133 | } never executed: end of block | 0 |
134 | } never executed: end of block | 0 |
135 | | - |
136 | bool QOpenGLFunctions_4_0_Core::initializeOpenGLFunctions() | - |
137 | { | - |
138 | if ( isInitialized() )TRUE | never evaluated | FALSE | never evaluated |
| 0 |
139 | return true; never executed: return true; | 0 |
140 | | - |
141 | QOpenGLContext* context = QOpenGLContext::currentContext(); | - |
142 | | - |
143 | | - |
144 | | - |
145 | if (((owningContext() && owningContext() == context) || !owningContext())TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
146 | && QOpenGLFunctions_4_0_Core::isContextCompatible(context))TRUE | never evaluated | FALSE | never evaluated |
| 0 |
147 | { | - |
148 | | - |
149 | | - |
150 | QOpenGLVersionFunctionsBackend* d = 0; | - |
151 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus()); | - |
152 | if (!d) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
153 | d = new QOpenGLFunctions_1_0_CoreBackend(context); | - |
154 | QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus(), d); | - |
155 | } never executed: end of block | 0 |
156 | d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d); | - |
157 | d->refs.ref(); | - |
158 | | - |
159 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus()); | - |
160 | if (!d) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
161 | d = new QOpenGLFunctions_1_1_CoreBackend(context); | - |
162 | QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus(), d); | - |
163 | } never executed: end of block | 0 |
164 | d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d); | - |
165 | d->refs.ref(); | - |
166 | | - |
167 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus()); | - |
168 | if (!d) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
169 | d = new QOpenGLFunctions_1_2_CoreBackend(context); | - |
170 | QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus(), d); | - |
171 | } never executed: end of block | 0 |
172 | d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d); | - |
173 | d->refs.ref(); | - |
174 | | - |
175 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus()); | - |
176 | if (!d) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
177 | d = new QOpenGLFunctions_1_3_CoreBackend(context); | - |
178 | QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus(), d); | - |
179 | } never executed: end of block | 0 |
180 | d_1_3_Core = static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d); | - |
181 | d->refs.ref(); | - |
182 | | - |
183 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus()); | - |
184 | if (!d) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
185 | d = new QOpenGLFunctions_1_4_CoreBackend(context); | - |
186 | QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus(), d); | - |
187 | } never executed: end of block | 0 |
188 | d_1_4_Core = static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d); | - |
189 | d->refs.ref(); | - |
190 | | - |
191 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus()); | - |
192 | if (!d) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
193 | d = new QOpenGLFunctions_1_5_CoreBackend(context); | - |
194 | QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus(), d); | - |
195 | } never executed: end of block | 0 |
196 | d_1_5_Core = static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d); | - |
197 | d->refs.ref(); | - |
198 | | - |
199 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus()); | - |
200 | if (!d) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
201 | d = new QOpenGLFunctions_2_0_CoreBackend(context); | - |
202 | QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus(), d); | - |
203 | } never executed: end of block | 0 |
204 | d_2_0_Core = static_cast<QOpenGLFunctions_2_0_CoreBackend*>(d); | - |
205 | d->refs.ref(); | - |
206 | | - |
207 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus()); | - |
208 | if (!d) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
209 | d = new QOpenGLFunctions_2_1_CoreBackend(context); | - |
210 | QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus(), d); | - |
211 | } never executed: end of block | 0 |
212 | d_2_1_Core = static_cast<QOpenGLFunctions_2_1_CoreBackend*>(d); | - |
213 | d->refs.ref(); | - |
214 | | - |
215 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus()); | - |
216 | if (!d) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
217 | d = new QOpenGLFunctions_3_0_CoreBackend(context); | - |
218 | QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus(), d); | - |
219 | } never executed: end of block | 0 |
220 | d_3_0_Core = static_cast<QOpenGLFunctions_3_0_CoreBackend*>(d); | - |
221 | d->refs.ref(); | - |
222 | | - |
223 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus()); | - |
224 | if (!d) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
225 | d = new QOpenGLFunctions_3_1_CoreBackend(context); | - |
226 | QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus(), d); | - |
227 | } never executed: end of block | 0 |
228 | d_3_1_Core = static_cast<QOpenGLFunctions_3_1_CoreBackend*>(d); | - |
229 | d->refs.ref(); | - |
230 | | - |
231 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus()); | - |
232 | if (!d) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
233 | d = new QOpenGLFunctions_3_2_CoreBackend(context); | - |
234 | QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus(), d); | - |
235 | } never executed: end of block | 0 |
236 | d_3_2_Core = static_cast<QOpenGLFunctions_3_2_CoreBackend*>(d); | - |
237 | d->refs.ref(); | - |
238 | | - |
239 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus()); | - |
240 | if (!d) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
241 | d = new QOpenGLFunctions_3_3_CoreBackend(context); | - |
242 | QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus(), d); | - |
243 | } never executed: end of block | 0 |
244 | d_3_3_Core = static_cast<QOpenGLFunctions_3_3_CoreBackend*>(d); | - |
245 | d->refs.ref(); | - |
246 | | - |
247 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_0_CoreBackend::versionStatus()); | - |
248 | if (!d) {TRUE | never evaluated | FALSE | never evaluated |
| 0 |
249 | d = new QOpenGLFunctions_4_0_CoreBackend(context); | - |
250 | QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_4_0_CoreBackend::versionStatus(), d); | - |
251 | } never executed: end of block | 0 |
252 | d_4_0_Core = static_cast<QOpenGLFunctions_4_0_CoreBackend*>(d); | - |
253 | d->refs.ref(); | - |
254 | | - |
255 | QAbstractOpenGLFunctions::initializeOpenGLFunctions(); | - |
256 | } never executed: end of block | 0 |
257 | return isInitialized(); never executed: return isInitialized(); | 0 |
258 | } | - |
259 | | - |
260 | bool QOpenGLFunctions_4_0_Core::isContextCompatible(QOpenGLContext *context) | - |
261 | { | - |
262 | Q_ASSERT(context); | - |
263 | QSurfaceFormat f = context->format(); | - |
264 | const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion()); | - |
265 | if (v < qMakePair(4, 0))TRUE | never evaluated | FALSE | never evaluated |
| 0 |
266 | return false; never executed: return false; | 0 |
267 | | - |
268 | return true; never executed: return true; | 0 |
269 | } | - |
270 | | - |
271 | QOpenGLVersionProfile QOpenGLFunctions_4_0_Core::versionProfile() | - |
272 | { | - |
273 | QOpenGLVersionProfile v; | - |
274 | v.setVersion(4, 0); | - |
275 | v.setProfile(QSurfaceFormat::CoreProfile); | - |
276 | return v; never executed: return v; | 0 |
277 | } | - |
278 | | - |
279 | QT_END_NAMESPACE | - |
| | |