Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/particles/qquickimageparticle_p.h |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | class ImageMaterialData; | - | ||||||
5 | class QSGGeometryNode; | - | ||||||
6 | - | |||||||
7 | class QQuickSprite; | - | ||||||
8 | class QQuickStochasticEngine; | - | ||||||
9 | - | |||||||
10 | struct SimpleVertex { | - | ||||||
11 | float x; | - | ||||||
12 | float y; | - | ||||||
13 | float t; | - | ||||||
14 | float lifeSpan; | - | ||||||
15 | float size; | - | ||||||
16 | float endSize; | - | ||||||
17 | float vx; | - | ||||||
18 | float vy; | - | ||||||
19 | float ax; | - | ||||||
20 | float ay; | - | ||||||
21 | }; | - | ||||||
22 | - | |||||||
23 | struct ColoredVertex { | - | ||||||
24 | float x; | - | ||||||
25 | float y; | - | ||||||
26 | float t; | - | ||||||
27 | float lifeSpan; | - | ||||||
28 | float size; | - | ||||||
29 | float endSize; | - | ||||||
30 | float vx; | - | ||||||
31 | float vy; | - | ||||||
32 | float ax; | - | ||||||
33 | float ay; | - | ||||||
34 | Color4ub color; | - | ||||||
35 | }; | - | ||||||
36 | - | |||||||
37 | struct DeformableVertex { | - | ||||||
38 | float x; | - | ||||||
39 | float y; | - | ||||||
40 | float tx; | - | ||||||
41 | float ty; | - | ||||||
42 | float t; | - | ||||||
43 | float lifeSpan; | - | ||||||
44 | float size; | - | ||||||
45 | float endSize; | - | ||||||
46 | float vx; | - | ||||||
47 | float vy; | - | ||||||
48 | float ax; | - | ||||||
49 | float ay; | - | ||||||
50 | Color4ub color; | - | ||||||
51 | float xx; | - | ||||||
52 | float xy; | - | ||||||
53 | float yx; | - | ||||||
54 | float yy; | - | ||||||
55 | float rotation; | - | ||||||
56 | float rotationVelocity; | - | ||||||
57 | float autoRotate; | - | ||||||
58 | }; | - | ||||||
59 | - | |||||||
60 | struct SpriteVertex { | - | ||||||
61 | float x; | - | ||||||
62 | float y; | - | ||||||
63 | float tx; | - | ||||||
64 | float ty; | - | ||||||
65 | float t; | - | ||||||
66 | float lifeSpan; | - | ||||||
67 | float size; | - | ||||||
68 | float endSize; | - | ||||||
69 | float vx; | - | ||||||
70 | float vy; | - | ||||||
71 | float ax; | - | ||||||
72 | float ay; | - | ||||||
73 | Color4ub color; | - | ||||||
74 | float xx; | - | ||||||
75 | float xy; | - | ||||||
76 | float yx; | - | ||||||
77 | float yy; | - | ||||||
78 | float rotation; | - | ||||||
79 | float rotationVelocity; | - | ||||||
80 | float autoRotate; | - | ||||||
81 | float animW; | - | ||||||
82 | float animH; | - | ||||||
83 | float animProgress; | - | ||||||
84 | float animX1; | - | ||||||
85 | float animY1; | - | ||||||
86 | float animX2; | - | ||||||
87 | float animY2; | - | ||||||
88 | }; | - | ||||||
89 | - | |||||||
90 | template <typename Vertex> | - | ||||||
91 | struct Vertices { | - | ||||||
92 | Vertex v1; | - | ||||||
93 | Vertex v2; | - | ||||||
94 | Vertex v3; | - | ||||||
95 | Vertex v4; | - | ||||||
96 | }; | - | ||||||
97 | - | |||||||
98 | class QQuickImageParticle : public QQuickParticlePainter | - | ||||||
99 | { | - | ||||||
100 | public: | - | ||||||
101 | #pragma GCC diagnostic push | - | ||||||
102 | - | |||||||
103 | #pragma GCC diagnostic ignored "-Wsuggest-override" | - | ||||||
104 | static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); static inline QString tr(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } private: | - | ||||||
105 | #pragma GCC diagnostic ignored "-Wattributes" | - | ||||||
106 | __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); | - | ||||||
107 | #pragma GCC diagnostic pop | - | ||||||
108 | struct QPrivateSignal {}; | - | ||||||
109 | - | |||||||
110 | - | |||||||
111 | - | |||||||
112 | - | |||||||
113 | - | |||||||
114 | - | |||||||
115 | - | |||||||
116 | - | |||||||
117 | - | |||||||
118 | - | |||||||
119 | - | |||||||
120 | - | |||||||
121 | - | |||||||
122 | - | |||||||
123 | - | |||||||
124 | - | |||||||
125 | - | |||||||
126 | - | |||||||
127 | - | |||||||
128 | - | |||||||
129 | - | |||||||
130 | - | |||||||
131 | - | |||||||
132 | - | |||||||
133 | - | |||||||
134 | - | |||||||
135 | - | |||||||
136 | - | |||||||
137 | - | |||||||
138 | - | |||||||
139 | - | |||||||
140 | - | |||||||
141 | - | |||||||
142 | - | |||||||
143 | - | |||||||
144 | - | |||||||
145 | public: | - | ||||||
146 | explicit QQuickImageParticle(QQuickItem *parent = 0); | - | ||||||
147 | virtual ~QQuickImageParticle(); | - | ||||||
148 | - | |||||||
149 | enum Status { Null, Ready, Loading, Error }; | - | ||||||
150 | friend constexpr const QMetaObject *qt_getEnumMetaObject(Status) noexcept { return &staticMetaObject; } friend constexpr const char *qt_getEnumName(Status) noexcept { return "Status"; } | - | ||||||
151 | - | |||||||
152 | QQmlListProperty<QQuickSprite> sprites(); | - | ||||||
153 | QQuickStochasticEngine* spriteEngine() {return executed 22348 times by 1 test: m_spriteEngine;return m_spriteEngine; Executed by:
executed 22348 times by 1 test: }return m_spriteEngine; Executed by:
| 22348 | ||||||
154 | - | |||||||
155 | enum EntryEffect { | - | ||||||
156 | None = 0, | - | ||||||
157 | Fade = 1, | - | ||||||
158 | Scale = 2 | - | ||||||
159 | }; | - | ||||||
160 | friend constexpr const QMetaObject *qt_getEnumMetaObject(EntryEffect) noexcept { return &staticMetaObject; } friend constexpr const char *qt_getEnumName(EntryEffect) noexcept { return "EntryEffect"; } | - | ||||||
161 | - | |||||||
162 | enum PerformanceLevel{ | - | ||||||
163 | Unknown = 0, | - | ||||||
164 | Simple, | - | ||||||
165 | Colored, | - | ||||||
166 | Deformable, | - | ||||||
167 | Tabled, | - | ||||||
168 | Sprites | - | ||||||
169 | }; | - | ||||||
170 | - | |||||||
171 | QUrl image() const { return never executed: m_image ? m_image->source : QUrl();return m_image ? m_image->source : QUrl(); never executed: }return m_image ? m_image->source : QUrl(); | 0 | ||||||
172 | void setImage(const QUrl &image); | - | ||||||
173 | - | |||||||
174 | QUrl colortable() const { return never executed: m_colorTable ? m_colorTable->source : QUrl();return m_colorTable ? m_colorTable->source : QUrl(); never executed: }return m_colorTable ? m_colorTable->source : QUrl(); | 0 | ||||||
175 | void setColortable(const QUrl &table); | - | ||||||
176 | - | |||||||
177 | QUrl sizetable() const { return never executed: m_sizeTable ? m_sizeTable->source : QUrl();return m_sizeTable ? m_sizeTable->source : QUrl(); never executed: }return m_sizeTable ? m_sizeTable->source : QUrl(); | 0 | ||||||
178 | void setSizetable (const QUrl &table); | - | ||||||
179 | - | |||||||
180 | QUrl opacitytable() const { return never executed: m_opacityTable ? m_opacityTable->source : QUrl();return m_opacityTable ? m_opacityTable->source : QUrl(); never executed: }return m_opacityTable ? m_opacityTable->source : QUrl(); | 0 | ||||||
181 | void setOpacitytable(const QUrl &table); | - | ||||||
182 | - | |||||||
183 | QColor color() const { return never executed: m_color;return m_color; never executed: }return m_color; | 0 | ||||||
184 | void setColor(const QColor &color); | - | ||||||
185 | - | |||||||
186 | qreal colorVariation() const { return never executed: m_color_variation;return m_color_variation; never executed: }return m_color_variation; | 0 | ||||||
187 | void setColorVariation(qreal var); | - | ||||||
188 | - | |||||||
189 | qreal alphaVariation() const { return never executed: m_alphaVariation;return m_alphaVariation; never executed: }return m_alphaVariation; | 0 | ||||||
190 | - | |||||||
191 | qreal alpha() const { return never executed: m_alpha;return m_alpha; never executed: }return m_alpha; | 0 | ||||||
192 | - | |||||||
193 | qreal redVariation() const { return never executed: m_redVariation;return m_redVariation; never executed: }return m_redVariation; | 0 | ||||||
194 | - | |||||||
195 | qreal greenVariation() const { return never executed: m_greenVariation;return m_greenVariation; never executed: }return m_greenVariation; | 0 | ||||||
196 | - | |||||||
197 | qreal blueVariation() const { return never executed: m_blueVariation;return m_blueVariation; never executed: }return m_blueVariation; | 0 | ||||||
198 | - | |||||||
199 | qreal rotation() const { return never executed: m_rotation;return m_rotation; never executed: }return m_rotation; | 0 | ||||||
200 | - | |||||||
201 | qreal rotationVariation() const { return never executed: m_rotationVariation;return m_rotationVariation; never executed: }return m_rotationVariation; | 0 | ||||||
202 | - | |||||||
203 | qreal rotationVelocity() const { return never executed: m_rotationVelocity;return m_rotationVelocity; never executed: }return m_rotationVelocity; | 0 | ||||||
204 | - | |||||||
205 | qreal rotationVelocityVariation() const { return never executed: m_rotationVelocityVariation;return m_rotationVelocityVariation; never executed: }return m_rotationVelocityVariation; | 0 | ||||||
206 | - | |||||||
207 | bool autoRotation() const { return never executed: m_autoRotation;return m_autoRotation; never executed: }return m_autoRotation; | 0 | ||||||
208 | - | |||||||
209 | QQuickDirection* xVector() const { return never executed: m_xVector;return m_xVector; never executed: }return m_xVector; | 0 | ||||||
210 | - | |||||||
211 | QQuickDirection* yVector() const { return never executed: m_yVector;return m_yVector; never executed: }return m_yVector; | 0 | ||||||
212 | - | |||||||
213 | bool spritesInterpolate() const { return never executed: m_spritesInterpolate;return m_spritesInterpolate; never executed: }return m_spritesInterpolate; | 0 | ||||||
214 | - | |||||||
215 | bool bypassOptimizations() const { return never executed: m_bypassOptimizations;return m_bypassOptimizations; never executed: }return m_bypassOptimizations; | 0 | ||||||
216 | - | |||||||
217 | EntryEffect entryEffect() const { return never executed: m_entryEffect;return m_entryEffect; never executed: }return m_entryEffect; | 0 | ||||||
218 | - | |||||||
219 | Status status() const { return never executed: m_status;return m_status; never executed: }return m_status; | 0 | ||||||
220 | - | |||||||
221 | void resetColor(); | - | ||||||
222 | void resetRotation(); | - | ||||||
223 | void resetDeformation(); | - | ||||||
224 | - | |||||||
225 | public : | - | ||||||
226 | - | |||||||
227 | void imageChanged(); | - | ||||||
228 | void colortableChanged(); | - | ||||||
229 | void sizetableChanged(); | - | ||||||
230 | void opacitytableChanged(); | - | ||||||
231 | - | |||||||
232 | void colorChanged(); | - | ||||||
233 | void colorVariationChanged(); | - | ||||||
234 | - | |||||||
235 | void alphaVariationChanged(qreal arg); | - | ||||||
236 | - | |||||||
237 | void alphaChanged(qreal arg); | - | ||||||
238 | - | |||||||
239 | void redVariationChanged(qreal arg); | - | ||||||
240 | - | |||||||
241 | void greenVariationChanged(qreal arg); | - | ||||||
242 | - | |||||||
243 | void blueVariationChanged(qreal arg); | - | ||||||
244 | - | |||||||
245 | void rotationChanged(qreal arg); | - | ||||||
246 | - | |||||||
247 | void rotationVariationChanged(qreal arg); | - | ||||||
248 | - | |||||||
249 | void rotationVelocityChanged(qreal arg); | - | ||||||
250 | - | |||||||
251 | void rotationVelocityVariationChanged(qreal arg); | - | ||||||
252 | - | |||||||
253 | void autoRotationChanged(bool arg); | - | ||||||
254 | - | |||||||
255 | void xVectorChanged(QQuickDirection* arg); | - | ||||||
256 | - | |||||||
257 | void yVectorChanged(QQuickDirection* arg); | - | ||||||
258 | - | |||||||
259 | void spritesInterpolateChanged(bool arg); | - | ||||||
260 | - | |||||||
261 | void bypassOptimizationsChanged(bool arg); | - | ||||||
262 | - | |||||||
263 | void entryEffectChanged(EntryEffect arg); | - | ||||||
264 | - | |||||||
265 | void statusChanged(Status arg); | - | ||||||
266 | - | |||||||
267 | public : | - | ||||||
268 | void reloadColor(const Color4ub &c, QQuickParticleData* d); | - | ||||||
269 | void setAlphaVariation(qreal arg); | - | ||||||
270 | - | |||||||
271 | void setAlpha(qreal arg); | - | ||||||
272 | - | |||||||
273 | void setRedVariation(qreal arg); | - | ||||||
274 | - | |||||||
275 | void setGreenVariation(qreal arg); | - | ||||||
276 | - | |||||||
277 | void setBlueVariation(qreal arg); | - | ||||||
278 | - | |||||||
279 | void setRotation(qreal arg); | - | ||||||
280 | - | |||||||
281 | void setRotationVariation(qreal arg); | - | ||||||
282 | - | |||||||
283 | void setRotationVelocity(qreal arg); | - | ||||||
284 | - | |||||||
285 | void setRotationVelocityVariation(qreal arg); | - | ||||||
286 | - | |||||||
287 | void setAutoRotation(bool arg); | - | ||||||
288 | - | |||||||
289 | void setXVector(QQuickDirection* arg); | - | ||||||
290 | - | |||||||
291 | void setYVector(QQuickDirection* arg); | - | ||||||
292 | - | |||||||
293 | void setSpritesInterpolate(bool arg); | - | ||||||
294 | - | |||||||
295 | void setBypassOptimizations(bool arg); | - | ||||||
296 | - | |||||||
297 | void setEntryEffect(EntryEffect arg); | - | ||||||
298 | - | |||||||
299 | protected: | - | ||||||
300 | void reset() override; | - | ||||||
301 | void initialize(int gIdx, int pIdx) override; | - | ||||||
302 | void commit(int gIdx, int pIdx) override; | - | ||||||
303 | - | |||||||
304 | QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; | - | ||||||
305 | void prepareNextFrame(QSGNode**); | - | ||||||
306 | void buildParticleNodes(QSGNode**); | - | ||||||
307 | - | |||||||
308 | void sceneGraphInvalidated() override; | - | ||||||
309 | - | |||||||
310 | private : | - | ||||||
311 | void createEngine(); | - | ||||||
312 | - | |||||||
313 | void spriteAdvance(int spriteIndex); | - | ||||||
314 | void spritesUpdate(qreal time = 0 ); | - | ||||||
315 | void mainThreadFetchImageData(); | - | ||||||
316 | void finishBuildParticleNodes(QSGNode **n); | - | ||||||
317 | private: | - | ||||||
318 | struct ImageData { | - | ||||||
319 | QUrl source; | - | ||||||
320 | QQuickPixmap pix; | - | ||||||
321 | }; | - | ||||||
322 | QScopedPointer<ImageData> m_image; | - | ||||||
323 | QScopedPointer<ImageData> m_colorTable; | - | ||||||
324 | QScopedPointer<ImageData> m_sizeTable; | - | ||||||
325 | QScopedPointer<ImageData> m_opacityTable; | - | ||||||
326 | bool loadingSomething(); | - | ||||||
327 | - | |||||||
328 | - | |||||||
329 | QColor m_color; | - | ||||||
330 | qreal m_color_variation; | - | ||||||
331 | - | |||||||
332 | QHash<int, QSGGeometryNode *> m_nodes; | - | ||||||
333 | QHash<int, int> m_idxStarts; | - | ||||||
334 | QList<QPair<int, int> > m_startsIdx; | - | ||||||
335 | - | |||||||
336 | int m_lastIdxStart; | - | ||||||
337 | QSGMaterial *m_material; | - | ||||||
338 | - | |||||||
339 | - | |||||||
340 | - | |||||||
341 | qreal m_alphaVariation; | - | ||||||
342 | qreal m_alpha; | - | ||||||
343 | qreal m_redVariation; | - | ||||||
344 | qreal m_greenVariation; | - | ||||||
345 | qreal m_blueVariation; | - | ||||||
346 | qreal m_rotation; | - | ||||||
347 | qreal m_rotationVariation; | - | ||||||
348 | qreal m_rotationVelocity; | - | ||||||
349 | qreal m_rotationVelocityVariation; | - | ||||||
350 | bool m_autoRotation; | - | ||||||
351 | QQuickDirection* m_xVector; | - | ||||||
352 | QQuickDirection* m_yVector; | - | ||||||
353 | - | |||||||
354 | QList<QQuickSprite*> m_sprites; | - | ||||||
355 | QQuickSpriteEngine* m_spriteEngine; | - | ||||||
356 | bool m_spritesInterpolate; | - | ||||||
357 | - | |||||||
358 | bool m_explicitColor; | - | ||||||
359 | bool m_explicitRotation; | - | ||||||
360 | bool m_explicitDeformation; | - | ||||||
361 | bool m_explicitAnimation; | - | ||||||
362 | QHash<int, QVector<QQuickParticleData*> > m_shadowData; | - | ||||||
363 | void clearShadows(); | - | ||||||
364 | QQuickParticleData* getShadowDatum(QQuickParticleData* datum); | - | ||||||
365 | - | |||||||
366 | bool m_bypassOptimizations; | - | ||||||
367 | PerformanceLevel perfLevel; | - | ||||||
368 | - | |||||||
369 | PerformanceLevel m_lastLevel; | - | ||||||
370 | bool m_debugMode; | - | ||||||
371 | - | |||||||
372 | template<class Vertex> | - | ||||||
373 | void initTexCoords(Vertex* v, int count){ | - | ||||||
374 | Vertex* end = v + count; | - | ||||||
375 | while (v < end
| 12-6000 | ||||||
376 | v[0].tx = 0; | - | ||||||
377 | v[0].ty = 0; | - | ||||||
378 | - | |||||||
379 | v[1].tx = 1; | - | ||||||
380 | v[1].ty = 0; | - | ||||||
381 | - | |||||||
382 | v[2].tx = 0; | - | ||||||
383 | v[2].ty = 1; | - | ||||||
384 | - | |||||||
385 | v[3].tx = 1; | - | ||||||
386 | v[3].ty = 1; | - | ||||||
387 | - | |||||||
388 | v += 4; | - | ||||||
389 | } executed 6000 times by 3 tests: end of block Executed by:
| 6000 | ||||||
390 | } executed 12 times by 3 tests: end of block Executed by:
| 12 | ||||||
391 | - | |||||||
392 | template<class MaterialData> | - | ||||||
393 | static MaterialData* getState(QSGMaterial* m) { | - | ||||||
394 | return executed 139729 times by 21 tests: static_cast<QSGSimpleMaterial<MaterialData> *>(m)->state();return static_cast<QSGSimpleMaterial<MaterialData> *>(m)->state(); Executed by:
executed 139729 times by 21 tests: return static_cast<QSGSimpleMaterial<MaterialData> *>(m)->state(); Executed by:
| 139729 | ||||||
395 | } | - | ||||||
396 | EntryEffect m_entryEffect; | - | ||||||
397 | Status m_status; | - | ||||||
398 | int m_startedImageLoading; | - | ||||||
399 | }; | - | ||||||
400 | - | |||||||
401 | - | |||||||
Switch to Source code | Preprocessed file |