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