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