OpenCoverage

qquickcustomparticle.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/particles/qquickcustomparticle.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4static QSGGeometry::Attribute PlainParticle_Attributes[] = {-
5 QSGGeometry::Attribute::create(0, 2, -
6 0x1406-
7 , true),-
8 QSGGeometry::Attribute::create(1, 2, -
9 0x1406-
10 ),-
11 QSGGeometry::Attribute::create(2, 4, -
12 0x1406-
13 ),-
14 QSGGeometry::Attribute::create(3, 4, -
15 0x1406-
16 ),-
17 QSGGeometry::Attribute::create(4, 1, -
18 0x1406-
19 )-
20};-
21-
22static QSGGeometry::AttributeSet PlainParticle_AttributeSet =-
23{-
24 5,-
25 (2 + 2 + 4 + 4 + 1) * sizeof(float),-
26 PlainParticle_Attributes-
27};-
28-
29struct PlainVertex {-
30 float x;-
31 float y;-
32 float tx;-
33 float ty;-
34 float t;-
35 float lifeSpan;-
36 float size;-
37 float endSize;-
38 float vx;-
39 float vy;-
40 float ax;-
41 float ay;-
42 float r;-
43};-
44-
45struct PlainVertices {-
46 PlainVertex v1;-
47 PlainVertex v2;-
48 PlainVertex v3;-
49 PlainVertex v4;-
50};-
51QQuickCustomParticle::QQuickCustomParticle(QQuickItem* parent)-
52 : QQuickParticlePainter(parent)-
53 , m_common(this, [this](int mappedId){this->propertyChanged(mappedId);})-
54 , m_myMetaObject(nullptr)-
55 , m_dirtyUniforms(true)-
56 , m_dirtyUniformValues(true)-
57 , m_dirtyTextureProviders(true)-
58 , m_dirtyProgram(true)-
59{-
60 setFlag(QQuickItem::ItemHasContents);-
61}
executed 10 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
10
62-
63void QQuickCustomParticle::sceneGraphInvalidated()-
64{-
65 m_nodes.clear();-
66}
never executed: end of block
0
67-
68QQuickCustomParticle::~QQuickCustomParticle()-
69{-
70}-
71-
72void QQuickCustomParticle::componentComplete()-
73{-
74 if (!m_myMetaObject
!m_myMetaObjectDescription
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
FALSEnever evaluated
)
0-10
75 m_myMetaObject = metaObject();
executed 10 times by 2 tests: m_myMetaObject = metaObject();
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
10
76-
77 m_common.updateShader(this, m_myMetaObject, Key::FragmentShader);-
78 updateVertexShader();-
79 reset();-
80 QQuickParticlePainter::componentComplete();-
81}
executed 10 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
10
82void QQuickCustomParticle::setFragmentShader(const QByteArray &code)-
83{-
84 if (m_common.source.sourceCode[Key::FragmentShader].constData() == code.constData()
m_common.sourc...de.constData()Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_examples
)
0-6
85 return;
never executed: return;
0
86 m_common.source.sourceCode[Key::FragmentShader] = code;-
87 m_dirtyProgram = true;-
88 if (isComponentComplete()
isComponentComplete()Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_examples
) {
0-6
89 m_common.updateShader(this, m_myMetaObject, Key::FragmentShader);-
90 reset();-
91 }
never executed: end of block
0
92 fragmentShaderChanged();-
93}
executed 6 times by 1 test: end of block
Executed by:
  • tst_examples
6
94void QQuickCustomParticle::setVertexShader(const QByteArray &code)-
95{-
96 if (m_common.source.sourceCode[Key::VertexShader].constData() == code.constData()
m_common.sourc...de.constData()Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_examples
)
0-6
97 return;
never executed: return;
0
98 m_common.source.sourceCode[Key::VertexShader] = code;-
99-
100 m_dirtyProgram = true;-
101 if (isComponentComplete()
isComponentComplete()Description
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_examples
) {
0-6
102 updateVertexShader();-
103 reset();-
104 }
never executed: end of block
0
105 vertexShaderChanged();-
106}
executed 6 times by 1 test: end of block
Executed by:
  • tst_examples
6
107-
108void QQuickCustomParticle::updateVertexShader()-
109{-
110 m_common.disconnectPropertySignals(this, Key::VertexShader);-
111 m_common.uniformData[Key::VertexShader].clear();-
112 m_common.clearSignalMappers(Key::VertexShader);-
113 m_common.attributes.clear();-
114 m_common.attributes.append("qt_ParticlePos");-
115 m_common.attributes.append("qt_ParticleTex");-
116 m_common.attributes.append("qt_ParticleData");-
117 m_common.attributes.append("qt_ParticleVec");-
118 m_common.attributes.append("qt_ParticleR");-
119-
120 UniformData d;-
121 d.name = "qt_Matrix";-
122 d.specialType = UniformData::Matrix;-
123 m_common.uniformData[Key::VertexShader].append(d);-
124 m_common.signalMappers[Key::VertexShader].append(0);-
125-
126 d.name = "qt_Timestamp";-
127 d.specialType = UniformData::None;-
128 m_common.uniformData[Key::VertexShader].append(d);-
129 m_common.signalMappers[Key::VertexShader].append(0);-
130-
131 const QByteArray &code = m_common.source.sourceCode[Key::VertexShader];-
132 if (!code.isEmpty()
!code.isEmpty()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickcustomparticle
)
4-6
133 m_common.lookThroughShaderCode(this, m_myMetaObject, Key::VertexShader, code);
executed 6 times by 1 test: m_common.lookThroughShaderCode(this, m_myMetaObject, Key::VertexShader, code);
Executed by:
  • tst_examples
6
134-
135 m_common.connectPropertySignals(this, m_myMetaObject, Key::VertexShader);-
136}
executed 10 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
10
137-
138void QQuickCustomParticle::reset()-
139{-
140 QQuickParticlePainter::reset();-
141 update();-
142}
executed 40 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
40
143-
144QSGNode *QQuickCustomParticle::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *)-
145{-
146 QQuickOpenGLShaderEffectNode *rootNode = static_cast<QQuickOpenGLShaderEffectNode *>(oldNode);-
147 if (m_pleaseReset
m_pleaseResetDescription
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
FALSEevaluated 278 times by 1 test
Evaluated by:
  • tst_qquickcustomparticle
){
9-278
148 delete rootNode;-
149 rootNode = nullptr;-
150 m_nodes.clear();-
151 m_pleaseReset = false;-
152 m_dirtyProgram = true;-
153 }
executed 9 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
9
154-
155 if (m_system
m_systemDescription
TRUEevaluated 287 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
FALSEnever evaluated
&& m_system->isRunning()
m_system->isRunning()Description
TRUEevaluated 287 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
FALSEnever evaluated
&& !m_system->isPaused()
!m_system->isPaused()Description
TRUEevaluated 287 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
FALSEnever evaluated
){
0-287
156 rootNode = prepareNextFrame(rootNode);-
157 if (rootNode
rootNodeDescription
TRUEevaluated 287 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
FALSEnever evaluated
) {
0-287
158 for (auto _container_ = QtPrivate::qMakeForeachContainer(m_nodes); _container_.control
_container_.controlDescription
TRUEevaluated 574 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
FALSEnever evaluated
&& _container_.i != _container_.e
_container_.i != _container_.eDescription
TRUEevaluated 287 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
FALSEevaluated 287 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
; ++_container_.i, _container_.control ^= 1) for (QSGGeometryNode* node = *_container_.i; _container_.control
_container_.controlDescription
TRUEevaluated 287 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
FALSEevaluated 287 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
; _container_.control = 0)
0-574
159 node->markDirty(QSGNode::DirtyGeometry);
executed 287 times by 2 tests: node->markDirty(QSGNode::DirtyGeometry);
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
287
160 update();-
161 }
executed 287 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
287
162 }
executed 287 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
287
163-
164 return
executed 287 times by 2 tests: return rootNode;
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
rootNode;
executed 287 times by 2 tests: return rootNode;
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
287
165}-
166-
167QQuickOpenGLShaderEffectNode *QQuickCustomParticle::prepareNextFrame(QQuickOpenGLShaderEffectNode *rootNode)-
168{-
169 if (!rootNode
!rootNodeDescription
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
FALSEevaluated 278 times by 1 test
Evaluated by:
  • tst_qquickcustomparticle
)
9-278
170 rootNode = buildCustomNodes();
executed 9 times by 2 tests: rootNode = buildCustomNodes();
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
9
171-
172 if (!rootNode
!rootNodeDescription
TRUEnever evaluated
FALSEevaluated 287 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
)
0-287
173 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
174-
175 if (m_dirtyProgram
m_dirtyProgramDescription
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
FALSEevaluated 278 times by 1 test
Evaluated by:
  • tst_qquickcustomparticle
) {
9-278
176 const bool isES = QOpenGLContext::currentContext()->isOpenGLES();-
177-
178 QQuickOpenGLShaderEffectMaterial *material = static_cast<QQuickOpenGLShaderEffectMaterial *>(rootNode->material());-
179 ((material) ? static_cast<void>(0) : qt_assert("material", __FILE__, 279));-
180-
181 Key s = m_common.source;-
182 QSGShaderSourceBuilder builder;-
183 if (s.sourceCode[Key::FragmentShader].isEmpty()
s.sourceCode[K...der].isEmpty()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickcustomparticle
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_examples
) {
4-5
184 builder.appendSourceFile(([]() noexcept -> QString { enum { Size = sizeof(u"" ":/particles/shaders/customparticle.frag")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" ":/particles/shaders/customparticle.frag" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 4 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_qquickcustomparticle
qstring_literal_temp;
executed 4 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_qquickcustomparticle
}()));
4
185 if (isES
isESDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickcustomparticle
)
0-4
186 builder.removeVersion();
never executed: builder.removeVersion();
0
187 s.sourceCode[Key::FragmentShader] = builder.source();-
188 builder.clear();-
189 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickcustomparticle
4
190-
191 builder.appendSourceFile(([]() noexcept -> QString { enum { Size = sizeof(u"" ":/particles/shaders/customparticletemplate.vert")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" ":/particles/shaders/customparticletemplate.vert" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 9 times by 2 tests: return qstring_literal_temp;
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
qstring_literal_temp;
executed 9 times by 2 tests: return qstring_literal_temp;
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
}()));
9
192 if (isES
isESDescription
TRUEnever evaluated
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
)
0-9
193 builder.removeVersion();
never executed: builder.removeVersion();
0
194-
195 if (s.sourceCode[Key::VertexShader].isEmpty()
s.sourceCode[K...der].isEmpty()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickcustomparticle
FALSEevaluated 5 times by 1 test
Evaluated by:
  • tst_examples
)
4-5
196 builder.appendSourceFile(([]() noexcept -> QString { enum { Size = sizeof(u"" ":/particles/shaders/customparticle.vert")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" ":/particles/shaders/customparticle.vert" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 4 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_qquickcustomparticle
qstring_literal_temp;
executed 4 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_qquickcustomparticle
}()));
executed 4 times by 1 test: builder.appendSourceFile(([]() noexcept -> QString { enum { Size = sizeof(u"" ":/particles/shaders/customparticle.vert")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" ":/particles/shaders/customparticle.vert" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()));
Executed by:
  • tst_qquickcustomparticle
4
197 s.sourceCode[Key::VertexShader] = builder.source() + s.sourceCode[Key::VertexShader];-
198-
199 material->setProgramSource(s);-
200 material->attributes = m_common.attributes;-
201 for (auto _container_ = QtPrivate::qMakeForeachContainer(m_nodes); _container_.control
_container_.controlDescription
TRUEevaluated 18 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
FALSEnever evaluated
&& _container_.i != _container_.e
_container_.i != _container_.eDescription
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
; ++_container_.i, _container_.control ^= 1) for (QQuickOpenGLShaderEffectNode* node = *_container_.i; _container_.control
_container_.controlDescription
TRUEevaluated 9 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
; _container_.control = 0)
0-18
202 node->markDirty(QSGNode::DirtyMaterial);
executed 9 times by 2 tests: node->markDirty(QSGNode::DirtyMaterial);
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
9
203-
204 m_dirtyProgram = false;-
205 m_dirtyUniforms = true;-
206 }
executed 9 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
9
207-
208 m_lastTime = m_system->systemSync(this) / 1000.;-
209 if (true)-
210 buildData(rootNode);
executed 287 times by 2 tests: buildData(rootNode);
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
287
211 return
executed 287 times by 2 tests: return rootNode;
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
rootNode;
executed 287 times by 2 tests: return rootNode;
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
287
212}-
213-
214QQuickOpenGLShaderEffectNode* QQuickCustomParticle::buildCustomNodes()-
215{-
216 typedef QHash<int, QQuickOpenGLShaderEffectNode*>::const_iterator NodeHashConstIt;-
217-
218 if (!QOpenGLContext::currentContext()
!QOpenGLContex...rrentContext()Description
TRUEnever evaluated
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
)
0-9
219 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
220-
221 if (m_count * 4 > 0xffff
m_count * 4 > 0xffffDescription
TRUEnever evaluated
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
) {
0-9
222-
223 qmlInfo(this) << "CustomParticle: Too many particles - maximum 16383 per CustomParticle";-
224 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
225 }-
226-
227 if (m_count <= 0
m_count <= 0Description
TRUEnever evaluated
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
) {
0-9
228 qmlInfo(this) << "CustomParticle: Too few particles";-
229 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
230 }-
231-
232 if (groups().isEmpty()
groups().isEmpty()Description
TRUEnever evaluated
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
)
0-9
233 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
234-
235 QQuickOpenGLShaderEffectNode *rootNode = nullptr;-
236 QQuickOpenGLShaderEffectMaterial *material = new QQuickOpenGLShaderEffectMaterial;-
237 m_dirtyProgram = true;-
238-
239 for (auto groupId : groupIds()) {-
240 int count = m_system->groupData[groupId]->size();-
241-
242 QQuickOpenGLShaderEffectNode* node = new QQuickOpenGLShaderEffectNode();-
243 m_nodes.insert(groupId, node);-
244-
245 node->setMaterial(material);-
246-
247-
248 int vCount = count * 4;-
249 int iCount = count * 6;-
250 QSGGeometry *g = new QSGGeometry(PlainParticle_AttributeSet, vCount, iCount);-
251 g->setDrawingMode(-
252 0x0004-
253 );-
254 node->setGeometry(g);-
255 node->setFlag(QSGNode::OwnsGeometry, true);-
256 PlainVertex *vertices = (PlainVertex *) g->vertexData();-
257 for (int p=0; p < count
p < countDescription
TRUEevaluated 16412 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
; ++p) {
9-16412
258 commit(groupId, p);-
259 vertices[0].tx = 0;-
260 vertices[0].ty = 0;-
261-
262 vertices[1].tx = 1;-
263 vertices[1].ty = 0;-
264-
265 vertices[2].tx = 0;-
266 vertices[2].ty = 1;-
267-
268 vertices[3].tx = 1;-
269 vertices[3].ty = 1;-
270 vertices += 4;-
271 }
executed 16412 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
16412
272 quint16 *indices = g->indexDataAsUShort();-
273 for (int i=0; i < count
i < countDescription
TRUEevaluated 16412 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
; ++i) {
9-16412
274 int o = i * 4;-
275 indices[0] = o;-
276 indices[1] = o + 1;-
277 indices[2] = o + 2;-
278 indices[3] = o + 1;-
279 indices[4] = o + 3;-
280 indices[5] = o + 2;-
281 indices += 6;-
282 }
executed 16412 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
16412
283 }
executed 9 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
9
284-
285 NodeHashConstIt it = m_nodes.cbegin();-
286 rootNode = it.value();-
287 rootNode->setFlag(QSGNode::OwnsMaterial, true);-
288 NodeHashConstIt cend = m_nodes.cend();-
289 for (++it; it != cend
it != cendDescription
TRUEnever evaluated
FALSEevaluated 9 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
; ++it)
0-9
290 rootNode->appendChildNode(it.value());
never executed: rootNode->appendChildNode(it.value());
0
291-
292 return
executed 9 times by 2 tests: return rootNode;
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
rootNode;
executed 9 times by 2 tests: return rootNode;
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
9
293}-
294-
295void QQuickCustomParticle::sourceDestroyed(QObject *object)-
296{-
297 m_common.sourceDestroyed(object);-
298}
executed 2 times by 1 test: end of block
Executed by:
  • tst_examples
2
299-
300void QQuickCustomParticle::propertyChanged(int mappedId)-
301{-
302 bool textureProviderChanged;-
303 m_common.propertyChanged(this, m_myMetaObject, mappedId, &textureProviderChanged);-
304 m_dirtyTextureProviders |= textureProviderChanged;-
305 m_dirtyUniformValues = true;-
306 update();-
307}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickcustomparticle
2
308-
309-
310void QQuickCustomParticle::buildData(QQuickOpenGLShaderEffectNode *rootNode)-
311{-
312 if (!rootNode
!rootNodeDescription
TRUEnever evaluated
FALSEevaluated 287 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
)
0-287
313 return;
never executed: return;
0
314 for (int shaderType = 0; shaderType < Key::ShaderTypeCount
shaderType < K...haderTypeCountDescription
TRUEevaluated 574 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
FALSEevaluated 287 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
; ++shaderType) {
287-574
315 for (int i = 0; i < m_common.uniformData[shaderType].size()
i < m_common.u...erType].size()Description
TRUEevaluated 1153 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
FALSEevaluated 574 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
; ++i) {
574-1153
316 if (m_common.uniformData[shaderType].at(i).name == "qt_Timestamp"
m_common.unifo..."qt_Timestamp"Description
TRUEevaluated 287 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
FALSEevaluated 866 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
)
287-866
317 m_common.uniformData[shaderType][i].value = qVariantFromValue(m_lastTime);
executed 287 times by 2 tests: m_common.uniformData[shaderType][i].value = qVariantFromValue(m_lastTime);
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
287
318 }
executed 1153 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
1153
319 }
executed 574 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
574
320 m_common.updateMaterial(rootNode, static_cast<QQuickOpenGLShaderEffectMaterial *>(rootNode->material()),-
321 m_dirtyUniforms, true, m_dirtyTextureProviders);-
322 for (auto _container_ = QtPrivate::qMakeForeachContainer(m_nodes); _container_.control
_container_.controlDescription
TRUEevaluated 574 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
FALSEnever evaluated
&& _container_.i != _container_.e
_container_.i != _container_.eDescription
TRUEevaluated 287 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
FALSEevaluated 287 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
; ++_container_.i, _container_.control ^= 1) for (QQuickOpenGLShaderEffectNode* node = *_container_.i; _container_.control
_container_.controlDescription
TRUEevaluated 287 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
FALSEevaluated 287 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
; _container_.control = 0)
0-574
323 node->markDirty(QSGNode::DirtyMaterial);
executed 287 times by 2 tests: node->markDirty(QSGNode::DirtyMaterial);
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
287
324 m_dirtyUniforms = m_dirtyUniformValues = m_dirtyTextureProviders = false;-
325}
executed 287 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
287
326-
327void QQuickCustomParticle::initialize(int gIdx, int pIdx)-
328{-
329 QQuickParticleData* datum = m_system->groupData[gIdx]->data[pIdx];-
330 datum->r = QRandomGenerator::global()->generateDouble();-
331}
executed 2512 times by 1 test: end of block
Executed by:
  • tst_qquickcustomparticle
2512
332-
333void QQuickCustomParticle::commit(int gIdx, int pIdx)-
334{-
335 if (m_nodes[gIdx] == 0
m_nodes[gIdx] == 0Description
TRUEnever evaluated
FALSEevaluated 18892 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
)
0-18892
336 return;
never executed: return;
0
337-
338 QQuickParticleData* datum = m_system->groupData[gIdx]->data[pIdx];-
339 PlainVertices *particles = (PlainVertices *) m_nodes[gIdx]->geometry()->vertexData();-
340 PlainVertex *vertices = (PlainVertex *)&particles[pIdx];-
341 for (int i=0; i<4
i<4Description
TRUEevaluated 75568 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
FALSEevaluated 18892 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
; ++i) {
18892-75568
342 vertices[i].x = datum->x - m_systemOffset.x();-
343 vertices[i].y = datum->y - m_systemOffset.y();-
344 vertices[i].t = datum->t;-
345 vertices[i].lifeSpan = datum->lifeSpan;-
346 vertices[i].size = datum->size;-
347 vertices[i].endSize = datum->endSize;-
348 vertices[i].vx = datum->vx;-
349 vertices[i].vy = datum->vy;-
350 vertices[i].ax = datum->ax;-
351 vertices[i].ay = datum->ay;-
352 vertices[i].r = datum->r;-
353 }
executed 75568 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
75568
354}
executed 18892 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
18892
355-
356void QQuickCustomParticle::itemChange(ItemChange change, const ItemChangeData &value)-
357{-
358 if (change == QQuickItem::ItemSceneChange
change == QQui...temSceneChangeDescription
TRUEevaluated 20 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
FALSEevaluated 28 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickcustomparticle
)
20-28
359 m_common.updateWindow(value.window);
executed 20 times by 2 tests: m_common.updateWindow(value.window);
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
20
360 QQuickParticlePainter::itemChange(change, value);-
361}
executed 48 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickcustomparticle
48
362-
363-
364-
365-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0