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