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