OpenCoverage

qquickgraphicsinfo.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickgraphicsinfo.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3QQuickGraphicsInfo::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:
  • tst_qquickgraphicsinfo
2
18-
19QQuickGraphicsInfo *QQuickGraphicsInfo::qmlAttachedProperties(QObject *object)-
20{-
21 if (QQuickItem *item = qobject_cast<QQuickItem *>(object)
QQuickItem *it...tem *>(object)Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgraphicsinfo
FALSEnever evaluated
)
0-2
22 return
executed 2 times by 1 test: return new QQuickGraphicsInfo(item);
Executed by:
  • tst_qquickgraphicsinfo
new QQuickGraphicsInfo(item);
executed 2 times by 1 test: return new QQuickGraphicsInfo(item);
Executed by:
  • tst_qquickgraphicsinfo
2
23-
24 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
25}-
26void QQuickGraphicsInfo::updateInfo()-
27{-
28-
29 if (m_window
m_windowDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgraphicsinfo
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickgraphicsinfo
) {
2-4
30 QSGRendererInterface *rif = m_window->rendererInterface();-
31 if (rif
rifDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgraphicsinfo
FALSEnever evaluated
) {
0-2
32 GraphicsApi newAPI = GraphicsApi(rif->graphicsApi());-
33 if (m_api != newAPI
m_api != newAPIDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgraphicsinfo
FALSEnever evaluated
) {
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:
  • tst_qquickgraphicsinfo
2
43 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickgraphicsinfo
2
44 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickgraphicsinfo
2
45-
46 QSurfaceFormat format = QSurfaceFormat::defaultFormat();-
47-
48 if (m_window && m_window->isSceneGraphInitialized()
m_window->isSc...hInitialized()Description
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgraphicsinfo
) {
0-2
49 QOpenGLContext *context = m_window->openglContext();-
50 if (context
contextDescription
TRUEnever evaluated
FALSEnever evaluated
)
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()
m_majorVersion...majorVersion()Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickgraphicsinfo
) {
0-6
55 m_majorVersion = format.majorVersion();-
56 majorVersionChanged();-
57 }
never executed: end of block
0
58 if (m_minorVersion != format.minorVersion()
m_minorVersion...minorVersion()Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickgraphicsinfo
) {
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
m_profile != profileDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickgraphicsinfo
) {
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
m_renderableTy...renderableTypeDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickgraphicsinfo
) {
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:
  • tst_qquickgraphicsinfo
6
73-
74void QQuickGraphicsInfo::setWindow(QQuickWindow *window)-
75{-
76 if (m_window != window
m_window != windowDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickgraphicsinfo
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgraphicsinfo
) {
2-4
77 if (m_window
m_windowDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgraphicsinfo
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgraphicsinfo
) {
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:
  • tst_qquickgraphicsinfo
2
81 if (window
windowDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgraphicsinfo
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickgraphicsinfo
) {
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:
  • tst_qquickgraphicsinfo
2
85 m_window = window;-
86 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickgraphicsinfo
4
87 updateInfo();-
88}
executed 6 times by 1 test: end of block
Executed by:
  • tst_qquickgraphicsinfo
6
89-
90-
91-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0