| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickopenglinfo.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||
| 2 | - | |||||||
| 3 | QQuickOpenGLInfo::QQuickOpenGLInfo(QQuickItem *item) | - | ||||||
| 4 | : QObject(item) | - | ||||||
| 5 | , m_window(nullptr) | - | ||||||
| 6 | , m_majorVersion(2) | - | ||||||
| 7 | , m_minorVersion(0) | - | ||||||
| 8 | , m_profile(NoProfile) | - | ||||||
| 9 | , m_renderableType(Unspecified) | - | ||||||
| 10 | { | - | ||||||
| 11 | connect(item, qFlagLocation("2""windowChanged(QQuickWindow*)" "\0" __FILE__ ":" "78"), this, qFlagLocation("1""setWindow(QQuickWindow*)" "\0" __FILE__ ":" "78")); | - | ||||||
| 12 | setWindow(item->window()); | - | ||||||
| 13 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||
| 14 | int QQuickOpenGLInfo::majorVersion() const | - | ||||||
| 15 | { | - | ||||||
| 16 | return executed 2 times by 1 test: m_majorVersion;return m_majorVersion;Executed by:
executed 2 times by 1 test: return m_majorVersion;Executed by:
| 2 | ||||||
| 17 | } | - | ||||||
| 18 | int QQuickOpenGLInfo::minorVersion() const | - | ||||||
| 19 | { | - | ||||||
| 20 | return executed 2 times by 1 test: m_minorVersion;return m_minorVersion;Executed by:
executed 2 times by 1 test: return m_minorVersion;Executed by:
| 2 | ||||||
| 21 | } | - | ||||||
| 22 | QQuickOpenGLInfo::ContextProfile QQuickOpenGLInfo::profile() const | - | ||||||
| 23 | { | - | ||||||
| 24 | return executed 2 times by 1 test: m_profile;return m_profile;Executed by:
executed 2 times by 1 test: return m_profile;Executed by:
| 2 | ||||||
| 25 | } | - | ||||||
| 26 | QQuickOpenGLInfo::RenderableType QQuickOpenGLInfo::renderableType() const | - | ||||||
| 27 | { | - | ||||||
| 28 | return executed 2 times by 1 test: m_renderableType;return m_renderableType;Executed by:
executed 2 times by 1 test: return m_renderableType;Executed by:
| 2 | ||||||
| 29 | } | - | ||||||
| 30 | - | |||||||
| 31 | QQuickOpenGLInfo *QQuickOpenGLInfo::qmlAttachedProperties(QObject *object) | - | ||||||
| 32 | { | - | ||||||
| 33 | if (QQuickItem *item = qobject_cast<QQuickItem *>(object)
| 0-2 | ||||||
| 34 | return executed 2 times by 1 test: new QQuickOpenGLInfo(item);return new QQuickOpenGLInfo(item);Executed by:
executed 2 times by 1 test: return new QQuickOpenGLInfo(item);Executed by:
| 2 | ||||||
| 35 | return never executed: nullptr;return nullptr;never executed: return nullptr; | 0 | ||||||
| 36 | } | - | ||||||
| 37 | - | |||||||
| 38 | void QQuickOpenGLInfo::updateFormat() | - | ||||||
| 39 | { | - | ||||||
| 40 | QOpenGLContext *context = nullptr; | - | ||||||
| 41 | if (m_window
| 2-4 | ||||||
| 42 | context = m_window->openglContext(); executed 2 times by 1 test: context = m_window->openglContext();Executed by:
| 2 | ||||||
| 43 | QSurfaceFormat format = context
| 0-6 | ||||||
| 44 | - | |||||||
| 45 | if (m_majorVersion != format.majorVersion()
| 0-6 | ||||||
| 46 | m_majorVersion = format.majorVersion(); | - | ||||||
| 47 | majorVersionChanged(); | - | ||||||
| 48 | } never executed: end of block | 0 | ||||||
| 49 | - | |||||||
| 50 | if (m_minorVersion != format.minorVersion()
| 0-6 | ||||||
| 51 | m_minorVersion = format.minorVersion(); | - | ||||||
| 52 | minorVersionChanged(); | - | ||||||
| 53 | } never executed: end of block | 0 | ||||||
| 54 | - | |||||||
| 55 | ContextProfile profile = static_cast<ContextProfile>(format.profile()); | - | ||||||
| 56 | if (m_profile != profile
| 0-6 | ||||||
| 57 | m_profile = profile; | - | ||||||
| 58 | profileChanged(); | - | ||||||
| 59 | } never executed: end of block | 0 | ||||||
| 60 | - | |||||||
| 61 | RenderableType renderableType = static_cast<RenderableType>(format.renderableType()); | - | ||||||
| 62 | if (m_renderableType != renderableType
| 0-6 | ||||||
| 63 | m_renderableType = renderableType; | - | ||||||
| 64 | renderableTypeChanged(); | - | ||||||
| 65 | } never executed: end of block | 0 | ||||||
| 66 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||
| 67 | - | |||||||
| 68 | void QQuickOpenGLInfo::setWindow(QQuickWindow *window) | - | ||||||
| 69 | { | - | ||||||
| 70 | if (m_window != window
| 2-4 | ||||||
| 71 | if (m_window
| 2 | ||||||
| 72 | disconnect(m_window, qFlagLocation("2""sceneGraphInitialized()" "\0" __FILE__ ":" "190"), this, qFlagLocation("1""updateFormat()" "\0" __FILE__ ":" "190")); | - | ||||||
| 73 | disconnect(m_window, qFlagLocation("2""sceneGraphInvalidated()" "\0" __FILE__ ":" "191"), this, qFlagLocation("1""updateFormat()" "\0" __FILE__ ":" "191")); | - | ||||||
| 74 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||
| 75 | if (window
| 2 | ||||||
| 76 | connect(window, qFlagLocation("2""sceneGraphInitialized()" "\0" __FILE__ ":" "194"), this, qFlagLocation("1""updateFormat()" "\0" __FILE__ ":" "194")); | - | ||||||
| 77 | connect(window, qFlagLocation("2""sceneGraphInvalidated()" "\0" __FILE__ ":" "195"), this, qFlagLocation("1""updateFormat()" "\0" __FILE__ ":" "195")); | - | ||||||
| 78 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||
| 79 | m_window = window; | - | ||||||
| 80 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||
| 81 | updateFormat(); | - | ||||||
| 82 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||
| 83 | - | |||||||
| 84 | - | |||||||
| 85 | - | |||||||
| Switch to Source code | Preprocessed file |