Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/gui/opengl/qopenglfunctions_1_5.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||
2 | - | |||||||||||||||||||
3 | QOpenGLFunctions_1_5::QOpenGLFunctions_1_5() | - | ||||||||||||||||||
4 | : QAbstractOpenGLFunctions() | - | ||||||||||||||||||
5 | , d_1_0_Core(0) | - | ||||||||||||||||||
6 | , d_1_1_Core(0) | - | ||||||||||||||||||
7 | , d_1_2_Core(0) | - | ||||||||||||||||||
8 | , d_1_3_Core(0) | - | ||||||||||||||||||
9 | , d_1_4_Core(0) | - | ||||||||||||||||||
10 | , d_1_5_Core(0) | - | ||||||||||||||||||
11 | , d_1_0_Deprecated(0) | - | ||||||||||||||||||
12 | , d_1_1_Deprecated(0) | - | ||||||||||||||||||
13 | , d_1_2_Deprecated(0) | - | ||||||||||||||||||
14 | , d_1_3_Deprecated(0) | - | ||||||||||||||||||
15 | , d_1_4_Deprecated(0) | - | ||||||||||||||||||
16 | { | - | ||||||||||||||||||
17 | } | - | ||||||||||||||||||
18 | - | |||||||||||||||||||
19 | QOpenGLFunctions_1_5::~QOpenGLFunctions_1_5() | - | ||||||||||||||||||
20 | { | - | ||||||||||||||||||
21 | if (d_1_0_Core&& !
| 0 | ||||||||||||||||||
22 | d_1_0_Core->refs.deref()) { never executed: d_1_0_Core->refs.deref(); | 0 | ||||||||||||||||||
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend( never executed: d_1_0_Core->refs.deref(); never executed: ();d_1_0_Core->refs.deref(); never executed: d_1_0_Core->refs.deref(); | ||||||||||||||||||||
23 | ((!(d_1_0_Core->contextrefs.load())) ? qt_assert("d_1_0_Core->refs.load()",QOpenGLFunctions_1_0_CoreBackend::versionStatus__FILE__,88) : qt_noop()); | - | ||||||||||||||||||
24 | delete d_1_0_Core; | 0 | ||||||||||||||||||
}if (d_1_1_Core&& !
| ||||||||||||||||||||
25 | d_1_1_Core->refs.deref()) { never executed: d_1_1_Core->refs.deref(); | 0 | ||||||||||||||||||
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend( never executed: d_1_1_Core->refs.deref(); never executed: ();d_1_1_Core->refs.deref(); never executed: d_1_1_Core->refs.deref(); | ||||||||||||||||||||
26 | ((!(d_1_1_Core->contextrefs.load())) ? qt_assert("d_1_1_Core->refs.load()",QOpenGLFunctions_1_1_CoreBackend::versionStatus__FILE__,91) : qt_noop()); | - | ||||||||||||||||||
27 | delete d_1_1_Core; | 0 | ||||||||||||||||||
}if (d_1_2_Core&& !
| ||||||||||||||||||||
28 | d_1_2_Core->refs.deref()) { never executed: d_1_2_Core->refs.deref(); | 0 | ||||||||||||||||||
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend( never executed: d_1_2_Core->refs.deref(); never executed: ();d_1_2_Core->refs.deref(); never executed: d_1_2_Core->refs.deref(); | ||||||||||||||||||||
29 | ((!(d_1_2_Core->contextrefs.load())) ? qt_assert("d_1_2_Core->refs.load()",QOpenGLFunctions_1_2_CoreBackend::versionStatus__FILE__,94) : qt_noop()); | - | ||||||||||||||||||
30 | delete d_1_2_Core; | 0 | ||||||||||||||||||
}if (d_1_3_Core&& !
| ||||||||||||||||||||
31 | d_1_3_Core->refs.deref()) { never executed: d_1_3_Core->refs.deref(); | 0 | ||||||||||||||||||
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend( never executed: d_1_3_Core->refs.deref(); never executed: ();d_1_3_Core->refs.deref(); never executed: d_1_3_Core->refs.deref(); | ||||||||||||||||||||
32 | ((!(d_1_3_Core->contextrefs.load())) ? qt_assert("d_1_3_Core->refs.load()",QOpenGLFunctions_1_3_CoreBackend::versionStatus__FILE__,97) : qt_noop()); | - | ||||||||||||||||||
33 | delete d_1_3_Core; | 0 | ||||||||||||||||||
}if (d_1_4_Core&& !
| ||||||||||||||||||||
34 | d_1_4_Core->refs.deref()) { never executed: d_1_4_Core->refs.deref(); | 0 | ||||||||||||||||||
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend( never executed: d_1_4_Core->refs.deref(); never executed: ();d_1_4_Core->refs.deref(); never executed: d_1_4_Core->refs.deref(); | ||||||||||||||||||||
35 | ((!(d_1_4_Core->contextrefs.load())) ? qt_assert("d_1_4_Core->refs.load()",QOpenGLFunctions_1_4_CoreBackend::versionStatus__FILE__,100) : qt_noop()); | - | ||||||||||||||||||
36 | delete d_1_4_Core; | 0 | ||||||||||||||||||
}if (d_1_5_Core&& !
| ||||||||||||||||||||
37 | d_1_5_Core->refs.deref()) { never executed: d_1_5_Core->refs.deref(); | 0 | ||||||||||||||||||
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend( never executed: d_1_5_Core->refs.deref(); never executed: ();d_1_5_Core->refs.deref(); never executed: d_1_5_Core->refs.deref(); | ||||||||||||||||||||
38 | ((!(d_1_5_Core->contextrefs.load())) ? qt_assert("d_1_5_Core->refs.load()",QOpenGLFunctions_1_5_CoreBackend::versionStatus__FILE__,103) : qt_noop()); | - | ||||||||||||||||||
39 | delete d_1_5_Core; | 0 | ||||||||||||||||||
}if (d_1_0_Deprecated&& !
| ||||||||||||||||||||
40 | d_1_0_Deprecated->refs.deref()) { never executed: d_1_0_Deprecated->refs.deref(); | 0 | ||||||||||||||||||
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend( never executed: d_1_0_Deprecated->refs.deref(); never executed: ();d_1_0_Deprecated->refs.deref(); never executed: d_1_0_Deprecated->refs.deref(); | ||||||||||||||||||||
41 | ((!(d_1_0_Deprecated->contextrefs.load())) ? qt_assert("d_1_0_Deprecated->refs.load()",QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus__FILE__,106) : qt_noop()); | - | ||||||||||||||||||
42 | delete d_1_0_Deprecated; | 0 | ||||||||||||||||||
}if (d_1_1_Deprecated&& !
| ||||||||||||||||||||
43 | d_1_1_Deprecated->refs.deref()) { never executed: d_1_1_Deprecated->refs.deref(); | 0 | ||||||||||||||||||
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend( never executed: d_1_1_Deprecated->refs.deref(); never executed: ();d_1_1_Deprecated->refs.deref(); never executed: d_1_1_Deprecated->refs.deref(); | ||||||||||||||||||||
44 | ((!(d_1_1_Deprecated->contextrefs.load())) ? qt_assert("d_1_1_Deprecated->refs.load()",QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus__FILE__,109) : qt_noop()); | - | ||||||||||||||||||
45 | delete d_1_1_Deprecated; | 0 | ||||||||||||||||||
}if (d_1_2_Deprecated&& !
| ||||||||||||||||||||
46 | d_1_2_Deprecated->refs.deref()) { never executed: d_1_2_Deprecated->refs.deref(); | 0 | ||||||||||||||||||
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend( never executed: d_1_2_Deprecated->refs.deref(); never executed: ();d_1_2_Deprecated->refs.deref(); never executed: d_1_2_Deprecated->refs.deref(); | ||||||||||||||||||||
47 | ((!(d_1_2_Deprecated->contextrefs.load())) ? qt_assert("d_1_2_Deprecated->refs.load()",QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus__FILE__,112) : qt_noop()); | - | ||||||||||||||||||
48 | delete d_1_2_Deprecated; | 0 | ||||||||||||||||||
}if (d_1_3_Deprecated&& !
| ||||||||||||||||||||
49 | d_1_3_Deprecated->refs.deref()) { never executed: d_1_3_Deprecated->refs.deref(); | 0 | ||||||||||||||||||
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend( never executed: d_1_3_Deprecated->refs.deref(); never executed: ();d_1_3_Deprecated->refs.deref(); never executed: d_1_3_Deprecated->refs.deref(); | ||||||||||||||||||||
50 | ((!(d_1_3_Deprecated->contextrefs.load())) ? qt_assert("d_1_3_Deprecated->refs.load()",QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus__FILE__,115) : qt_noop()); | - | ||||||||||||||||||
51 | delete d_1_3_Deprecated; | 0 | ||||||||||||||||||
}if (d_1_4_Deprecated&& !
| ||||||||||||||||||||
52 | d_1_4_Deprecated->refs.deref()) { never executed: d_1_4_Deprecated->refs.deref(); | 0 | ||||||||||||||||||
QAbstractOpenGLFunctionsPrivate::removeFunctionsBackend( never executed: d_1_4_Deprecated->refs.deref(); never executed: ();d_1_4_Deprecated->refs.deref(); never executed: d_1_4_Deprecated->refs.deref(); | ||||||||||||||||||||
53 | ((!(d_1_4_Deprecated->contextrefs.load())) ? qt_assert("d_1_4_Deprecated->refs.load()",QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus__FILE__,118) : qt_noop()); | - | ||||||||||||||||||
delete d_1_4_Deprecated; | ||||||||||||||||||||
}} never executed: end of block | ||||||||||||||||||||
55 | - | |||||||||||||||||||
56 | bool QOpenGLFunctions_1_5::initializeOpenGLFunctions() | - | ||||||||||||||||||
57 | { | - | ||||||||||||||||||
58 | if ( isInitialized()
| 0 | ||||||||||||||||||
59 | return never executed: true;return true; never executed: return true; | 0 | ||||||||||||||||||
60 | - | |||||||||||||||||||
61 | QOpenGLContext* context = QOpenGLContext::currentContext(); | - | ||||||||||||||||||
62 | - | |||||||||||||||||||
63 | - | |||||||||||||||||||
64 | - | |||||||||||||||||||
65 | if (((owningContext()
| 0 | ||||||||||||||||||
66 | && QOpenGLFunctions_1_5::isContextCompatible(context)
| 0 | ||||||||||||||||||
67 | { | - | ||||||||||||||||||
68 | - | |||||||||||||||||||
69 | - | |||||||||||||||||||
70 | QOpenGLVersionFunctionsBackend* d = 0; | - | ||||||||||||||||||
71 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus()); | - | ||||||||||||||||||
72 | if (!d) { | - | ||||||||||||||||||
d = new QOpenGLFunctions_1_0_CoreBackend(context); | ||||||||||||||||||||
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus(), d); | ||||||||||||||||||||
}d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d); | ||||||||||||||||||||
73 | d->refs.ref(); | - | ||||||||||||||||||
74 | - | |||||||||||||||||||
75 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus()); | - | ||||||||||||||||||
76 | if (!d) { | - | ||||||||||||||||||
d = new QOpenGLFunctions_1_1_CoreBackend(context); | ||||||||||||||||||||
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus(), d); | ||||||||||||||||||||
}d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d); | ||||||||||||||||||||
77 | d->refs.ref(); | - | ||||||||||||||||||
78 | - | |||||||||||||||||||
79 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus()); | - | ||||||||||||||||||
80 | if (!d) { | - | ||||||||||||||||||
d = new QOpenGLFunctions_1_2_CoreBackend(context); | ||||||||||||||||||||
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus(), d); | ||||||||||||||||||||
}d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d); | ||||||||||||||||||||
81 | d->refs.ref(); | - | ||||||||||||||||||
82 | - | |||||||||||||||||||
83 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus()); | - | ||||||||||||||||||
84 | if (!d) { | - | ||||||||||||||||||
d = new QOpenGLFunctions_1_3_CoreBackend(context); | ||||||||||||||||||||
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus(), d); | ||||||||||||||||||||
}d_1_3_Core = static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d); | ||||||||||||||||||||
85 | d->refs.ref(); | - | ||||||||||||||||||
86 | - | |||||||||||||||||||
87 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus()); | - | ||||||||||||||||||
88 | if (!d) { | - | ||||||||||||||||||
d = new QOpenGLFunctions_1_4_CoreBackend(context); | ||||||||||||||||||||
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus(), d); | ||||||||||||||||||||
}d_1_4_Core = static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d); | ||||||||||||||||||||
89 | d->refs.ref(); | - | ||||||||||||||||||
90 | - | |||||||||||||||||||
91 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus()); | - | ||||||||||||||||||
92 | if (!d) { | - | ||||||||||||||||||
d = new QOpenGLFunctions_1_5_CoreBackend(context); | ||||||||||||||||||||
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus(), d); | ||||||||||||||||||||
}d_1_5_Core = static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d); | ||||||||||||||||||||
93 | d->refs.ref(); | - | ||||||||||||||||||
94 | - | |||||||||||||||||||
95 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus()); | - | ||||||||||||||||||
96 | if (!d) { | - | ||||||||||||||||||
d = new QOpenGLFunctions_1_0_DeprecatedBackend(context); | ||||||||||||||||||||
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus(), d); | ||||||||||||||||||||
}d_1_0_Deprecated = static_cast<QOpenGLFunctions_1_0_DeprecatedBackend*>(d); | ||||||||||||||||||||
97 | d->refs.ref(); | - | ||||||||||||||||||
98 | - | |||||||||||||||||||
99 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus()); | - | ||||||||||||||||||
100 | if (!d) { | - | ||||||||||||||||||
d = new QOpenGLFunctions_1_1_DeprecatedBackend(context); | ||||||||||||||||||||
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus(), d); | ||||||||||||||||||||
}d_1_1_Deprecated = static_cast<QOpenGLFunctions_1_1_DeprecatedBackend*>(d); | ||||||||||||||||||||
101 | d->refs.ref(); | - | ||||||||||||||||||
102 | - | |||||||||||||||||||
103 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus()); | - | ||||||||||||||||||
104 | if (!d) { | - | ||||||||||||||||||
d = new QOpenGLFunctions_1_2_DeprecatedBackend(context); | ||||||||||||||||||||
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus(), d); | ||||||||||||||||||||
}d_1_2_Deprecated = static_cast<QOpenGLFunctions_1_2_DeprecatedBackend*>(d); | ||||||||||||||||||||
105 | d->refs.ref(); | - | ||||||||||||||||||
106 | - | |||||||||||||||||||
107 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus()); | - | ||||||||||||||||||
108 | if (!d) { | - | ||||||||||||||||||
d = new QOpenGLFunctions_1_3_DeprecatedBackend(context); | ||||||||||||||||||||
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus(), d); | ||||||||||||||||||||
}d_1_3_Deprecated = static_cast<QOpenGLFunctions_1_3_DeprecatedBackend*>(d); | ||||||||||||||||||||
109 | d->refs.ref(); | - | ||||||||||||||||||
110 | - | |||||||||||||||||||
111 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus()); | - | ||||||||||||||||||
112 | if (!d) { | - | ||||||||||||||||||
d = new QOpenGLFunctions_1_4_DeprecatedBackend(context); | ||||||||||||||||||||
QAbstractOpenGLFunctionsPrivate::insertFunctionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus(), d); | ||||||||||||||||||||
}d_1_4_Deprecated = static_cast<QOpenGLFunctions_1_4_DeprecatedBackend*>(d); | ||||||||||||||||||||
113 | d->refs.ref(); | - | ||||||||||||||||||
114 | - | |||||||||||||||||||
115 | QAbstractOpenGLFunctions::initializeOpenGLFunctions(); | - | ||||||||||||||||||
116 | } never executed: end of block | 0 | ||||||||||||||||||
117 | return never executed: isInitialized();return isInitialized(); never executed: return isInitialized(); | 0 | ||||||||||||||||||
118 | } | - | ||||||||||||||||||
119 | - | |||||||||||||||||||
120 | bool QOpenGLFunctions_1_5::isContextCompatible(QOpenGLContext *context) | - | ||||||||||||||||||
121 | { | - | ||||||||||||||||||
122 | ((!(context)) ? qt_assert("context",__FILE__,236187) : qt_noop()); | - | ||||||||||||||||||
123 | QSurfaceFormat f = context->format(); | - | ||||||||||||||||||
124 | const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion()); | - | ||||||||||||||||||
125 | if (v < qMakePair(1, 5)) | - | ||||||||||||||||||
126 | return false; | - | ||||||||||||||||||
127 | - | |||||||||||||||||||
128 | if (f.profile() == QSurfaceFormat::CoreProfile) | - | ||||||||||||||||||
129 | return false; | - | ||||||||||||||||||
130 | - | |||||||||||||||||||
131 | return true; | - | ||||||||||||||||||
132 | } | - | ||||||||||||||||||
133 | - | |||||||||||||||||||
134 | QOpenGLVersionProfile QOpenGLFunctions_1_5::versionProfile() | - | ||||||||||||||||||
135 | { | - | ||||||||||||||||||
136 | QOpenGLVersionProfile v; | - | ||||||||||||||||||
137 | v.setVersion(1, 5); | - | ||||||||||||||||||
138 | return v; | - | ||||||||||||||||||
139 | } | - | ||||||||||||||||||
140 | - | |||||||||||||||||||
141 | - | |||||||||||||||||||
Switch to Source code | Preprocessed file |