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