| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/gui/opengl/qopenglfunctions_3_3_compatibility.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||
| 2 | - | |||||||||||||||||||
| 3 | QOpenGLFunctions_3_3_Compatibility::QOpenGLFunctions_3_3_Compatibility() | - | ||||||||||||||||||
| 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_2_0_Core(0) | - | ||||||||||||||||||
| 12 | , d_2_1_Core(0) | - | ||||||||||||||||||
| 13 | , d_3_0_Core(0) | - | ||||||||||||||||||
| 14 | , d_3_1_Core(0) | - | ||||||||||||||||||
| 15 | , d_3_2_Core(0) | - | ||||||||||||||||||
| 16 | , d_3_3_Core(0) | - | ||||||||||||||||||
| 17 | , d_1_0_Deprecated(0) | - | ||||||||||||||||||
| 18 | , d_1_1_Deprecated(0) | - | ||||||||||||||||||
| 19 | , d_1_2_Deprecated(0) | - | ||||||||||||||||||
| 20 | , d_1_3_Deprecated(0) | - | ||||||||||||||||||
| 21 | , d_1_4_Deprecated(0) | - | ||||||||||||||||||
| 22 | , m_reserved_2_0_Deprecated(nullptr) | - | ||||||||||||||||||
| 23 | , d_3_3_Deprecated(0) | - | ||||||||||||||||||
| 24 | { | - | ||||||||||||||||||
| 25 | } never executed: end of block | 0 | ||||||||||||||||||
| 26 | - | |||||||||||||||||||
| 27 | QOpenGLFunctions_3_3_Compatibility::~QOpenGLFunctions_3_3_Compatibility() | - | ||||||||||||||||||
| 28 | { | - | ||||||||||||||||||
| 29 | if (d_1_0_Core
| 0 | ||||||||||||||||||
| 30 | d_1_0_Core->refs.deref(); never executed: d_1_0_Core->refs.deref(); | 0 | ||||||||||||||||||
| 31 | ((!(d_1_0_Core->refs.load())) ? qt_assert("d_1_0_Core->refs.load()",__FILE__,96) : qt_noop()); | - | ||||||||||||||||||
| 32 | if (d_1_1_Core
| 0 | ||||||||||||||||||
| 33 | d_1_1_Core->refs.deref(); never executed: d_1_1_Core->refs.deref(); | 0 | ||||||||||||||||||
| 34 | ((!(d_1_1_Core->refs.load())) ? qt_assert("d_1_1_Core->refs.load()",__FILE__,99) : qt_noop()); | - | ||||||||||||||||||
| 35 | if (d_1_2_Core
| 0 | ||||||||||||||||||
| 36 | d_1_2_Core->refs.deref(); never executed: d_1_2_Core->refs.deref(); | 0 | ||||||||||||||||||
| 37 | ((!(d_1_2_Core->refs.load())) ? qt_assert("d_1_2_Core->refs.load()",__FILE__,102) : qt_noop()); | - | ||||||||||||||||||
| 38 | if (d_1_3_Core
| 0 | ||||||||||||||||||
| 39 | d_1_3_Core->refs.deref(); never executed: d_1_3_Core->refs.deref(); | 0 | ||||||||||||||||||
| 40 | ((!(d_1_3_Core->refs.load())) ? qt_assert("d_1_3_Core->refs.load()",__FILE__,105) : qt_noop()); | - | ||||||||||||||||||
| 41 | if (d_1_4_Core
| 0 | ||||||||||||||||||
| 42 | d_1_4_Core->refs.deref(); never executed: d_1_4_Core->refs.deref(); | 0 | ||||||||||||||||||
| 43 | ((!(d_1_4_Core->refs.load())) ? qt_assert("d_1_4_Core->refs.load()",__FILE__,108) : qt_noop()); | - | ||||||||||||||||||
| 44 | if (d_1_5_Core
| 0 | ||||||||||||||||||
| 45 | d_1_5_Core->refs.deref(); never executed: d_1_5_Core->refs.deref(); | 0 | ||||||||||||||||||
| 46 | ((!(d_1_5_Core->refs.load())) ? qt_assert("d_1_5_Core->refs.load()",__FILE__,111) : qt_noop()); | - | ||||||||||||||||||
| 47 | if (d_2_0_Core
| 0 | ||||||||||||||||||
| 48 | d_2_0_Core->refs.deref(); never executed: d_2_0_Core->refs.deref(); | 0 | ||||||||||||||||||
| 49 | ((!(d_2_0_Core->refs.load())) ? qt_assert("d_2_0_Core->refs.load()",__FILE__,114) : qt_noop()); | - | ||||||||||||||||||
| 50 | if (d_2_1_Core
| 0 | ||||||||||||||||||
| 51 | d_2_1_Core->refs.deref(); never executed: d_2_1_Core->refs.deref(); | 0 | ||||||||||||||||||
| 52 | ((!(d_2_1_Core->refs.load())) ? qt_assert("d_2_1_Core->refs.load()",__FILE__,117) : qt_noop()); | - | ||||||||||||||||||
| 53 | if (d_3_0_Core
| 0 | ||||||||||||||||||
| 54 | d_3_0_Core->refs.deref(); never executed: d_3_0_Core->refs.deref(); | 0 | ||||||||||||||||||
| 55 | ((!(d_3_0_Core->refs.load())) ? qt_assert("d_3_0_Core->refs.load()",__FILE__,120) : qt_noop()); | - | ||||||||||||||||||
| 56 | if (d_3_1_Core
| 0 | ||||||||||||||||||
| 57 | d_3_1_Core->refs.deref(); never executed: d_3_1_Core->refs.deref(); | 0 | ||||||||||||||||||
| 58 | ((!(d_3_1_Core->refs.load())) ? qt_assert("d_3_1_Core->refs.load()",__FILE__,123) : qt_noop()); | - | ||||||||||||||||||
| 59 | if (d_3_2_Core
| 0 | ||||||||||||||||||
| 60 | d_3_2_Core->refs.deref(); never executed: d_3_2_Core->refs.deref(); | 0 | ||||||||||||||||||
| 61 | ((!(d_3_2_Core->refs.load())) ? qt_assert("d_3_2_Core->refs.load()",__FILE__,126) : qt_noop()); | - | ||||||||||||||||||
| 62 | if (d_3_3_Core
| 0 | ||||||||||||||||||
| 63 | d_3_3_Core->refs.deref(); never executed: d_3_3_Core->refs.deref(); | 0 | ||||||||||||||||||
| 64 | ((!(d_3_3_Core->refs.load())) ? qt_assert("d_3_3_Core->refs.load()",__FILE__,129) : qt_noop()); | - | ||||||||||||||||||
| 65 | if (d_1_0_Deprecated
| 0 | ||||||||||||||||||
| 66 | d_1_0_Deprecated->refs.deref(); never executed: d_1_0_Deprecated->refs.deref(); | 0 | ||||||||||||||||||
| 67 | ((!(d_1_0_Deprecated->refs.load())) ? qt_assert("d_1_0_Deprecated->refs.load()",__FILE__,132) : qt_noop()); | - | ||||||||||||||||||
| 68 | if (d_1_1_Deprecated
| 0 | ||||||||||||||||||
| 69 | d_1_1_Deprecated->refs.deref(); never executed: d_1_1_Deprecated->refs.deref(); | 0 | ||||||||||||||||||
| 70 | ((!(d_1_1_Deprecated->refs.load())) ? qt_assert("d_1_1_Deprecated->refs.load()",__FILE__,135) : qt_noop()); | - | ||||||||||||||||||
| 71 | if (d_1_2_Deprecated
| 0 | ||||||||||||||||||
| 72 | d_1_2_Deprecated->refs.deref(); never executed: d_1_2_Deprecated->refs.deref(); | 0 | ||||||||||||||||||
| 73 | ((!(d_1_2_Deprecated->refs.load())) ? qt_assert("d_1_2_Deprecated->refs.load()",__FILE__,138) : qt_noop()); | - | ||||||||||||||||||
| 74 | if (d_1_3_Deprecated
| 0 | ||||||||||||||||||
| 75 | d_1_3_Deprecated->refs.deref(); never executed: d_1_3_Deprecated->refs.deref(); | 0 | ||||||||||||||||||
| 76 | ((!(d_1_3_Deprecated->refs.load())) ? qt_assert("d_1_3_Deprecated->refs.load()",__FILE__,141) : qt_noop()); | - | ||||||||||||||||||
| 77 | if (d_1_4_Deprecated
| 0 | ||||||||||||||||||
| 78 | d_1_4_Deprecated->refs.deref(); never executed: d_1_4_Deprecated->refs.deref(); | 0 | ||||||||||||||||||
| 79 | ((!(d_1_4_Deprecated->refs.load())) ? qt_assert("d_1_4_Deprecated->refs.load()",__FILE__,144) : qt_noop()); | - | ||||||||||||||||||
| 80 | if (d_3_3_Deprecated
| 0 | ||||||||||||||||||
| 81 | d_3_3_Deprecated->refs.deref(); never executed: d_3_3_Deprecated->refs.deref(); | 0 | ||||||||||||||||||
| 82 | ((!(d_3_3_Deprecated->refs.load())) ? qt_assert("d_3_3_Deprecated->refs.load()",__FILE__,147) : qt_noop()); | - | ||||||||||||||||||
| 83 | } never executed: end of block | 0 | ||||||||||||||||||
| 84 | - | |||||||||||||||||||
| 85 | bool QOpenGLFunctions_3_3_Compatibility::initializeOpenGLFunctions() | - | ||||||||||||||||||
| 86 | { | - | ||||||||||||||||||
| 87 | if ( isInitialized()
| 0 | ||||||||||||||||||
| 88 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||
| 89 | - | |||||||||||||||||||
| 90 | QOpenGLContext* context = QOpenGLContext::currentContext(); | - | ||||||||||||||||||
| 91 | - | |||||||||||||||||||
| 92 | - | |||||||||||||||||||
| 93 | - | |||||||||||||||||||
| 94 | if (((owningContext()
| 0 | ||||||||||||||||||
| 95 | && QOpenGLFunctions_3_3_Compatibility::isContextCompatible(context)
| 0 | ||||||||||||||||||
| 96 | { | - | ||||||||||||||||||
| 97 | - | |||||||||||||||||||
| 98 | - | |||||||||||||||||||
| 99 | QOpenGLVersionFunctionsBackend* d = 0; | - | ||||||||||||||||||
| 100 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus()); | - | ||||||||||||||||||
| 101 | d_1_0_Core = static_cast<QOpenGLFunctions_1_0_CoreBackend*>(d); | - | ||||||||||||||||||
| 102 | d->refs.ref(); | - | ||||||||||||||||||
| 103 | - | |||||||||||||||||||
| 104 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus()); | - | ||||||||||||||||||
| 105 | d_1_1_Core = static_cast<QOpenGLFunctions_1_1_CoreBackend*>(d); | - | ||||||||||||||||||
| 106 | d->refs.ref(); | - | ||||||||||||||||||
| 107 | - | |||||||||||||||||||
| 108 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus()); | - | ||||||||||||||||||
| 109 | d_1_2_Core = static_cast<QOpenGLFunctions_1_2_CoreBackend*>(d); | - | ||||||||||||||||||
| 110 | d->refs.ref(); | - | ||||||||||||||||||
| 111 | - | |||||||||||||||||||
| 112 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_CoreBackend::versionStatus()); | - | ||||||||||||||||||
| 113 | d_1_3_Core = static_cast<QOpenGLFunctions_1_3_CoreBackend*>(d); | - | ||||||||||||||||||
| 114 | d->refs.ref(); | - | ||||||||||||||||||
| 115 | - | |||||||||||||||||||
| 116 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_CoreBackend::versionStatus()); | - | ||||||||||||||||||
| 117 | d_1_4_Core = static_cast<QOpenGLFunctions_1_4_CoreBackend*>(d); | - | ||||||||||||||||||
| 118 | d->refs.ref(); | - | ||||||||||||||||||
| 119 | - | |||||||||||||||||||
| 120 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_5_CoreBackend::versionStatus()); | - | ||||||||||||||||||
| 121 | d_1_5_Core = static_cast<QOpenGLFunctions_1_5_CoreBackend*>(d); | - | ||||||||||||||||||
| 122 | d->refs.ref(); | - | ||||||||||||||||||
| 123 | - | |||||||||||||||||||
| 124 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_0_CoreBackend::versionStatus()); | - | ||||||||||||||||||
| 125 | d_2_0_Core = static_cast<QOpenGLFunctions_2_0_CoreBackend*>(d); | - | ||||||||||||||||||
| 126 | d->refs.ref(); | - | ||||||||||||||||||
| 127 | - | |||||||||||||||||||
| 128 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_2_1_CoreBackend::versionStatus()); | - | ||||||||||||||||||
| 129 | d_2_1_Core = static_cast<QOpenGLFunctions_2_1_CoreBackend*>(d); | - | ||||||||||||||||||
| 130 | d->refs.ref(); | - | ||||||||||||||||||
| 131 | - | |||||||||||||||||||
| 132 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_0_CoreBackend::versionStatus()); | - | ||||||||||||||||||
| 133 | d_3_0_Core = static_cast<QOpenGLFunctions_3_0_CoreBackend*>(d); | - | ||||||||||||||||||
| 134 | d->refs.ref(); | - | ||||||||||||||||||
| 135 | - | |||||||||||||||||||
| 136 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_1_CoreBackend::versionStatus()); | - | ||||||||||||||||||
| 137 | d_3_1_Core = static_cast<QOpenGLFunctions_3_1_CoreBackend*>(d); | - | ||||||||||||||||||
| 138 | d->refs.ref(); | - | ||||||||||||||||||
| 139 | - | |||||||||||||||||||
| 140 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_2_CoreBackend::versionStatus()); | - | ||||||||||||||||||
| 141 | d_3_2_Core = static_cast<QOpenGLFunctions_3_2_CoreBackend*>(d); | - | ||||||||||||||||||
| 142 | d->refs.ref(); | - | ||||||||||||||||||
| 143 | - | |||||||||||||||||||
| 144 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_3_CoreBackend::versionStatus()); | - | ||||||||||||||||||
| 145 | d_3_3_Core = static_cast<QOpenGLFunctions_3_3_CoreBackend*>(d); | - | ||||||||||||||||||
| 146 | d->refs.ref(); | - | ||||||||||||||||||
| 147 | - | |||||||||||||||||||
| 148 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus()); | - | ||||||||||||||||||
| 149 | d_1_0_Deprecated = static_cast<QOpenGLFunctions_1_0_DeprecatedBackend*>(d); | - | ||||||||||||||||||
| 150 | d->refs.ref(); | - | ||||||||||||||||||
| 151 | - | |||||||||||||||||||
| 152 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus()); | - | ||||||||||||||||||
| 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 | d_1_2_Deprecated = static_cast<QOpenGLFunctions_1_2_DeprecatedBackend*>(d); | - | ||||||||||||||||||
| 158 | d->refs.ref(); | - | ||||||||||||||||||
| 159 | - | |||||||||||||||||||
| 160 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_3_DeprecatedBackend::versionStatus()); | - | ||||||||||||||||||
| 161 | d_1_3_Deprecated = static_cast<QOpenGLFunctions_1_3_DeprecatedBackend*>(d); | - | ||||||||||||||||||
| 162 | d->refs.ref(); | - | ||||||||||||||||||
| 163 | - | |||||||||||||||||||
| 164 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_4_DeprecatedBackend::versionStatus()); | - | ||||||||||||||||||
| 165 | d_1_4_Deprecated = static_cast<QOpenGLFunctions_1_4_DeprecatedBackend*>(d); | - | ||||||||||||||||||
| 166 | d->refs.ref(); | - | ||||||||||||||||||
| 167 | - | |||||||||||||||||||
| 168 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_3_3_DeprecatedBackend::versionStatus()); | - | ||||||||||||||||||
| 169 | d_3_3_Deprecated = static_cast<QOpenGLFunctions_3_3_DeprecatedBackend*>(d); | - | ||||||||||||||||||
| 170 | d->refs.ref(); | - | ||||||||||||||||||
| 171 | - | |||||||||||||||||||
| 172 | QAbstractOpenGLFunctions::initializeOpenGLFunctions(); | - | ||||||||||||||||||
| 173 | } never executed: end of block | 0 | ||||||||||||||||||
| 174 | return never executed: isInitialized();return isInitialized();never executed: return isInitialized(); | 0 | ||||||||||||||||||
| 175 | } | - | ||||||||||||||||||
| 176 | - | |||||||||||||||||||
| 177 | bool QOpenGLFunctions_3_3_Compatibility::isContextCompatible(QOpenGLContext *context) | - | ||||||||||||||||||
| 178 | { | - | ||||||||||||||||||
| 179 | ((!(context)) ? qt_assert("context",__FILE__,244) : qt_noop()); | - | ||||||||||||||||||
| 180 | QSurfaceFormat f = context->format(); | - | ||||||||||||||||||
| 181 | const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion()); | - | ||||||||||||||||||
| 182 | if (v < qMakePair(3, 3)
| 0 | ||||||||||||||||||
| 183 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 184 | - | |||||||||||||||||||
| 185 | if (f.profile() == QSurfaceFormat::CoreProfile
| 0 | ||||||||||||||||||
| 186 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 187 | - | |||||||||||||||||||
| 188 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||
| 189 | } | - | ||||||||||||||||||
| 190 | - | |||||||||||||||||||
| 191 | QOpenGLVersionProfile QOpenGLFunctions_3_3_Compatibility::versionProfile() | - | ||||||||||||||||||
| 192 | { | - | ||||||||||||||||||
| 193 | QOpenGLVersionProfile v; | - | ||||||||||||||||||
| 194 | v.setVersion(3, 3); | - | ||||||||||||||||||
| 195 | v.setProfile(QSurfaceFormat::CompatibilityProfile); | - | ||||||||||||||||||
| 196 | return never executed: v;return v;never executed: return v; | 0 | ||||||||||||||||||
| 197 | } | - | ||||||||||||||||||
| 198 | - | |||||||||||||||||||
| 199 | - | |||||||||||||||||||
| Switch to Source code | Preprocessed file |