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 | | - |
44 | | - |
45 | | - |
46 | | - |
47 | | - |
48 | | - |
49 | #include "qopenglfunctions_2_1.h" | - |
50 | #include "qopenglcontext.h" | - |
51 | | - |
52 | QT_BEGIN_NAMESPACE | - |
53 | | - |
54 | | - |
55 | | - |
56 | | - |
57 | | - |
58 | | - |
59 | | - |
60 | | - |
61 | | - |
62 | | - |
63 | | - |
64 | | - |
65 | | - |
66 | | - |
67 | | - |
68 | QOpenGLFunctions_2_1::QOpenGLFunctions_2_1() | - |
69 | : QAbstractOpenGLFunctions() | - |
70 | , d_1_0_Core(0) | - |
71 | , d_1_1_Core(0) | - |
72 | , d_1_2_Core(0) | - |
73 | , d_1_3_Core(0) | - |
74 | , d_1_4_Core(0) | - |
75 | , d_1_5_Core(0) | - |
76 | , d_2_0_Core(0) | - |
77 | , d_2_1_Core(0) | - |
78 | , d_1_0_Deprecated(0) | - |
79 | , d_1_1_Deprecated(0) | - |
80 | , d_1_2_Deprecated(0) | - |
81 | , d_1_3_Deprecated(0) | - |
82 | , d_1_4_Deprecated(0) | - |
83 | , m_reserved_2_0_Deprecated(Q_NULLPTR) | - |
84 | { | - |
85 | } never executed: end of block | 0 |
86 | | - |
87 | QOpenGLFunctions_2_1::~QOpenGLFunctions_2_1() | - |
88 | { | - |
89 | if (d_1_0_Core)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
90 | d_1_0_Core->refs.deref(); never executed: d_1_0_Core->refs.deref(); | 0 |
91 | Q_ASSERT(d_1_0_Core->refs.load()); | - |
92 | if (d_1_1_Core)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
93 | d_1_1_Core->refs.deref(); never executed: d_1_1_Core->refs.deref(); | 0 |
94 | Q_ASSERT(d_1_1_Core->refs.load()); | - |
95 | if (d_1_2_Core)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
96 | d_1_2_Core->refs.deref(); never executed: d_1_2_Core->refs.deref(); | 0 |
97 | Q_ASSERT(d_1_2_Core->refs.load()); | - |
98 | if (d_1_3_Core)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
99 | d_1_3_Core->refs.deref(); never executed: d_1_3_Core->refs.deref(); | 0 |
100 | Q_ASSERT(d_1_3_Core->refs.load()); | - |
101 | if (d_1_4_Core)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
102 | d_1_4_Core->refs.deref(); never executed: d_1_4_Core->refs.deref(); | 0 |
103 | Q_ASSERT(d_1_4_Core->refs.load()); | - |
104 | if (d_1_5_Core)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
105 | d_1_5_Core->refs.deref(); never executed: d_1_5_Core->refs.deref(); | 0 |
106 | Q_ASSERT(d_1_5_Core->refs.load()); | - |
107 | if (d_2_0_Core)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
108 | d_2_0_Core->refs.deref(); never executed: d_2_0_Core->refs.deref(); | 0 |
109 | Q_ASSERT(d_2_0_Core->refs.load()); | - |
110 | if (d_2_1_Core)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
111 | d_2_1_Core->refs.deref(); never executed: d_2_1_Core->refs.deref(); | 0 |
112 | Q_ASSERT(d_2_1_Core->refs.load()); | - |
113 | if (d_1_0_Deprecated)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
114 | d_1_0_Deprecated->refs.deref(); never executed: d_1_0_Deprecated->refs.deref(); | 0 |
115 | Q_ASSERT(d_1_0_Deprecated->refs.load()); | - |
116 | if (d_1_1_Deprecated)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
117 | d_1_1_Deprecated->refs.deref(); never executed: d_1_1_Deprecated->refs.deref(); | 0 |
118 | Q_ASSERT(d_1_1_Deprecated->refs.load()); | - |
119 | if (d_1_2_Deprecated)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
120 | d_1_2_Deprecated->refs.deref(); never executed: d_1_2_Deprecated->refs.deref(); | 0 |
121 | Q_ASSERT(d_1_2_Deprecated->refs.load()); | - |
122 | if (d_1_3_Deprecated)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
123 | d_1_3_Deprecated->refs.deref(); never executed: d_1_3_Deprecated->refs.deref(); | 0 |
124 | Q_ASSERT(d_1_3_Deprecated->refs.load()); | - |
125 | if (d_1_4_Deprecated)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
126 | d_1_4_Deprecated->refs.deref(); never executed: d_1_4_Deprecated->refs.deref(); | 0 |
127 | Q_ASSERT(d_1_4_Deprecated->refs.load()); | - |
128 | } never executed: end of block | 0 |
129 | | - |
130 | bool QOpenGLFunctions_2_1::initializeOpenGLFunctions() | - |
131 | { | - |
132 | if ( isInitialized() )TRUE | never evaluated | FALSE | never evaluated |
| 0 |
133 | return true; never executed: return true; | 0 |
134 | | - |
135 | QOpenGLContext* context = QOpenGLContext::currentContext(); | - |
136 | | - |
137 | | - |
138 | | - |
139 | if (((owningContext() && owningContext() == context) || !owningContext())TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
TRUE | never evaluated | FALSE | never evaluated |
| 0 |
140 | && QOpenGLFunctions_2_1::isContextCompatible(context))TRUE | never evaluated | FALSE | never evaluated |
| 0 |
141 | { | - |
142 | | - |
143 | | - |
144 | QOpenGLVersionFunctionsBackend* d = 0; | - |
145 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus()); | - |
146 | d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d); | - |
147 | d->refs.ref(); | - |
148 | | - |
149 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus()); | - |
150 | d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d); | - |
151 | d->refs.ref(); | - |
152 | | - |
153 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus()); | - |
154 | d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d); | - |
155 | d->refs.ref(); | - |
156 | | - |
157 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus()); | - |
158 | d_1_3_Core = static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d); | - |
159 | d->refs.ref(); | - |
160 | | - |
161 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus()); | - |
162 | d_1_4_Core = static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d); | - |
163 | d->refs.ref(); | - |
164 | | - |
165 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus()); | - |
166 | d_1_5_Core = static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d); | - |
167 | d->refs.ref(); | - |
168 | | - |
169 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus()); | - |
170 | d_2_0_Core = static_cast<QOpenGLFunctions_2_0_CoreBackend*>(d); | - |
171 | d->refs.ref(); | - |
172 | | - |
173 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus()); | - |
174 | d_2_1_Core = static_cast<QOpenGLFunctions_2_1_CoreBackend*>(d); | - |
175 | d->refs.ref(); | - |
176 | | - |
177 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus()); | - |
178 | d_1_0_Deprecated = static_cast<QOpenGLFunctions_1_0_DeprecatedBackend*>(d); | - |
179 | d->refs.ref(); | - |
180 | | - |
181 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus()); | - |
182 | d_1_1_Deprecated = static_cast<QOpenGLFunctions_1_1_DeprecatedBackend*>(d); | - |
183 | d->refs.ref(); | - |
184 | | - |
185 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus()); | - |
186 | d_1_2_Deprecated = static_cast<QOpenGLFunctions_1_2_DeprecatedBackend*>(d); | - |
187 | d->refs.ref(); | - |
188 | | - |
189 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus()); | - |
190 | d_1_3_Deprecated = static_cast<QOpenGLFunctions_1_3_DeprecatedBackend*>(d); | - |
191 | d->refs.ref(); | - |
192 | | - |
193 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus()); | - |
194 | d_1_4_Deprecated = static_cast<QOpenGLFunctions_1_4_DeprecatedBackend*>(d); | - |
195 | d->refs.ref(); | - |
196 | | - |
197 | QAbstractOpenGLFunctions::initializeOpenGLFunctions(); | - |
198 | } never executed: end of block | 0 |
199 | return isInitialized(); never executed: return isInitialized(); | 0 |
200 | } | - |
201 | | - |
202 | bool QOpenGLFunctions_2_1::isContextCompatible(QOpenGLContext *context) | - |
203 | { | - |
204 | Q_ASSERT(context); | - |
205 | QSurfaceFormat f = context->format(); | - |
206 | const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion()); | - |
207 | if (v < qMakePair(2, 1))TRUE | never evaluated | FALSE | never evaluated |
| 0 |
208 | return false; never executed: return false; | 0 |
209 | | - |
210 | if (f.profile() == QSurfaceFormat::CoreProfile)TRUE | never evaluated | FALSE | never evaluated |
| 0 |
211 | return false; never executed: return false; | 0 |
212 | | - |
213 | return true; never executed: return true; | 0 |
214 | } | - |
215 | | - |
216 | QOpenGLVersionProfile QOpenGLFunctions_2_1::versionProfile() | - |
217 | { | - |
218 | QOpenGLVersionProfile v; | - |
219 | v.setVersion(2, 1); | - |
220 | return v; never executed: return v; | 0 |
221 | } | - |
222 | | - |
223 | QT_END_NAMESPACE | - |
| | |