Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickgraphicsinfo.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | QQuickGraphicsInfo::QQuickGraphicsInfo(QQuickItem *item) | - | ||||||
4 | : QObject(item) | - | ||||||
5 | , m_window(nullptr) | - | ||||||
6 | , m_api(Unknown) | - | ||||||
7 | , m_shaderType(UnknownShadingLanguage) | - | ||||||
8 | , m_shaderCompilationType(ShaderCompilationType(0)) | - | ||||||
9 | , m_shaderSourceType(ShaderSourceType(0)) | - | ||||||
10 | , m_majorVersion(2) | - | ||||||
11 | , m_minorVersion(0) | - | ||||||
12 | , m_profile(OpenGLNoProfile) | - | ||||||
13 | , m_renderableType(SurfaceFormatUnspecified) | - | ||||||
14 | { | - | ||||||
15 | connect(item, qFlagLocation("2""windowChanged(QQuickWindow*)" "\0" __FILE__ ":" "76"), this, qFlagLocation("1""setWindow(QQuickWindow*)" "\0" __FILE__ ":" "76")); | - | ||||||
16 | setWindow(item->window()); | - | ||||||
17 | } executed 2 times by 1 test: end of block Executed by:
| 2 | ||||||
18 | - | |||||||
19 | QQuickGraphicsInfo *QQuickGraphicsInfo::qmlAttachedProperties(QObject *object) | - | ||||||
20 | { | - | ||||||
21 | if (QQuickItem *item = qobject_cast<QQuickItem *>(object)
| 0-2 | ||||||
22 | return executed 2 times by 1 test: new QQuickGraphicsInfo(item);return new QQuickGraphicsInfo(item); Executed by:
executed 2 times by 1 test: return new QQuickGraphicsInfo(item); Executed by:
| 2 | ||||||
23 | - | |||||||
24 | return never executed: nullptr;return nullptr; never executed: return nullptr; | 0 | ||||||
25 | } | - | ||||||
26 | void QQuickGraphicsInfo::updateInfo() | - | ||||||
27 | { | - | ||||||
28 | - | |||||||
29 | if (m_window
| 2-4 | ||||||
30 | QSGRendererInterface *rif = m_window->rendererInterface(); | - | ||||||
31 | if (rif
| 0-2 | ||||||
32 | GraphicsApi newAPI = GraphicsApi(rif->graphicsApi()); | - | ||||||
33 | if (m_api != newAPI
| 0-2 | ||||||
34 | m_api = newAPI; | - | ||||||
35 | apiChanged(); | - | ||||||
36 | m_shaderType = ShaderType(rif->shaderType()); | - | ||||||
37 | shaderTypeChanged(); | - | ||||||
38 | m_shaderCompilationType = ShaderCompilationType(int(rif->shaderCompilationType())); | - | ||||||
39 | shaderCompilationTypeChanged(); | - | ||||||
40 | m_shaderSourceType = ShaderSourceType(int(rif->shaderSourceType())); | - | ||||||
41 | shaderSourceTypeChanged(); | - | ||||||
42 | } executed 2 times by 1 test: end of block Executed by:
| 2 | ||||||
43 | } executed 2 times by 1 test: end of block Executed by:
| 2 | ||||||
44 | } executed 2 times by 1 test: end of block Executed by:
| 2 | ||||||
45 | - | |||||||
46 | QSurfaceFormat format = QSurfaceFormat::defaultFormat(); | - | ||||||
47 | - | |||||||
48 | if (m_window && m_window->isSceneGraphInitialized()
| 0-2 | ||||||
49 | QOpenGLContext *context = m_window->openglContext(); | - | ||||||
50 | if (context
| 0 | ||||||
51 | format = context->format(); never executed: format = context->format(); | 0 | ||||||
52 | } never executed: end of block | 0 | ||||||
53 | - | |||||||
54 | if (m_majorVersion != format.majorVersion()
| 0-6 | ||||||
55 | m_majorVersion = format.majorVersion(); | - | ||||||
56 | majorVersionChanged(); | - | ||||||
57 | } never executed: end of block | 0 | ||||||
58 | if (m_minorVersion != format.minorVersion()
| 0-6 | ||||||
59 | m_minorVersion = format.minorVersion(); | - | ||||||
60 | minorVersionChanged(); | - | ||||||
61 | } never executed: end of block | 0 | ||||||
62 | OpenGLContextProfile profile = static_cast<OpenGLContextProfile>(format.profile()); | - | ||||||
63 | if (m_profile != profile
| 0-6 | ||||||
64 | m_profile = profile; | - | ||||||
65 | profileChanged(); | - | ||||||
66 | } never executed: end of block | 0 | ||||||
67 | RenderableType renderableType = static_cast<RenderableType>(format.renderableType()); | - | ||||||
68 | if (m_renderableType != renderableType
| 0-6 | ||||||
69 | m_renderableType = renderableType; | - | ||||||
70 | renderableTypeChanged(); | - | ||||||
71 | } never executed: end of block | 0 | ||||||
72 | } executed 6 times by 1 test: end of block Executed by:
| 6 | ||||||
73 | - | |||||||
74 | void QQuickGraphicsInfo::setWindow(QQuickWindow *window) | - | ||||||
75 | { | - | ||||||
76 | if (m_window != window
| 2-4 | ||||||
77 | if (m_window
| 2 | ||||||
78 | disconnect(m_window, qFlagLocation("2""sceneGraphInitialized()" "\0" __FILE__ ":" "291"), this, qFlagLocation("1""updateInfo()" "\0" __FILE__ ":" "291")); | - | ||||||
79 | disconnect(m_window, qFlagLocation("2""sceneGraphInvalidated()" "\0" __FILE__ ":" "292"), this, qFlagLocation("1""updateInfo()" "\0" __FILE__ ":" "292")); | - | ||||||
80 | } executed 2 times by 1 test: end of block Executed by:
| 2 | ||||||
81 | if (window
| 2 | ||||||
82 | connect(window, qFlagLocation("2""sceneGraphInitialized()" "\0" __FILE__ ":" "295"), this, qFlagLocation("1""updateInfo()" "\0" __FILE__ ":" "295")); | - | ||||||
83 | connect(window, qFlagLocation("2""sceneGraphInvalidated()" "\0" __FILE__ ":" "296"), this, qFlagLocation("1""updateInfo()" "\0" __FILE__ ":" "296")); | - | ||||||
84 | } executed 2 times by 1 test: end of block Executed by:
| 2 | ||||||
85 | m_window = window; | - | ||||||
86 | } executed 4 times by 1 test: end of block Executed by:
| 4 | ||||||
87 | updateInfo(); | - | ||||||
88 | } executed 6 times by 1 test: end of block Executed by:
| 6 | ||||||
89 | - | |||||||
90 | - | |||||||
91 | - | |||||||
Switch to Source code | Preprocessed file |