qopenglfunctions_4_5_compatibility.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/gui/opengl/qopenglfunctions_4_5_compatibility.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3QOpenGLFunctions_4_5_Compatibility::QOpenGLFunctions_4_5_Compatibility()-
4 : QAbstractOpenGLFunctions()-
5 , d_1_0_Core(0)-
6 , d_1_1_Core(0)-
7 , d_1_2_Core(0)-
8 , d_1_3_Core(0)-
9 , d_1_4_Core(0)-
10 , d_1_5_Core(0)-
11 , d_2_0_Core(0)-
12 , d_2_1_Core(0)-
13 , d_3_0_Core(0)-
14 , d_3_1_Core(0)-
15 , d_3_2_Core(0)-
16 , d_3_3_Core(0)-
17 , d_4_0_Core(0)-
18 , d_4_1_Core(0)-
19 , d_4_2_Core(0)-
20 , d_4_3_Core(0)-
21 , d_4_4_Core(0)-
22 , d_4_5_Core(0)-
23 , d_1_0_Deprecated(0)-
24 , d_1_1_Deprecated(0)-
25 , d_1_2_Deprecated(0)-
26 , d_1_3_Deprecated(0)-
27 , d_1_4_Deprecated(0)-
28 , d_3_3_Deprecated(0)-
29 , d_4_5_Deprecated(0)-
30{-
31}
never executed: end of block
0
32-
33QOpenGLFunctions_4_5_Compatibility::~QOpenGLFunctions_4_5_Compatibility()-
34{-
35 if (d_1_0_Core
d_1_0_CoreDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
36 d_1_0_Core->refs.deref();
never executed: d_1_0_Core->refs.deref();
0
37 ((!(d_1_0_Core->refs.load())) ? qt_assert("d_1_0_Core->refs.load()",__FILE__,102) : qt_noop());-
38 if (d_1_1_Core
d_1_1_CoreDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
39 d_1_1_Core->refs.deref();
never executed: d_1_1_Core->refs.deref();
0
40 ((!(d_1_1_Core->refs.load())) ? qt_assert("d_1_1_Core->refs.load()",__FILE__,105) : qt_noop());-
41 if (d_1_2_Core
d_1_2_CoreDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
42 d_1_2_Core->refs.deref();
never executed: d_1_2_Core->refs.deref();
0
43 ((!(d_1_2_Core->refs.load())) ? qt_assert("d_1_2_Core->refs.load()",__FILE__,108) : qt_noop());-
44 if (d_1_3_Core
d_1_3_CoreDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
45 d_1_3_Core->refs.deref();
never executed: d_1_3_Core->refs.deref();
0
46 ((!(d_1_3_Core->refs.load())) ? qt_assert("d_1_3_Core->refs.load()",__FILE__,111) : qt_noop());-
47 if (d_1_4_Core
d_1_4_CoreDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
48 d_1_4_Core->refs.deref();
never executed: d_1_4_Core->refs.deref();
0
49 ((!(d_1_4_Core->refs.load())) ? qt_assert("d_1_4_Core->refs.load()",__FILE__,114) : qt_noop());-
50 if (d_1_5_Core
d_1_5_CoreDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
51 d_1_5_Core->refs.deref();
never executed: d_1_5_Core->refs.deref();
0
52 ((!(d_1_5_Core->refs.load())) ? qt_assert("d_1_5_Core->refs.load()",__FILE__,117) : qt_noop());-
53 if (d_2_0_Core
d_2_0_CoreDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
54 d_2_0_Core->refs.deref();
never executed: d_2_0_Core->refs.deref();
0
55 ((!(d_2_0_Core->refs.load())) ? qt_assert("d_2_0_Core->refs.load()",__FILE__,120) : qt_noop());-
56 if (d_2_1_Core
d_2_1_CoreDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
57 d_2_1_Core->refs.deref();
never executed: d_2_1_Core->refs.deref();
0
58 ((!(d_2_1_Core->refs.load())) ? qt_assert("d_2_1_Core->refs.load()",__FILE__,123) : qt_noop());-
59 if (d_3_0_Core
d_3_0_CoreDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
60 d_3_0_Core->refs.deref();
never executed: d_3_0_Core->refs.deref();
0
61 ((!(d_3_0_Core->refs.load())) ? qt_assert("d_3_0_Core->refs.load()",__FILE__,126) : qt_noop());-
62 if (d_3_1_Core
d_3_1_CoreDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
63 d_3_1_Core->refs.deref();
never executed: d_3_1_Core->refs.deref();
0
64 ((!(d_3_1_Core->refs.load())) ? qt_assert("d_3_1_Core->refs.load()",__FILE__,129) : qt_noop());-
65 if (d_3_2_Core
d_3_2_CoreDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
66 d_3_2_Core->refs.deref();
never executed: d_3_2_Core->refs.deref();
0
67 ((!(d_3_2_Core->refs.load())) ? qt_assert("d_3_2_Core->refs.load()",__FILE__,132) : qt_noop());-
68 if (d_3_3_Core
d_3_3_CoreDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
69 d_3_3_Core->refs.deref();
never executed: d_3_3_Core->refs.deref();
0
70 ((!(d_3_3_Core->refs.load())) ? qt_assert("d_3_3_Core->refs.load()",__FILE__,135) : qt_noop());-
71 if (d_4_0_Core
d_4_0_CoreDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
72 d_4_0_Core->refs.deref();
never executed: d_4_0_Core->refs.deref();
0
73 ((!(d_4_0_Core->refs.load())) ? qt_assert("d_4_0_Core->refs.load()",__FILE__,138) : qt_noop());-
74 if (d_4_1_Core
d_4_1_CoreDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
75 d_4_1_Core->refs.deref();
never executed: d_4_1_Core->refs.deref();
0
76 ((!(d_4_1_Core->refs.load())) ? qt_assert("d_4_1_Core->refs.load()",__FILE__,141) : qt_noop());-
77 if (d_4_2_Core
d_4_2_CoreDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
78 d_4_2_Core->refs.deref();
never executed: d_4_2_Core->refs.deref();
0
79 ((!(d_4_2_Core->refs.load())) ? qt_assert("d_4_2_Core->refs.load()",__FILE__,144) : qt_noop());-
80 if (d_4_3_Core
d_4_3_CoreDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
81 d_4_3_Core->refs.deref();
never executed: d_4_3_Core->refs.deref();
0
82 ((!(d_4_3_Core->refs.load())) ? qt_assert("d_4_3_Core->refs.load()",__FILE__,147) : qt_noop());-
83 if (d_4_4_Core
d_4_4_CoreDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
84 d_4_4_Core->refs.deref();
never executed: d_4_4_Core->refs.deref();
0
85 ((!(d_4_4_Core->refs.load())) ? qt_assert("d_4_4_Core->refs.load()",__FILE__,150) : qt_noop());-
86 if (d_4_5_Core
d_4_5_CoreDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
87 d_4_5_Core->refs.deref();
never executed: d_4_5_Core->refs.deref();
0
88 ((!(d_4_5_Core->refs.load())) ? qt_assert("d_4_5_Core->refs.load()",__FILE__,153) : qt_noop());-
89 if (d_1_0_Deprecated
d_1_0_DeprecatedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
90 d_1_0_Deprecated->refs.deref();
never executed: d_1_0_Deprecated->refs.deref();
0
91 ((!(d_1_0_Deprecated->refs.load())) ? qt_assert("d_1_0_Deprecated->refs.load()",__FILE__,156) : qt_noop());-
92 if (d_1_1_Deprecated
d_1_1_DeprecatedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
93 d_1_1_Deprecated->refs.deref();
never executed: d_1_1_Deprecated->refs.deref();
0
94 ((!(d_1_1_Deprecated->refs.load())) ? qt_assert("d_1_1_Deprecated->refs.load()",__FILE__,159) : qt_noop());-
95 if (d_1_2_Deprecated
d_1_2_DeprecatedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
96 d_1_2_Deprecated->refs.deref();
never executed: d_1_2_Deprecated->refs.deref();
0
97 ((!(d_1_2_Deprecated->refs.load())) ? qt_assert("d_1_2_Deprecated->refs.load()",__FILE__,162) : qt_noop());-
98 if (d_1_3_Deprecated
d_1_3_DeprecatedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
99 d_1_3_Deprecated->refs.deref();
never executed: d_1_3_Deprecated->refs.deref();
0
100 ((!(d_1_3_Deprecated->refs.load())) ? qt_assert("d_1_3_Deprecated->refs.load()",__FILE__,165) : qt_noop());-
101 if (d_1_4_Deprecated
d_1_4_DeprecatedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
102 d_1_4_Deprecated->refs.deref();
never executed: d_1_4_Deprecated->refs.deref();
0
103 ((!(d_1_4_Deprecated->refs.load())) ? qt_assert("d_1_4_Deprecated->refs.load()",__FILE__,168) : qt_noop());-
104 if (d_3_3_Deprecated
d_3_3_DeprecatedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
105 d_3_3_Deprecated->refs.deref();
never executed: d_3_3_Deprecated->refs.deref();
0
106 ((!(d_3_3_Deprecated->refs.load())) ? qt_assert("d_3_3_Deprecated->refs.load()",__FILE__,171) : qt_noop());-
107 if (d_4_5_Deprecated
d_4_5_DeprecatedDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
108 d_4_5_Deprecated->refs.deref();
never executed: d_4_5_Deprecated->refs.deref();
0
109 ((!(d_4_5_Deprecated->refs.load())) ? qt_assert("d_4_5_Deprecated->refs.load()",__FILE__,174) : qt_noop());-
110}
never executed: end of block
0
111-
112bool QOpenGLFunctions_4_5_Compatibility::initializeOpenGLFunctions()-
113{-
114 if ( isInitialized()
isInitialized()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
115 return
never executed: return true;
true;
never executed: return true;
0
116-
117 QOpenGLContext* context = QOpenGLContext::currentContext();-
118-
119-
120-
121 if (((owningContext()
owningContext()Description
TRUEnever evaluated
FALSEnever evaluated
&& owningContext() == context
owningContext() == contextDescription
TRUEnever evaluated
FALSEnever evaluated
) || !owningContext()
!owningContext()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
122 && QOpenGLFunctions_4_5_Compatibility::isContextCompatible(context)
QOpenGLFunctio...tible(context)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
123 {-
124-
125-
126 QOpenGLVersionFunctionsBackend* d = 0;-
127 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus());-
128 d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d);-
129 d->refs.ref();-
130-
131 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus());-
132 d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d);-
133 d->refs.ref();-
134-
135 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus());-
136 d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d);-
137 d->refs.ref();-
138-
139 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus());-
140 d_1_3_Core = static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d);-
141 d->refs.ref();-
142-
143 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus());-
144 d_1_4_Core = static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d);-
145 d->refs.ref();-
146-
147 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus());-
148 d_1_5_Core = static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d);-
149 d->refs.ref();-
150-
151 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus());-
152 d_2_0_Core = static_cast<QOpenGLFunctions_2_0_CoreBackend*>(d);-
153 d->refs.ref();-
154-
155 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus());-
156 d_2_1_Core = static_cast<QOpenGLFunctions_2_1_CoreBackend*>(d);-
157 d->refs.ref();-
158-
159 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus());-
160 d_3_0_Core = static_cast<QOpenGLFunctions_3_0_CoreBackend*>(d);-
161 d->refs.ref();-
162-
163 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus());-
164 d_3_1_Core = static_cast<QOpenGLFunctions_3_1_CoreBackend*>(d);-
165 d->refs.ref();-
166-
167 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus());-
168 d_3_2_Core = static_cast<QOpenGLFunctions_3_2_CoreBackend*>(d);-
169 d->refs.ref();-
170-
171 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus());-
172 d_3_3_Core = static_cast<QOpenGLFunctions_3_3_CoreBackend*>(d);-
173 d->refs.ref();-
174-
175 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_0_CoreBackend::versionStatus());-
176 d_4_0_Core = static_cast<QOpenGLFunctions_4_0_CoreBackend*>(d);-
177 d->refs.ref();-
178-
179 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_1_CoreBackend::versionStatus());-
180 d_4_1_Core = static_cast<QOpenGLFunctions_4_1_CoreBackend*>(d);-
181 d->refs.ref();-
182-
183 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_2_CoreBackend::versionStatus());-
184 d_4_2_Core = static_cast<QOpenGLFunctions_4_2_CoreBackend*>(d);-
185 d->refs.ref();-
186-
187 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_3_CoreBackend::versionStatus());-
188 d_4_3_Core = static_cast<QOpenGLFunctions_4_3_CoreBackend*>(d);-
189 d->refs.ref();-
190-
191 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_4_CoreBackend::versionStatus());-
192 d_4_4_Core = static_cast<QOpenGLFunctions_4_4_CoreBackend*>(d);-
193 d->refs.ref();-
194-
195 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_5_CoreBackend::versionStatus());-
196 d_4_5_Core = static_cast<QOpenGLFunctions_4_5_CoreBackend*>(d);-
197 d->refs.ref();-
198-
199 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus());-
200 d_1_0_Deprecated = static_cast<QOpenGLFunctions_1_0_DeprecatedBackend*>(d);-
201 d->refs.ref();-
202-
203 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus());-
204 d_1_1_Deprecated = static_cast<QOpenGLFunctions_1_1_DeprecatedBackend*>(d);-
205 d->refs.ref();-
206-
207 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus());-
208 d_1_2_Deprecated = static_cast<QOpenGLFunctions_1_2_DeprecatedBackend*>(d);-
209 d->refs.ref();-
210-
211 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus());-
212 d_1_3_Deprecated = static_cast<QOpenGLFunctions_1_3_DeprecatedBackend*>(d);-
213 d->refs.ref();-
214-
215 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus());-
216 d_1_4_Deprecated = static_cast<QOpenGLFunctions_1_4_DeprecatedBackend*>(d);-
217 d->refs.ref();-
218-
219 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_3_DeprecatedBackend::versionStatus());-
220 d_3_3_Deprecated = static_cast<QOpenGLFunctions_3_3_DeprecatedBackend*>(d);-
221 d->refs.ref();-
222-
223 d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_4_5_DeprecatedBackend::versionStatus());-
224 d_4_5_Deprecated = static_cast<QOpenGLFunctions_4_5_DeprecatedBackend*>(d);-
225 d->refs.ref();-
226-
227 QAbstractOpenGLFunctions::initializeOpenGLFunctions();-
228 }
never executed: end of block
0
229 return
never executed: return isInitialized();
isInitialized();
never executed: return isInitialized();
0
230}-
231-
232bool QOpenGLFunctions_4_5_Compatibility::isContextCompatible(QOpenGLContext *context)-
233{-
234 ((!(context)) ? qt_assert("context",__FILE__,299) : qt_noop());-
235 QSurfaceFormat f = context->format();-
236 const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion());-
237 if (v < qMakePair(4, 5)
v < qMakePair(4, 5)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
238 return
never executed: return false;
false;
never executed: return false;
0
239-
240 if (f.profile() == QSurfaceFormat::CoreProfile
f.profile() ==...t::CoreProfileDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
241 return
never executed: return false;
false;
never executed: return false;
0
242-
243 return
never executed: return true;
true;
never executed: return true;
0
244}-
245-
246QOpenGLVersionProfile QOpenGLFunctions_4_5_Compatibility::versionProfile()-
247{-
248 QOpenGLVersionProfile v;-
249 v.setVersion(4, 5);-
250 v.setProfile(QSurfaceFormat::CompatibilityProfile);-
251 return
never executed: return v;
v;
never executed: return v;
0
252}-
253-
254-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9