| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/gui/opengl/qopenglfunctions_1_2.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||
| 2 | - | |||||||||||||||||||
| 3 | QOpenGLFunctions_1_2::QOpenGLFunctions_1_2() | - | ||||||||||||||||||
| 4 | : QAbstractOpenGLFunctions() | - | ||||||||||||||||||
| 5 | , d_1_0_Core(0) | - | ||||||||||||||||||
| 6 | , d_1_1_Core(0) | - | ||||||||||||||||||
| 7 | , d_1_2_Core(0) | - | ||||||||||||||||||
| 8 | , d_1_0_Deprecated(0) | - | ||||||||||||||||||
| 9 | , d_1_1_Deprecated(0) | - | ||||||||||||||||||
| 10 | , d_1_2_Deprecated(0) | - | ||||||||||||||||||
| 11 | { | - | ||||||||||||||||||
| 12 | } | - | ||||||||||||||||||
| 13 | - | |||||||||||||||||||
| 14 | QOpenGLFunctions_1_2::~QOpenGLFunctions_1_2() | - | ||||||||||||||||||
| 15 | { | - | ||||||||||||||||||
| 16 | if (d_1_0_Core&& !
| 0 | ||||||||||||||||||
| 17 | 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(); | ||||||||||||||||||||
| 18 | ((!(d_1_0_Core->contextrefs.load())) ? qt_assert("d_1_0_Core->refs.load()",QOpenGLFunctions_1_0_CoreBackend::versionStatus__FILE__,83) : qt_noop()); | - | ||||||||||||||||||
| 19 | delete d_1_0_Core; | 0 | ||||||||||||||||||
}if (d_1_1_Core&& !
| ||||||||||||||||||||
| 20 | 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(); | ||||||||||||||||||||
| 21 | ((!(d_1_1_Core->contextrefs.load())) ? qt_assert("d_1_1_Core->refs.load()",QOpenGLFunctions_1_1_CoreBackend::versionStatus__FILE__,86) : qt_noop()); | - | ||||||||||||||||||
| 22 | delete d_1_1_Core; | 0 | ||||||||||||||||||
}if (d_1_2_Core&& !
| ||||||||||||||||||||
| 23 | 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(); | ||||||||||||||||||||
| 24 | ((!(d_1_2_Core->contextrefs.load())) ? qt_assert("d_1_2_Core->refs.load()",QOpenGLFunctions_1_2_CoreBackend::versionStatus__FILE__,89) : qt_noop()); | - | ||||||||||||||||||
| 25 | delete d_1_2_Core; | 0 | ||||||||||||||||||
}if (d_1_0_Deprecated&& !
| ||||||||||||||||||||
| 26 | 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(); | ||||||||||||||||||||
| 27 | ((!(d_1_0_Deprecated->contextrefs.load())) ? qt_assert("d_1_0_Deprecated->refs.load()",QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus__FILE__,92) : qt_noop()); | - | ||||||||||||||||||
| 28 | delete d_1_0_Deprecated; | 0 | ||||||||||||||||||
}if (d_1_1_Deprecated&& !
| ||||||||||||||||||||
| 29 | 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(); | ||||||||||||||||||||
| 30 | ((!(d_1_1_Deprecated->contextrefs.load())) ? qt_assert("d_1_1_Deprecated->refs.load()",QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus__FILE__,95) : qt_noop()); | - | ||||||||||||||||||
| 31 | delete d_1_1_Deprecated; | 0 | ||||||||||||||||||
}if (d_1_2_Deprecated&& !
| ||||||||||||||||||||
| 32 | 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(); | ||||||||||||||||||||
| 33 | ((!(d_1_2_Deprecated->contextrefs.load())) ? qt_assert("d_1_2_Deprecated->refs.load()",QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus__FILE__,98) : qt_noop()); | - | ||||||||||||||||||
| delete d_1_2_Deprecated; | ||||||||||||||||||||
| }} never executed: end of block | ||||||||||||||||||||
| 35 | - | |||||||||||||||||||
| 36 | bool QOpenGLFunctions_1_2::initializeOpenGLFunctions() | - | ||||||||||||||||||
| 37 | { | - | ||||||||||||||||||
| 38 | if ( isInitialized()
| 0 | ||||||||||||||||||
| 39 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||
| 40 | - | |||||||||||||||||||
| 41 | QOpenGLContext* context = QOpenGLContext::currentContext(); | - | ||||||||||||||||||
| 42 | - | |||||||||||||||||||
| 43 | - | |||||||||||||||||||
| 44 | - | |||||||||||||||||||
| 45 | if (((owningContext()
| 0 | ||||||||||||||||||
| 46 | && QOpenGLFunctions_1_2::isContextCompatible(context)
| 0 | ||||||||||||||||||
| 47 | { | - | ||||||||||||||||||
| 48 | - | |||||||||||||||||||
| 49 | - | |||||||||||||||||||
| 50 | QOpenGLVersionFunctionsBackend* d = 0; | - | ||||||||||||||||||
| 51 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_CoreBackend::versionStatus()); | - | ||||||||||||||||||
| 52 | 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); | ||||||||||||||||||||
| 53 | d->refs.ref(); | - | ||||||||||||||||||
| 54 | - | |||||||||||||||||||
| 55 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_CoreBackend::versionStatus()); | - | ||||||||||||||||||
| 56 | 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); | ||||||||||||||||||||
| 57 | d->refs.ref(); | - | ||||||||||||||||||
| 58 | - | |||||||||||||||||||
| 59 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_CoreBackend::versionStatus()); | - | ||||||||||||||||||
| 60 | 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); | ||||||||||||||||||||
| 61 | d->refs.ref(); | - | ||||||||||||||||||
| 62 | - | |||||||||||||||||||
| 63 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_0_DeprecatedBackend::versionStatus()); | - | ||||||||||||||||||
| 64 | 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); | ||||||||||||||||||||
| 65 | d->refs.ref(); | - | ||||||||||||||||||
| 66 | - | |||||||||||||||||||
| 67 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_1_DeprecatedBackend::versionStatus()); | - | ||||||||||||||||||
| 68 | 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); | ||||||||||||||||||||
| 69 | d->refs.ref(); | - | ||||||||||||||||||
| 70 | - | |||||||||||||||||||
| 71 | d = QAbstractOpenGLFunctionsPrivate::functionsBackend(context, QOpenGLFunctions_1_2_DeprecatedBackend::versionStatus()); | - | ||||||||||||||||||
| 72 | 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); | ||||||||||||||||||||
| 73 | d->refs.ref(); | - | ||||||||||||||||||
| 74 | - | |||||||||||||||||||
| 75 | QAbstractOpenGLFunctions::initializeOpenGLFunctions(); | - | ||||||||||||||||||
| 76 | } never executed: end of block | 0 | ||||||||||||||||||
| 77 | return never executed: isInitialized();return isInitialized();never executed: return isInitialized(); | 0 | ||||||||||||||||||
| 78 | } | - | ||||||||||||||||||
| 79 | - | |||||||||||||||||||
| 80 | bool QOpenGLFunctions_1_2::isContextCompatible(QOpenGLContext *context) | - | ||||||||||||||||||
| 81 | { | - | ||||||||||||||||||
| 82 | ((!(context)) ? qt_assert("context",__FILE__,171147) : qt_noop()); | - | ||||||||||||||||||
| 83 | QSurfaceFormat f = context->format(); | - | ||||||||||||||||||
| 84 | const QPair<int, int> v = qMakePair(f.majorVersion(), f.minorVersion()); | - | ||||||||||||||||||
| 85 | if (v < qMakePair(1, 2)) | - | ||||||||||||||||||
| 86 | return false; | - | ||||||||||||||||||
| 87 | - | |||||||||||||||||||
| 88 | if (f.profile() == QSurfaceFormat::CoreProfile) | - | ||||||||||||||||||
| 89 | return false; | - | ||||||||||||||||||
| 90 | - | |||||||||||||||||||
| 91 | return true; | - | ||||||||||||||||||
| 92 | } | - | ||||||||||||||||||
| 93 | - | |||||||||||||||||||
| 94 | QOpenGLVersionProfile QOpenGLFunctions_1_2::versionProfile() | - | ||||||||||||||||||
| 95 | { | - | ||||||||||||||||||
| 96 | QOpenGLVersionProfile v; | - | ||||||||||||||||||
| 97 | v.setVersion(1, 2); | - | ||||||||||||||||||
| 98 | return v; | - | ||||||||||||||||||
| 99 | } | - | ||||||||||||||||||
| 100 | - | |||||||||||||||||||
| 101 | - | |||||||||||||||||||
| Switch to Source code | Preprocessed file |