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