OpenCoverage

qquickshadereffect.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickshadereffect.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5class QQuickShaderEffectPrivate : public QQuickItemPrivate-
6{-
7 inline QQuickShaderEffect* q_func() { return static_cast<QQuickShaderEffect *>(q_ptr); } inline const QQuickShaderEffect* q_func() const { return static_cast<const QQuickShaderEffect *>(q_ptr); } friend class QQuickShaderEffect;-
8-
9public:-
10 void updatePolish() override;-
11};-
12-
13QSGContextFactoryInterface::Flags qsg_backend_flags();-
14-
15QQuickShaderEffect::QQuickShaderEffect(QQuickItem *parent)-
16 : QQuickItem(*new QQuickShaderEffectPrivate, parent),-
17-
18 m_glImpl(nullptr),-
19-
20 m_impl(nullptr)-
21{-
22 setFlag(QQuickItem::ItemHasContents);-
23-
24-
25 if (!qsg_backend_flags().testFlag(QSGContextFactoryInterface::SupportsShaderEffectNode)
!qsg_backend_f...derEffectNode)Description
TRUEevaluated 108 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickborderimage
  • tst_qquickitemlayer
  • tst_qquickshadereffect
  • tst_scenegraph
FALSEnever evaluated
)
0-108
26 m_glImpl = new QQuickOpenGLShaderEffect(this, this);
executed 108 times by 5 tests: m_glImpl = new QQuickOpenGLShaderEffect(this, this);
Executed by:
  • tst_examples
  • tst_qquickborderimage
  • tst_qquickitemlayer
  • tst_qquickshadereffect
  • tst_scenegraph
108
27-
28 if (!m_glImpl
!m_glImplDescription
TRUEnever evaluated
FALSEevaluated 108 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickborderimage
  • tst_qquickitemlayer
  • tst_qquickshadereffect
  • tst_scenegraph
)
0-108
29-
30 m_impl = new QQuickGenericShaderEffect(this, this);
never executed: m_impl = new QQuickGenericShaderEffect(this, this);
0
31}
executed 108 times by 5 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickborderimage
  • tst_qquickitemlayer
  • tst_qquickshadereffect
  • tst_scenegraph
108
32QByteArray QQuickShaderEffect::fragmentShader() const-
33{-
34-
35 if (m_glImpl
m_glImplDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
36 return
never executed: return m_glImpl->fragmentShader();
m_glImpl->fragmentShader();
never executed: return m_glImpl->fragmentShader();
0
37-
38 return
never executed: return m_impl->fragmentShader();
m_impl->fragmentShader();
never executed: return m_impl->fragmentShader();
0
39}-
40-
41void QQuickShaderEffect::setFragmentShader(const QByteArray &code)-
42{-
43-
44 if (m_glImpl
m_glImplDescription
TRUEevaluated 100 times by 4 tests
Evaluated by:
  • tst_examples
  • tst_qquickitemlayer
  • tst_qquickshadereffect
  • tst_scenegraph
FALSEnever evaluated
) {
0-100
45 m_glImpl->setFragmentShader(code);-
46 return;
executed 100 times by 4 tests: return;
Executed by:
  • tst_examples
  • tst_qquickitemlayer
  • tst_qquickshadereffect
  • tst_scenegraph
100
47 }-
48-
49 m_impl->setFragmentShader(code);-
50}
never executed: end of block
0
51QByteArray QQuickShaderEffect::vertexShader() const-
52{-
53-
54 if (m_glImpl
m_glImplDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
55 return
never executed: return m_glImpl->vertexShader();
m_glImpl->vertexShader();
never executed: return m_glImpl->vertexShader();
0
56-
57 return
never executed: return m_impl->vertexShader();
m_impl->vertexShader();
never executed: return m_impl->vertexShader();
0
58}-
59-
60void QQuickShaderEffect::setVertexShader(const QByteArray &code)-
61{-
62-
63 if (m_glImpl
m_glImplDescription
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_qquickshadereffect
FALSEnever evaluated
) {
0-36
64 m_glImpl->setVertexShader(code);-
65 return;
executed 36 times by 1 test: return;
Executed by:
  • tst_qquickshadereffect
36
66 }-
67-
68 m_impl->setVertexShader(code);-
69}
never executed: end of block
0
70bool QQuickShaderEffect::blending() const-
71{-
72-
73 if (m_glImpl
m_glImplDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
74 return
never executed: return m_glImpl->blending();
m_glImpl->blending();
never executed: return m_glImpl->blending();
0
75-
76 return
never executed: return m_impl->blending();
m_impl->blending();
never executed: return m_impl->blending();
0
77}-
78-
79void QQuickShaderEffect::setBlending(bool enable)-
80{-
81-
82 if (m_glImpl
m_glImplDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
83 m_glImpl->setBlending(enable);-
84 return;
never executed: return;
0
85 }-
86-
87 m_impl->setBlending(enable);-
88}
never executed: end of block
0
89QVariant QQuickShaderEffect::mesh() const-
90{-
91-
92 if (m_glImpl
m_glImplDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
93 return
never executed: return m_glImpl->mesh();
m_glImpl->mesh();
never executed: return m_glImpl->mesh();
0
94-
95 return
never executed: return m_impl->mesh();
m_impl->mesh();
never executed: return m_impl->mesh();
0
96}-
97-
98void QQuickShaderEffect::setMesh(const QVariant &mesh)-
99{-
100-
101 if (m_glImpl
m_glImplDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickborderimage
FALSEnever evaluated
) {
0-2
102 m_glImpl->setMesh(mesh);-
103 return;
executed 2 times by 1 test: return;
Executed by:
  • tst_qquickborderimage
2
104 }-
105-
106 m_impl->setMesh(mesh);-
107}
never executed: end of block
0
108QQuickShaderEffect::CullMode QQuickShaderEffect::cullMode() const-
109{-
110-
111 if (m_glImpl
m_glImplDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
112 return
never executed: return m_glImpl->cullMode();
m_glImpl->cullMode();
never executed: return m_glImpl->cullMode();
0
113-
114 return
never executed: return m_impl->cullMode();
m_impl->cullMode();
never executed: return m_impl->cullMode();
0
115}-
116-
117void QQuickShaderEffect::setCullMode(CullMode face)-
118{-
119-
120 if (m_glImpl
m_glImplDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
121 m_glImpl->setCullMode(face);-
122 return;
never executed: return;
0
123 }-
124-
125 return
never executed: return m_impl->setCullMode(face);
m_impl->setCullMode(face);
never executed: return m_impl->setCullMode(face);
0
126}-
127bool QQuickShaderEffect::supportsAtlasTextures() const-
128{-
129-
130 if (m_glImpl
m_glImplDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
131 return
never executed: return m_glImpl->supportsAtlasTextures();
m_glImpl->supportsAtlasTextures();
never executed: return m_glImpl->supportsAtlasTextures();
0
132-
133 return
never executed: return m_impl->supportsAtlasTextures();
m_impl->supportsAtlasTextures();
never executed: return m_impl->supportsAtlasTextures();
0
134}-
135-
136void QQuickShaderEffect::setSupportsAtlasTextures(bool supports)-
137{-
138-
139 if (m_glImpl
m_glImplDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickshadereffect
FALSEnever evaluated
) {
0-4
140 m_glImpl->setSupportsAtlasTextures(supports);-
141 return;
executed 4 times by 1 test: return;
Executed by:
  • tst_qquickshadereffect
4
142 }-
143-
144 m_impl->setSupportsAtlasTextures(supports);-
145}
never executed: end of block
0
146QString QQuickShaderEffect::log() const-
147{-
148-
149 if (m_glImpl
m_glImplDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
150 return
never executed: return m_glImpl->log();
m_glImpl->log();
never executed: return m_glImpl->log();
0
151-
152 return
never executed: return m_impl->log();
m_impl->log();
never executed: return m_impl->log();
0
153}-
154-
155QQuickShaderEffect::Status QQuickShaderEffect::status() const-
156{-
157-
158 if (m_glImpl
m_glImplDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
159 return
never executed: return m_glImpl->status();
m_glImpl->status();
never executed: return m_glImpl->status();
0
160-
161 return
never executed: return m_impl->status();
m_impl->status();
never executed: return m_impl->status();
0
162}-
163-
164bool QQuickShaderEffect::event(QEvent *e)-
165{-
166-
167 if (m_glImpl
m_glImplDescription
TRUEevaluated 32 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickitemlayer
FALSEevaluated 108 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickborderimage
  • tst_qquickitemlayer
  • tst_qquickshadereffect
  • tst_scenegraph
) {
32-108
168 m_glImpl->handleEvent(e);-
169 return
executed 32 times by 2 tests: return QQuickItem::event(e);
Executed by:
  • tst_examples
  • tst_qquickitemlayer
QQuickItem::event(e);
executed 32 times by 2 tests: return QQuickItem::event(e);
Executed by:
  • tst_examples
  • tst_qquickitemlayer
32
170 }-
171-
172 m_impl->handleEvent(e);-
173 return
executed 108 times by 5 tests: return QQuickItem::event(e);
Executed by:
  • tst_examples
  • tst_qquickborderimage
  • tst_qquickitemlayer
  • tst_qquickshadereffect
  • tst_scenegraph
QQuickItem::event(e);
executed 108 times by 5 tests: return QQuickItem::event(e);
Executed by:
  • tst_examples
  • tst_qquickborderimage
  • tst_qquickitemlayer
  • tst_qquickshadereffect
  • tst_scenegraph
108
174}-
175-
176void QQuickShaderEffect::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)-
177{-
178-
179 if (m_glImpl
m_glImplDescription
TRUEevaluated 122 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickborderimage
  • tst_qquickitemlayer
  • tst_qquickshadereffect
  • tst_scenegraph
FALSEnever evaluated
) {
0-122
180 m_glImpl->handleGeometryChanged(newGeometry, oldGeometry);-
181 QQuickItem::geometryChanged(newGeometry, oldGeometry);-
182 return;
executed 122 times by 5 tests: return;
Executed by:
  • tst_examples
  • tst_qquickborderimage
  • tst_qquickitemlayer
  • tst_qquickshadereffect
  • tst_scenegraph
122
183 }-
184-
185 m_impl->handleGeometryChanged(newGeometry, oldGeometry);-
186 QQuickItem::geometryChanged(newGeometry, oldGeometry);-
187}
never executed: end of block
0
188-
189QSGNode *QQuickShaderEffect::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData)-
190{-
191-
192 if (m_glImpl
m_glImplDescription
TRUEevaluated 72 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickborderimage
  • tst_qquickitemlayer
  • tst_qquickshadereffect
  • tst_scenegraph
FALSEnever evaluated
)
0-72
193 return
executed 72 times by 5 tests: return m_glImpl->handleUpdatePaintNode(oldNode, updatePaintNodeData);
Executed by:
  • tst_examples
  • tst_qquickborderimage
  • tst_qquickitemlayer
  • tst_qquickshadereffect
  • tst_scenegraph
m_glImpl->handleUpdatePaintNode(oldNode, updatePaintNodeData);
executed 72 times by 5 tests: return m_glImpl->handleUpdatePaintNode(oldNode, updatePaintNodeData);
Executed by:
  • tst_examples
  • tst_qquickborderimage
  • tst_qquickitemlayer
  • tst_qquickshadereffect
  • tst_scenegraph
72
194-
195 return
never executed: return m_impl->handleUpdatePaintNode(oldNode, updatePaintNodeData);
m_impl->handleUpdatePaintNode(oldNode, updatePaintNodeData);
never executed: return m_impl->handleUpdatePaintNode(oldNode, updatePaintNodeData);
0
196}-
197-
198void QQuickShaderEffect::componentComplete()-
199{-
200-
201 if (m_glImpl
m_glImplDescription
TRUEevaluated 108 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickborderimage
  • tst_qquickitemlayer
  • tst_qquickshadereffect
  • tst_scenegraph
FALSEnever evaluated
) {
0-108
202 m_glImpl->maybeUpdateShaders();-
203 QQuickItem::componentComplete();-
204 return;
executed 108 times by 5 tests: return;
Executed by:
  • tst_examples
  • tst_qquickborderimage
  • tst_qquickitemlayer
  • tst_qquickshadereffect
  • tst_scenegraph
108
205 }-
206-
207 m_impl->maybeUpdateShaders();-
208 QQuickItem::componentComplete();-
209}
never executed: end of block
0
210-
211void QQuickShaderEffect::itemChange(ItemChange change, const ItemChangeData &value)-
212{-
213-
214 if (m_glImpl
m_glImplDescription
TRUEevaluated 292 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickborderimage
  • tst_qquickitemlayer
  • tst_qquickshadereffect
  • tst_scenegraph
FALSEnever evaluated
) {
0-292
215 m_glImpl->handleItemChange(change, value);-
216 QQuickItem::itemChange(change, value);-
217 return;
executed 292 times by 5 tests: return;
Executed by:
  • tst_examples
  • tst_qquickborderimage
  • tst_qquickitemlayer
  • tst_qquickshadereffect
  • tst_scenegraph
292
218 }-
219-
220 m_impl->handleItemChange(change, value);-
221 QQuickItem::itemChange(change, value);-
222}
never executed: end of block
0
223-
224bool QQuickShaderEffect::isComponentComplete() const-
225{-
226 return
executed 136 times by 4 tests: return QQuickItem::isComponentComplete();
Executed by:
  • tst_examples
  • tst_qquickitemlayer
  • tst_qquickshadereffect
  • tst_scenegraph
QQuickItem::isComponentComplete();
executed 136 times by 4 tests: return QQuickItem::isComponentComplete();
Executed by:
  • tst_examples
  • tst_qquickitemlayer
  • tst_qquickshadereffect
  • tst_scenegraph
136
227}-
228-
229QString QQuickShaderEffect::parseLog()-
230{-
231-
232 if (m_glImpl
m_glImplDescription
TRUEevaluated 36 times by 1 test
Evaluated by:
  • tst_qquickshadereffect
FALSEnever evaluated
)
0-36
233 return
executed 36 times by 1 test: return m_glImpl->parseLog();
Executed by:
  • tst_qquickshadereffect
m_glImpl->parseLog();
executed 36 times by 1 test: return m_glImpl->parseLog();
Executed by:
  • tst_qquickshadereffect
36
234-
235 return
never executed: return m_impl->parseLog();
m_impl->parseLog();
never executed: return m_impl->parseLog();
0
236}-
237-
238void QQuickShaderEffectPrivate::updatePolish()-
239{-
240 QQuickShaderEffect * const q = q_func();-
241-
242 if (q->m_glImpl
q->m_glImplDescription
TRUEevaluated 40 times by 5 tests
Evaluated by:
  • tst_examples
  • tst_qquickborderimage
  • tst_qquickitemlayer
  • tst_qquickshadereffect
  • tst_scenegraph
FALSEnever evaluated
) {
0-40
243 q->m_glImpl->maybeUpdateShaders();-
244 return;
executed 40 times by 5 tests: return;
Executed by:
  • tst_examples
  • tst_qquickborderimage
  • tst_qquickitemlayer
  • tst_qquickshadereffect
  • tst_scenegraph
40
245 }-
246-
247 q->m_impl->maybeUpdateShaders();-
248}
never executed: end of block
0
249-
250-
251bool QQuickShaderEffect::isOpenGLShaderEffect() const-
252{-
253 return
executed 4 times by 1 test: return m_glImpl != nullptr;
Executed by:
  • tst_examples
m_glImpl != nullptr;
executed 4 times by 1 test: return m_glImpl != nullptr;
Executed by:
  • tst_examples
4
254}-
255-
256-
257-
258-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0