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