OpenCoverage

qquickshapegenericrenderer.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quickshapes/qquickshapegenericrenderer.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7static const qreal TRI_SCALE = 1;-
8-
9struct ColoredVertex-
10{-
11 float x, y;-
12 QQuickShapeGenericRenderer::Color4ub color;-
13 void set(float nx, float ny, QQuickShapeGenericRenderer::Color4ub ncolor)-
14 {-
15 x = nx; y = ny; color = ncolor;-
16 }
executed 85750 times by 1 test: end of block
Executed by:
  • tst_examples
85750
17};-
18-
19static inline QQuickShapeGenericRenderer::Color4ub colorToColor4ub(const QColor &c)-
20{-
21 QQuickShapeGenericRenderer::Color4ub color = {-
22 uchar(qRound(c.redF() * c.alphaF() * 255)),-
23 uchar(qRound(c.greenF() * c.alphaF() * 255)),-
24 uchar(qRound(c.blueF() * c.alphaF() * 255)),-
25 uchar(qRound(c.alphaF() * 255))-
26 };-
27 return
executed 2078 times by 1 test: return color;
Executed by:
  • tst_examples
color;
executed 2078 times by 1 test: return color;
Executed by:
  • tst_examples
2078
28}-
29-
30QQuickShapeGenericStrokeFillNode::QQuickShapeGenericStrokeFillNode(QQuickWindow *window)-
31 : m_material(nullptr)-
32{-
33 setFlag(QSGNode::OwnsGeometry, true);-
34 setGeometry(new QSGGeometry(QSGGeometry::defaultAttributes_ColoredPoint2D(), 0, 0));-
35 activateMaterial(window, MatSolidColor);-
36-
37 qsgnode_set_description(this, QLatin1String("stroke-fill"));-
38-
39}
executed 1327 times by 1 test: end of block
Executed by:
  • tst_examples
1327
40-
41void QQuickShapeGenericStrokeFillNode::activateMaterial(QQuickWindow *window, Material m)-
42{-
43 switch (m) {-
44 case
executed 1341 times by 1 test: case MatSolidColor:
Executed by:
  • tst_examples
MatSolidColor:
executed 1341 times by 1 test: case MatSolidColor:
Executed by:
  • tst_examples
1341
45-
46-
47 m_material.reset(QQuickShapeGenericMaterialFactory::createVertexColor(window));-
48 break;
executed 1341 times by 1 test: break;
Executed by:
  • tst_examples
1341
49 case
executed 12 times by 1 test: case MatLinearGradient:
Executed by:
  • tst_examples
MatLinearGradient:
executed 12 times by 1 test: case MatLinearGradient:
Executed by:
  • tst_examples
12
50 m_material.reset(QQuickShapeGenericMaterialFactory::createLinearGradient(window, this));-
51 break;
executed 12 times by 1 test: break;
Executed by:
  • tst_examples
12
52 case
executed 4 times by 1 test: case MatRadialGradient:
Executed by:
  • tst_examples
MatRadialGradient:
executed 4 times by 1 test: case MatRadialGradient:
Executed by:
  • tst_examples
4
53 m_material.reset(QQuickShapeGenericMaterialFactory::createRadialGradient(window, this));-
54 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_examples
4
55 case
executed 3 times by 1 test: case MatConicalGradient:
Executed by:
  • tst_examples
MatConicalGradient:
executed 3 times by 1 test: case MatConicalGradient:
Executed by:
  • tst_examples
3
56 m_material.reset(QQuickShapeGenericMaterialFactory::createConicalGradient(window, this));-
57 break;
executed 3 times by 1 test: break;
Executed by:
  • tst_examples
3
58 default
never executed: default:
:
never executed: default:
0
59 QMessageLogger(__FILE__, 106, __PRETTY_FUNCTION__).warning("Unknown material %d", m);-
60 return;
never executed: return;
0
61 }-
62-
63 if (material() != m_material.data()
material() != ...aterial.data()Description
TRUEevaluated 1360 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
)
0-1360
64 setMaterial(m_material.data());
executed 1360 times by 1 test: setMaterial(m_material.data());
Executed by:
  • tst_examples
1360
65}
executed 1360 times by 1 test: end of block
Executed by:
  • tst_examples
1360
66-
67static bool q_supportsElementIndexUint(QSGRendererInterface::GraphicsApi api)-
68{-
69 static bool elementIndexUint = true;-
70-
71 if (api == QSGRendererInterface::OpenGL
api == QSGRend...erface::OpenGLDescription
TRUEevaluated 937 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
) {
0-937
72 static bool elementIndexUintChecked = false;-
73 if (!elementIndexUintChecked
!elementIndexUintCheckedDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 935 times by 1 test
Evaluated by:
  • tst_examples
) {
2-935
74 elementIndexUintChecked = true;-
75 QOpenGLContext *context = QOpenGLContext::currentContext();-
76 QScopedPointer<QOpenGLContext> dummyContext;-
77 QScopedPointer<QOffscreenSurface> dummySurface;-
78 bool ok = true;-
79 if (!context
!contextDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
) {
0-2
80 dummyContext.reset(new QOpenGLContext);-
81 dummyContext->create();-
82 context = dummyContext.data();-
83 dummySurface.reset(new QOffscreenSurface);-
84 dummySurface->setFormat(context->format());-
85 dummySurface->create();-
86 ok = context->makeCurrent(dummySurface.data());-
87 }
never executed: end of block
0
88 if (ok
okDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
) {
0-2
89 elementIndexUint = static_cast<QOpenGLExtensions *>(context->functions())->hasOpenGLExtension(-
90 QOpenGLExtensions::ElementIndexUint);-
91 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_examples
2
92 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_examples
2
93 }
executed 937 times by 1 test: end of block
Executed by:
  • tst_examples
937
94-
95-
96-
97 return
executed 937 times by 1 test: return elementIndexUint;
Executed by:
  • tst_examples
elementIndexUint;
executed 937 times by 1 test: return elementIndexUint;
Executed by:
  • tst_examples
937
98}-
99-
100QQuickShapeGenericRenderer::~QQuickShapeGenericRenderer()-
101{-
102 for (ShapePathData &d : m_sp) {-
103 if (d.pendingFill
d.pendingFillDescription
TRUEevaluated 904 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 135 times by 1 test
Evaluated by:
  • tst_examples
)
135-904
104 d.pendingFill->orphaned = true;
executed 904 times by 1 test: d.pendingFill->orphaned = true;
Executed by:
  • tst_examples
904
105 if (d.pendingStroke
d.pendingStrokeDescription
TRUEevaluated 312 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 727 times by 1 test
Evaluated by:
  • tst_examples
)
312-727
106 d.pendingStroke->orphaned = true;
executed 312 times by 1 test: d.pendingStroke->orphaned = true;
Executed by:
  • tst_examples
312
107 }
executed 1039 times by 1 test: end of block
Executed by:
  • tst_examples
1039
108}
executed 83 times by 1 test: end of block
Executed by:
  • tst_examples
83
109-
110-
111-
112-
113void QQuickShapeGenericRenderer::beginSync(int totalCount)-
114{-
115 if (m_sp.count() != totalCount
m_sp.count() != totalCountDescription
TRUEevaluated 83 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
) {
0-83
116 m_sp.resize(totalCount);-
117 m_accDirty |= DirtyList;-
118 }
executed 83 times by 1 test: end of block
Executed by:
  • tst_examples
83
119 for (ShapePathData &d : m_sp)-
120 d.syncDirty = 0;
executed 1039 times by 1 test: d.syncDirty = 0;
Executed by:
  • tst_examples
1039
121}
executed 83 times by 1 test: end of block
Executed by:
  • tst_examples
83
122-
123void QQuickShapeGenericRenderer::setPath(int index, const QQuickPath *path)-
124{-
125 ShapePathData &d(m_sp[index]);-
126 d.path = path
pathDescription
TRUEevaluated 1039 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
? path->path() : QPainterPath();
0-1039
127 d.syncDirty |= DirtyFillGeom | DirtyStrokeGeom;-
128}
executed 1039 times by 1 test: end of block
Executed by:
  • tst_examples
1039
129-
130void QQuickShapeGenericRenderer::setStrokeColor(int index, const QColor &color)-
131{-
132 ShapePathData &d(m_sp[index]);-
133 d.strokeColor = colorToColor4ub(color);-
134 d.syncDirty |= DirtyColor;-
135}
executed 1039 times by 1 test: end of block
Executed by:
  • tst_examples
1039
136-
137void QQuickShapeGenericRenderer::setStrokeWidth(int index, qreal w)-
138{-
139 ShapePathData &d(m_sp[index]);-
140 d.strokeWidth = w;-
141 if (w >= 0.0f
w >= 0.0fDescription
TRUEevaluated 388 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 651 times by 1 test
Evaluated by:
  • tst_examples
)
388-651
142 d.pen.setWidthF(w);
executed 388 times by 1 test: d.pen.setWidthF(w);
Executed by:
  • tst_examples
388
143 d.syncDirty |= DirtyStrokeGeom;-
144}
executed 1039 times by 1 test: end of block
Executed by:
  • tst_examples
1039
145-
146void QQuickShapeGenericRenderer::setFillColor(int index, const QColor &color)-
147{-
148 ShapePathData &d(m_sp[index]);-
149 d.fillColor = colorToColor4ub(color);-
150 d.syncDirty |= DirtyColor;-
151}
executed 1039 times by 1 test: end of block
Executed by:
  • tst_examples
1039
152-
153void QQuickShapeGenericRenderer::setFillRule(int index, QQuickShapePath::FillRule fillRule)-
154{-
155 ShapePathData &d(m_sp[index]);-
156 d.fillRule = Qt::FillRule(fillRule);-
157 d.syncDirty |= DirtyFillGeom;-
158}
executed 1039 times by 1 test: end of block
Executed by:
  • tst_examples
1039
159-
160void QQuickShapeGenericRenderer::setJoinStyle(int index, QQuickShapePath::JoinStyle joinStyle, int miterLimit)-
161{-
162 ShapePathData &d(m_sp[index]);-
163 d.pen.setJoinStyle(Qt::PenJoinStyle(joinStyle));-
164 d.pen.setMiterLimit(miterLimit);-
165 d.syncDirty |= DirtyStrokeGeom;-
166}
executed 1039 times by 1 test: end of block
Executed by:
  • tst_examples
1039
167-
168void QQuickShapeGenericRenderer::setCapStyle(int index, QQuickShapePath::CapStyle capStyle)-
169{-
170 ShapePathData &d(m_sp[index]);-
171 d.pen.setCapStyle(Qt::PenCapStyle(capStyle));-
172 d.syncDirty |= DirtyStrokeGeom;-
173}
executed 1039 times by 1 test: end of block
Executed by:
  • tst_examples
1039
174-
175void QQuickShapeGenericRenderer::setStrokeStyle(int index, QQuickShapePath::StrokeStyle strokeStyle,-
176 qreal dashOffset, const QVector<qreal> &dashPattern)-
177{-
178 ShapePathData &d(m_sp[index]);-
179 d.pen.setStyle(Qt::PenStyle(strokeStyle));-
180 if (strokeStyle == QQuickShapePath::DashLine
strokeStyle ==...Path::DashLineDescription
TRUEevaluated 21 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 1018 times by 1 test
Evaluated by:
  • tst_examples
) {
21-1018
181 d.pen.setDashPattern(dashPattern);-
182 d.pen.setDashOffset(dashOffset);-
183 }
executed 21 times by 1 test: end of block
Executed by:
  • tst_examples
21
184 d.syncDirty |= DirtyStrokeGeom;-
185}
executed 1039 times by 1 test: end of block
Executed by:
  • tst_examples
1039
186-
187void QQuickShapeGenericRenderer::setFillGradient(int index, QQuickShapeGradient *gradient)-
188{-
189 ShapePathData &d(m_sp[index]);-
190 if (gradient
gradientDescription
TRUEevaluated 19 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 1020 times by 1 test
Evaluated by:
  • tst_examples
) {
19-1020
191 d.fillGradient.stops = gradient->gradientStops();-
192 d.fillGradient.spread = gradient->spread();-
193 if (QQuickShapeLinearGradient *g = qobject_cast<QQuickShapeLinearGradient *>(gradient)
QQuickShapeLin...t *>(gradient)Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 7 times by 1 test
Evaluated by:
  • tst_examples
) {
7-12
194 d.fillGradientActive = LinearGradient;-
195 d.fillGradient.a = QPointF(g->x1(), g->y1());-
196 d.fillGradient.b = QPointF(g->x2(), g->y2());-
197 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_examples
else if (QQuickShapeRadialGradient *g = qobject_cast<QQuickShapeRadialGradient *>(gradient)
QQuickShapeRad...t *>(gradient)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_examples
) {
3-12
198 d.fillGradientActive = RadialGradient;-
199 d.fillGradient.a = QPointF(g->centerX(), g->centerY());-
200 d.fillGradient.b = QPointF(g->focalX(), g->focalY());-
201 d.fillGradient.v0 = g->centerRadius();-
202 d.fillGradient.v1 = g->focalRadius();-
203 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_examples
else if (QQuickShapeConicalGradient *g = qobject_cast<QQuickShapeConicalGradient *>(gradient)
QQuickShapeCon...t *>(gradient)Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
) {
0-4
204 d.fillGradientActive = ConicalGradient;-
205 d.fillGradient.a = QPointF(g->centerX(), g->centerY());-
206 d.fillGradient.v0 = g->angle();-
207 }
executed 3 times by 1 test: end of block
Executed by:
  • tst_examples
else {
3
208 do { ((false) ? static_cast<void>(0) : qt_assert_x("Q_UNREACHABLE()", "Q_UNREACHABLE was reached", __FILE__, 255)); __builtin_unreachable(); } while (false);-
209 }
never executed: end of block
0
210 } else {-
211 d.fillGradientActive = NoGradient;-
212 }
executed 1020 times by 1 test: end of block
Executed by:
  • tst_examples
1020
213 d.syncDirty |= DirtyFillGradient;-
214}
executed 1039 times by 1 test: end of block
Executed by:
  • tst_examples
1039
215-
216void QQuickShapeFillRunnable::run()-
217{-
218 QQuickShapeGenericRenderer::triangulateFill(path, fillColor, &fillVertices, &fillIndices, &indexType, supportsElementIndexUint);-
219 done(this);-
220}
executed 904 times by 1 test: end of block
Executed by:
  • tst_examples
904
221-
222void QQuickShapeStrokeRunnable::run()-
223{-
224 QQuickShapeGenericRenderer::triangulateStroke(path, pen, strokeColor, &strokeVertices, clipSize);-
225 done(this);-
226}
executed 312 times by 1 test: end of block
Executed by:
  • tst_examples
312
227-
228void QQuickShapeGenericRenderer::setAsyncCallback(void (*callback)(void *), void *data)-
229{-
230 m_asyncCallback = callback;-
231 m_asyncCallbackData = data;-
232}
executed 4 times by 1 test: end of block
Executed by:
  • tst_examples
4
233-
234static QThreadPool *pathWorkThreadPool = nullptr;-
235-
236static void deletePathWorkThreadPool()-
237{-
238 delete pathWorkThreadPool;-
239 pathWorkThreadPool = nullptr;-
240}
executed 2 times by 1 test: end of block
Executed by:
  • tst_examples
2
241-
242void QQuickShapeGenericRenderer::endSync(bool async)-
243{-
244 bool didKickOffAsync = false;-
245-
246 for (int i = 0; i < m_sp.count()
i < m_sp.count()Description
TRUEevaluated 1039 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 83 times by 1 test
Evaluated by:
  • tst_examples
; ++i) {
83-1039
247 ShapePathData &d(m_sp[i]);-
248 if (!d.syncDirty
!d.syncDirtyDescription
TRUEnever evaluated
FALSEevaluated 1039 times by 1 test
Evaluated by:
  • tst_examples
)
0-1039
249 continue;
never executed: continue;
0
250-
251 m_accDirty |= d.syncDirty;-
252-
253-
254-
255-
256-
257-
258 d.effectiveDirty |= d.syncDirty;-
259-
260 if (d.path.isEmpty()
d.path.isEmpty()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 1029 times by 1 test
Evaluated by:
  • tst_examples
) {
10-1029
261 d.fillVertices.clear();-
262 d.fillIndices.clear();-
263 d.strokeVertices.clear();-
264 continue;
executed 10 times by 1 test: continue;
Executed by:
  • tst_examples
10
265 }-
266-
267 if (async
asyncDescription
TRUEevaluated 956 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 73 times by 1 test
Evaluated by:
  • tst_examples
&& !pathWorkThreadPool
!pathWorkThreadPoolDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 954 times by 1 test
Evaluated by:
  • tst_examples
) {
2-956
268 qAddPostRoutine(deletePathWorkThreadPool);-
269 pathWorkThreadPool = new QThreadPool;-
270 const int idealCount = QThread::idealThreadCount();-
271 pathWorkThreadPool->setMaxThreadCount(idealCount > 0 ? idealCount * 2 : 4);-
272 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_examples
2
273-
274 if ((
(d.syncDirty & DirtyFillGeom)Description
TRUEevaluated 1029 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
d.syncDirty & DirtyFillGeom)
(d.syncDirty & DirtyFillGeom)Description
TRUEevaluated 1029 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
&& d.fillColor.a
d.fillColor.aDescription
TRUEevaluated 937 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 92 times by 1 test
Evaluated by:
  • tst_examples
) {
0-1029
275 d.path.setFillRule(d.fillRule);-
276 if (m_api == QSGRendererInterface::Unknown
m_api == QSGRe...rface::UnknownDescription
TRUEevaluated 37 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 900 times by 1 test
Evaluated by:
  • tst_examples
)
37-900
277 m_api = m_item->window()->rendererInterface()->graphicsApi();
executed 37 times by 1 test: m_api = m_item->window()->rendererInterface()->graphicsApi();
Executed by:
  • tst_examples
37
278 if (async
asyncDescription
TRUEevaluated 904 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 33 times by 1 test
Evaluated by:
  • tst_examples
) {
33-904
279 QQuickShapeFillRunnable *r = new QQuickShapeFillRunnable;-
280 r->setAutoDelete(false);-
281 if (d.pendingFill
d.pendingFillDescription
TRUEnever evaluated
FALSEevaluated 904 times by 1 test
Evaluated by:
  • tst_examples
)
0-904
282 d.pendingFill->orphaned = true;
never executed: d.pendingFill->orphaned = true;
0
283 d.pendingFill = r;-
284 r->path = d.path;-
285 r->fillColor = d.fillColor;-
286 r->supportsElementIndexUint = q_supportsElementIndexUint(m_api);-
287-
288-
289 QObject::connect(r, &QQuickShapeFillRunnable::done, (static_cast<QGuiApplication *>(QCoreApplication::instance())), [this, i](QQuickShapeFillRunnable *r) {-
290-
291-
292 if (!r->orphaned
!r->orphanedDescription
TRUEnever evaluated
FALSEevaluated 904 times by 1 test
Evaluated by:
  • tst_examples
&& i < m_sp.count()
i < m_sp.count()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0-904
293 ShapePathData &d(m_sp[i]);-
294 d.fillVertices = r->fillVertices;-
295 d.fillIndices = r->fillIndices;-
296 d.indexType = r->indexType;-
297 d.pendingFill = nullptr;-
298 d.effectiveDirty |= DirtyFillGeom;-
299 maybeUpdateAsyncItem();-
300 }
never executed: end of block
0
301 r->deleteLater();-
302 }
executed 904 times by 1 test: end of block
Executed by:
  • tst_examples
)
;
904
303 didKickOffAsync = true;-
304 pathWorkThreadPool->start(r);-
305 }
executed 904 times by 1 test: end of block
Executed by:
  • tst_examples
else {
904
306 triangulateFill(d.path, d.fillColor, &d.fillVertices, &d.fillIndices, &d.indexType, q_supportsElementIndexUint(m_api));-
307 }
executed 33 times by 1 test: end of block
Executed by:
  • tst_examples
33
308 }-
309-
310 if ((
(d.syncDirty &...rtyStrokeGeom)Description
TRUEevaluated 1029 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
d.syncDirty & DirtyStrokeGeom)
(d.syncDirty &...rtyStrokeGeom)Description
TRUEevaluated 1029 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
&& d.strokeWidth >= 0.0f
d.strokeWidth >= 0.0fDescription
TRUEevaluated 382 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 647 times by 1 test
Evaluated by:
  • tst_examples
&& d.strokeColor.a
d.strokeColor.aDescription
TRUEevaluated 378 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
) {
0-1029
311 if (async
asyncDescription
TRUEevaluated 312 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 66 times by 1 test
Evaluated by:
  • tst_examples
) {
66-312
312 QQuickShapeStrokeRunnable *r = new QQuickShapeStrokeRunnable;-
313 r->setAutoDelete(false);-
314 if (d.pendingStroke
d.pendingStrokeDescription
TRUEnever evaluated
FALSEevaluated 312 times by 1 test
Evaluated by:
  • tst_examples
)
0-312
315 d.pendingStroke->orphaned = true;
never executed: d.pendingStroke->orphaned = true;
0
316 d.pendingStroke = r;-
317 r->path = d.path;-
318 r->pen = d.pen;-
319 r->strokeColor = d.strokeColor;-
320 r->clipSize = QSize(m_item->width(), m_item->height());-
321 QObject::connect(r, &QQuickShapeStrokeRunnable::done, (static_cast<QGuiApplication *>(QCoreApplication::instance())), [this, i](QQuickShapeStrokeRunnable *r) {-
322 if (!r->orphaned
!r->orphanedDescription
TRUEnever evaluated
FALSEevaluated 312 times by 1 test
Evaluated by:
  • tst_examples
&& i < m_sp.count()
i < m_sp.count()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0-312
323 ShapePathData &d(m_sp[i]);-
324 d.strokeVertices = r->strokeVertices;-
325 d.pendingStroke = nullptr;-
326 d.effectiveDirty |= DirtyStrokeGeom;-
327 maybeUpdateAsyncItem();-
328 }
never executed: end of block
0
329 r->deleteLater();-
330 }
executed 312 times by 1 test: end of block
Executed by:
  • tst_examples
)
;
312
331 didKickOffAsync = true;-
332 pathWorkThreadPool->start(r);-
333 }
executed 312 times by 1 test: end of block
Executed by:
  • tst_examples
else {
312
334 triangulateStroke(d.path, d.pen, d.strokeColor, &d.strokeVertices,-
335 QSize(m_item->width(), m_item->height()));-
336 }
executed 66 times by 1 test: end of block
Executed by:
  • tst_examples
66
337 }-
338 }
executed 1029 times by 1 test: end of block
Executed by:
  • tst_examples
1029
339-
340 if (!didKickOffAsync
!didKickOffAsyncDescription
TRUEevaluated 79 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
&& async
asyncDescription
TRUEnever evaluated
FALSEevaluated 79 times by 1 test
Evaluated by:
  • tst_examples
&& m_asyncCallback
m_asyncCallbackDescription
TRUEnever evaluated
FALSEnever evaluated
)
0-79
341 m_asyncCallback(m_asyncCallbackData);
never executed: m_asyncCallback(m_asyncCallbackData);
0
342}
executed 83 times by 1 test: end of block
Executed by:
  • tst_examples
83
343-
344void QQuickShapeGenericRenderer::maybeUpdateAsyncItem()-
345{-
346 for (const ShapePathData &d : qAsConst(m_sp)) {-
347 if (d.pendingFill
d.pendingFillDescription
TRUEnever evaluated
FALSEnever evaluated
|| d.pendingStroke
d.pendingStrokeDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
348 return;
never executed: return;
0
349 }
never executed: end of block
0
350 m_accDirty |= DirtyFillGeom | DirtyStrokeGeom;-
351 m_item->update();-
352 if (m_asyncCallback
m_asyncCallbackDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
353 m_asyncCallback(m_asyncCallbackData);
never executed: m_asyncCallback(m_asyncCallbackData);
0
354}
never executed: end of block
0
355-
356-
357-
358void QQuickShapeGenericRenderer::triangulateFill(const QPainterPath &path,-
359 const Color4ub &fillColor,-
360 VertexContainerType *fillVertices,-
361 IndexContainerType *fillIndices,-
362 QSGGeometry::Type *indexType,-
363 bool supportsElementIndexUint)-
364{-
365 const QVectorPath &vp = qtVectorPathForPath(path);-
366-
367 QTriangleSet ts = qTriangulate(vp, QTransform::fromScale(TRI_SCALE, TRI_SCALE), 1, supportsElementIndexUint);-
368 const int vertexCount = ts.vertices.count() / 2;-
369 fillVertices->resize(vertexCount);-
370 ColoredVertex *vdst = reinterpret_cast<ColoredVertex *>(fillVertices->data());-
371 const qreal *vsrc = ts.vertices.constData();-
372 for (int i = 0; i < vertexCount
i < vertexCountDescription
TRUEevaluated 33801 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 937 times by 1 test
Evaluated by:
  • tst_examples
; ++i)
937-33801
373 vdst[i].set(vsrc[i * 2] / TRI_SCALE, vsrc[i * 2 + 1] / TRI_SCALE, fillColor);
executed 33800 times by 1 test: vdst[i].set(vsrc[i * 2] / TRI_SCALE, vsrc[i * 2 + 1] / TRI_SCALE, fillColor);
Executed by:
  • tst_examples
33800
374-
375 size_t indexByteSize;-
376 if (ts.indices.type() == QVertexIndexVector::UnsignedShort
ts.indices.typ...:UnsignedShortDescription
TRUEnever evaluated
FALSEevaluated 936 times by 1 test
Evaluated by:
  • tst_examples
) {
0-936
377 *indexType = QSGGeometry::UnsignedShortType;-
378-
379-
380 fillIndices->resize(ts.indices.size() / 2);-
381 indexByteSize = ts.indices.size() * sizeof(quint16);-
382 }
never executed: end of block
else {
0
383 *indexType = QSGGeometry::UnsignedIntType;-
384 fillIndices->resize(ts.indices.size());-
385 indexByteSize = ts.indices.size() * sizeof(quint32);-
386 }
executed 935 times by 1 test: end of block
Executed by:
  • tst_examples
935
387 memcpy(fillIndices->data(), ts.indices.data(), indexByteSize);-
388}
executed 935 times by 1 test: end of block
Executed by:
  • tst_examples
935
389-
390void QQuickShapeGenericRenderer::triangulateStroke(const QPainterPath &path,-
391 const QPen &pen,-
392 const Color4ub &strokeColor,-
393 VertexContainerType *strokeVertices,-
394 const QSize &clipSize)-
395{-
396 const QVectorPath &vp = qtVectorPathForPath(path);-
397 const QRectF clip(QPointF(0, 0), clipSize);-
398 const qreal inverseScale = 1.0 / TRI_SCALE;-
399-
400 QTriangulatingStroker stroker;-
401 stroker.setInvScale(inverseScale);-
402-
403 if (pen.style() == Qt::SolidLine
pen.style() == Qt::SolidLineDescription
TRUEevaluated 357 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 21 times by 1 test
Evaluated by:
  • tst_examples
) {
21-357
404 stroker.process(vp, pen, clip, nullptr);-
405 }
executed 357 times by 1 test: end of block
Executed by:
  • tst_examples
else {
357
406 QDashedStrokeProcessor dashStroker;-
407 dashStroker.setInvScale(inverseScale);-
408 dashStroker.process(vp, pen, clip, nullptr);-
409 QVectorPath dashStroke(dashStroker.points(), dashStroker.elementCount(),-
410 dashStroker.elementTypes(), 0);-
411 stroker.process(dashStroke, pen, clip, nullptr);-
412 }
executed 21 times by 1 test: end of block
Executed by:
  • tst_examples
21
413-
414 if (!stroker.vertexCount()
!stroker.vertexCount()Description
TRUEnever evaluated
FALSEevaluated 378 times by 1 test
Evaluated by:
  • tst_examples
) {
0-378
415 strokeVertices->clear();-
416 return;
never executed: return;
0
417 }-
418-
419 const int vertexCount = stroker.vertexCount() / 2;-
420 strokeVertices->resize(vertexCount);-
421 ColoredVertex *vdst = reinterpret_cast<ColoredVertex *>(strokeVertices->data());-
422 const float *vsrc = stroker.vertices();-
423 for (int i = 0; i < vertexCount
i < vertexCountDescription
TRUEevaluated 51988 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 378 times by 1 test
Evaluated by:
  • tst_examples
; ++i)
378-51988
424 vdst[i].set(vsrc[i * 2], vsrc[i * 2 + 1], strokeColor);
executed 51989 times by 1 test: vdst[i].set(vsrc[i * 2], vsrc[i * 2 + 1], strokeColor);
Executed by:
  • tst_examples
51989
425}
executed 378 times by 1 test: end of block
Executed by:
  • tst_examples
378
426-
427void QQuickShapeGenericRenderer::setRootNode(QQuickShapeGenericNode *node)-
428{-
429 if (m_rootNode != node
m_rootNode != nodeDescription
TRUEevaluated 83 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
) {
0-83
430 m_rootNode = node;-
431 m_accDirty |= DirtyList;-
432 }
executed 83 times by 1 test: end of block
Executed by:
  • tst_examples
83
433}
executed 83 times by 1 test: end of block
Executed by:
  • tst_examples
83
434-
435-
436void QQuickShapeGenericRenderer::updateNode()-
437{-
438 if (!m_rootNode
!m_rootNodeDescription
TRUEnever evaluated
FALSEevaluated 83 times by 1 test
Evaluated by:
  • tst_examples
|| !m_accDirty
!m_accDirtyDescription
TRUEnever evaluated
FALSEevaluated 83 times by 1 test
Evaluated by:
  • tst_examples
)
0-83
439 return;
never executed: return;
0
440 QQuickShapeGenericNode **nodePtr = &m_rootNode;-
441 QQuickShapeGenericNode *prevNode = nullptr;-
442-
443 for (ShapePathData &d : m_sp) {-
444 if (!*nodePtr
!*nodePtrDescription
TRUEevaluated 956 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 83 times by 1 test
Evaluated by:
  • tst_examples
) {
83-956
445 ((prevNode) ? static_cast<void>(0) : qt_assert("prevNode", __FILE__, 503));-
446 *nodePtr = new QQuickShapeGenericNode;-
447 prevNode->m_next = *nodePtr;-
448 prevNode->appendChildNode(*nodePtr);-
449 }
executed 956 times by 1 test: end of block
Executed by:
  • tst_examples
956
450-
451 QQuickShapeGenericNode *node = *nodePtr;-
452-
453 if (m_accDirty & DirtyList
m_accDirty & DirtyListDescription
TRUEevaluated 1039 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
)
0-1039
454 d.effectiveDirty |= DirtyFillGeom | DirtyStrokeGeom | DirtyColor | DirtyFillGradient;
executed 1039 times by 1 test: d.effectiveDirty |= DirtyFillGeom | DirtyStrokeGeom | DirtyColor | DirtyFillGradient;
Executed by:
  • tst_examples
1039
455-
456 if (!d.effectiveDirty
!d.effectiveDirtyDescription
TRUEnever evaluated
FALSEevaluated 1039 times by 1 test
Evaluated by:
  • tst_examples
) {
0-1039
457 prevNode = node;-
458 nodePtr = &node->m_next;-
459 continue;
never executed: continue;
0
460 }-
461-
462 if (d.fillColor.a == 0
d.fillColor.a == 0Description
TRUEevaluated 96 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 943 times by 1 test
Evaluated by:
  • tst_examples
) {
96-943
463 delete node->m_fillNode;-
464 node->m_fillNode = nullptr;-
465 }
executed 96 times by 1 test: end of block
Executed by:
  • tst_examples
else if (!node->m_fillNode
!node->m_fillNodeDescription
TRUEevaluated 943 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
) {
0-943
466 node->m_fillNode = new QQuickShapeGenericStrokeFillNode(m_item->window());-
467 if (node->m_strokeNode
node->m_strokeNodeDescription
TRUEnever evaluated
FALSEevaluated 943 times by 1 test
Evaluated by:
  • tst_examples
)
0-943
468 node->removeChildNode(node->m_strokeNode);
never executed: node->removeChildNode(node->m_strokeNode);
0
469 node->appendChildNode(node->m_fillNode);-
470 if (node->m_strokeNode
node->m_strokeNodeDescription
TRUEnever evaluated
FALSEevaluated 943 times by 1 test
Evaluated by:
  • tst_examples
)
0-943
471 node->appendChildNode(node->m_strokeNode);
never executed: node->appendChildNode(node->m_strokeNode);
0
472 d.effectiveDirty |= DirtyFillGeom;-
473 }
executed 943 times by 1 test: end of block
Executed by:
  • tst_examples
943
474-
475 if (d.strokeWidth < 0.0f
d.strokeWidth < 0.0fDescription
TRUEevaluated 651 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 388 times by 1 test
Evaluated by:
  • tst_examples
|| d.strokeColor.a == 0
d.strokeColor.a == 0Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 384 times by 1 test
Evaluated by:
  • tst_examples
) {
4-651
476 delete node->m_strokeNode;-
477 node->m_strokeNode = nullptr;-
478 }
executed 655 times by 1 test: end of block
Executed by:
  • tst_examples
else if (!node->m_strokeNode
!node->m_strokeNodeDescription
TRUEevaluated 384 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
) {
0-655
479 node->m_strokeNode = new QQuickShapeGenericStrokeFillNode(m_item->window());-
480 node->appendChildNode(node->m_strokeNode);-
481 d.effectiveDirty |= DirtyStrokeGeom;-
482 }
executed 384 times by 1 test: end of block
Executed by:
  • tst_examples
384
483-
484 updateFillNode(&d, node);-
485 updateStrokeNode(&d, node);-
486-
487 d.effectiveDirty = 0;-
488-
489 prevNode = node;-
490 nodePtr = &node->m_next;-
491 }
executed 1039 times by 1 test: end of block
Executed by:
  • tst_examples
1039
492-
493 if (*
*nodePtrDescription
TRUEnever evaluated
FALSEevaluated 83 times by 1 test
Evaluated by:
  • tst_examples
nodePtr
*nodePtrDescription
TRUEnever evaluated
FALSEevaluated 83 times by 1 test
Evaluated by:
  • tst_examples
&& prevNode
prevNodeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0-83
494 prevNode->removeChildNode(*nodePtr);-
495 delete *nodePtr;-
496 *nodePtr = nullptr;-
497 }
never executed: end of block
0
498-
499 m_accDirty = 0;-
500}
executed 83 times by 1 test: end of block
Executed by:
  • tst_examples
83
501-
502void QQuickShapeGenericRenderer::updateShadowDataInNode(ShapePathData *d, QQuickShapeGenericStrokeFillNode *n)-
503{-
504 if (d->fillGradientActive
d->fillGradientActiveDescription
TRUEevaluated 19 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 924 times by 1 test
Evaluated by:
  • tst_examples
) {
19-924
505 if (d->effectiveDirty & DirtyFillGradient
d->effectiveDi...tyFillGradientDescription
TRUEevaluated 19 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
)
0-19
506 n->m_fillGradient = d->fillGradient;
executed 19 times by 1 test: n->m_fillGradient = d->fillGradient;
Executed by:
  • tst_examples
19
507 }
executed 19 times by 1 test: end of block
Executed by:
  • tst_examples
19
508}
executed 943 times by 1 test: end of block
Executed by:
  • tst_examples
943
509-
510void QQuickShapeGenericRenderer::updateFillNode(ShapePathData *d, QQuickShapeGenericNode *node)-
511{-
512 if (!node->m_fillNode
!node->m_fillNodeDescription
TRUEevaluated 96 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 943 times by 1 test
Evaluated by:
  • tst_examples
)
96-943
513 return;
executed 96 times by 1 test: return;
Executed by:
  • tst_examples
96
514 if (!(d->effectiveDirty & (DirtyFillGeom | DirtyColor | DirtyFillGradient))
!(d->effective...FillGradient))Description
TRUEnever evaluated
FALSEevaluated 943 times by 1 test
Evaluated by:
  • tst_examples
)
0-943
515 return;
never executed: return;
0
516-
517-
518-
519 QQuickShapeGenericStrokeFillNode *n = node->m_fillNode;-
520 updateShadowDataInNode(d, n);-
521-
522 QSGGeometry *g = n->geometry();-
523 if (d->fillVertices.isEmpty()
d->fillVertices.isEmpty()Description
TRUEevaluated 910 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 33 times by 1 test
Evaluated by:
  • tst_examples
) {
33-910
524 if (g->vertexCount()
g->vertexCount()Description
TRUEnever evaluated
FALSEevaluated 910 times by 1 test
Evaluated by:
  • tst_examples
|| g->indexCount()
g->indexCount()Description
TRUEnever evaluated
FALSEevaluated 910 times by 1 test
Evaluated by:
  • tst_examples
) {
0-910
525 g->allocate(0, 0);-
526 n->markDirty(QSGNode::DirtyGeometry);-
527 }
never executed: end of block
0
528 return;
executed 910 times by 1 test: return;
Executed by:
  • tst_examples
910
529 }-
530-
531 if (d->fillGradientActive
d->fillGradientActiveDescription
TRUEevaluated 19 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_examples
) {
14-19
532 QQuickShapeGenericStrokeFillNode::Material gradMat;-
533 switch (d->fillGradientActive) {-
534 case
executed 12 times by 1 test: case LinearGradient:
Executed by:
  • tst_examples
LinearGradient:
executed 12 times by 1 test: case LinearGradient:
Executed by:
  • tst_examples
12
535 gradMat = QQuickShapeGenericStrokeFillNode::MatLinearGradient;-
536 break;
executed 12 times by 1 test: break;
Executed by:
  • tst_examples
12
537 case
executed 4 times by 1 test: case RadialGradient:
Executed by:
  • tst_examples
RadialGradient:
executed 4 times by 1 test: case RadialGradient:
Executed by:
  • tst_examples
4
538 gradMat = QQuickShapeGenericStrokeFillNode::MatRadialGradient;-
539 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_examples
4
540 case
executed 3 times by 1 test: case ConicalGradient:
Executed by:
  • tst_examples
ConicalGradient:
executed 3 times by 1 test: case ConicalGradient:
Executed by:
  • tst_examples
3
541 gradMat = QQuickShapeGenericStrokeFillNode::MatConicalGradient;-
542 break;
executed 3 times by 1 test: break;
Executed by:
  • tst_examples
3
543 default
never executed: default:
:
never executed: default:
0
544 do { ((false) ? static_cast<void>(0) : qt_assert_x("Q_UNREACHABLE()", "Q_UNREACHABLE was reached", __FILE__, 602)); __builtin_unreachable(); } while (false);-
545 return;
never executed: return;
0
546 }-
547 n->activateMaterial(m_item->window(), gradMat);-
548 if (d->effectiveDirty & DirtyFillGradient
d->effectiveDi...tyFillGradientDescription
TRUEevaluated 19 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
) {
0-19
549-
550 n->markDirty(QSGNode::DirtyMaterial);-
551-
552 if (!(d->effectiveDirty & DirtyFillGeom)
!(d->effective...DirtyFillGeom)Description
TRUEnever evaluated
FALSEevaluated 19 times by 1 test
Evaluated by:
  • tst_examples
)
0-19
553 return;
never executed: return;
0
554 }
executed 19 times by 1 test: end of block
Executed by:
  • tst_examples
19
555 }
executed 19 times by 1 test: end of block
Executed by:
  • tst_examples
else {
19
556 n->activateMaterial(m_item->window(), QQuickShapeGenericStrokeFillNode::MatSolidColor);-
557-
558 if ((
(d->effectiveD... & DirtyColor)Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
d->effectiveDirty & DirtyColor)
(d->effectiveD... & DirtyColor)Description
TRUEevaluated 14 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
&& !(d->effectiveDirty & DirtyFillGeom)
!(d->effective...DirtyFillGeom)Description
TRUEnever evaluated
FALSEevaluated 14 times by 1 test
Evaluated by:
  • tst_examples
) {
0-14
559 ColoredVertex *vdst = reinterpret_cast<ColoredVertex *>(g->vertexData());-
560 for (int i = 0; i < g->vertexCount()
i < g->vertexCount()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
561 vdst[i].set(vdst[i].x, vdst[i].y, d->fillColor);
never executed: vdst[i].set(vdst[i].x, vdst[i].y, d->fillColor);
0
562 n->markDirty(QSGNode::DirtyGeometry);-
563 return;
never executed: return;
0
564 }-
565 }
executed 14 times by 1 test: end of block
Executed by:
  • tst_examples
14
566-
567 const int indexCount = d->indexType == QSGGeometry::UnsignedShortType
d->indexType =...ignedShortTypeDescription
TRUEnever evaluated
FALSEevaluated 33 times by 1 test
Evaluated by:
  • tst_examples
0-33
568 ? d->fillIndices.count() * 2 : d->fillIndices.count();-
569 if (g->indexType() != d->indexType
g->indexType() != d->indexTypeDescription
TRUEevaluated 33 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
) {
0-33
570 g = new QSGGeometry(QSGGeometry::defaultAttributes_ColoredPoint2D(),-
571 d->fillVertices.count(), indexCount, d->indexType);-
572 n->setGeometry(g);-
573 }
executed 33 times by 1 test: end of block
Executed by:
  • tst_examples
else {
33
574 g->allocate(d->fillVertices.count(), indexCount);-
575 }
never executed: end of block
0
576 g->setDrawingMode(QSGGeometry::DrawTriangles);-
577 memcpy(g->vertexData(), d->fillVertices.constData(), g->vertexCount() * g->sizeOfVertex());-
578 memcpy(g->indexData(), d->fillIndices.constData(), g->indexCount() * g->sizeOfIndex());-
579-
580 n->markDirty(QSGNode::DirtyGeometry);-
581}
executed 33 times by 1 test: end of block
Executed by:
  • tst_examples
33
582-
583void QQuickShapeGenericRenderer::updateStrokeNode(ShapePathData *d, QQuickShapeGenericNode *node)-
584{-
585 if (!node->m_strokeNode
!node->m_strokeNodeDescription
TRUEevaluated 655 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 384 times by 1 test
Evaluated by:
  • tst_examples
)
384-655
586 return;
executed 655 times by 1 test: return;
Executed by:
  • tst_examples
655
587 if (!(d->effectiveDirty & (DirtyStrokeGeom | DirtyColor))
!(d->effective...| DirtyColor))Description
TRUEnever evaluated
FALSEevaluated 384 times by 1 test
Evaluated by:
  • tst_examples
)
0-384
588 return;
never executed: return;
0
589-
590 QQuickShapeGenericStrokeFillNode *n = node->m_strokeNode;-
591 QSGGeometry *g = n->geometry();-
592 if (d->strokeVertices.isEmpty()
d->strokeVertices.isEmpty()Description
TRUEevaluated 318 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 66 times by 1 test
Evaluated by:
  • tst_examples
) {
66-318
593 if (g->vertexCount()
g->vertexCount()Description
TRUEnever evaluated
FALSEevaluated 318 times by 1 test
Evaluated by:
  • tst_examples
|| g->indexCount()
g->indexCount()Description
TRUEnever evaluated
FALSEevaluated 318 times by 1 test
Evaluated by:
  • tst_examples
) {
0-318
594 g->allocate(0, 0);-
595 n->markDirty(QSGNode::DirtyGeometry);-
596 }
never executed: end of block
0
597 return;
executed 318 times by 1 test: return;
Executed by:
  • tst_examples
318
598 }-
599-
600 n->markDirty(QSGNode::DirtyGeometry);-
601-
602-
603-
604-
605 if (!g->vertexCount()
!g->vertexCount()Description
TRUEevaluated 66 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
)
0-66
606 n->markDirty(QSGNode::DirtyMaterial);
executed 66 times by 1 test: n->markDirty(QSGNode::DirtyMaterial);
Executed by:
  • tst_examples
66
607-
608 if ((
(d->effectiveD... & DirtyColor)Description
TRUEevaluated 66 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
d->effectiveDirty & DirtyColor)
(d->effectiveD... & DirtyColor)Description
TRUEevaluated 66 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
&& !(d->effectiveDirty & DirtyStrokeGeom)
!(d->effective...rtyStrokeGeom)Description
TRUEnever evaluated
FALSEevaluated 66 times by 1 test
Evaluated by:
  • tst_examples
) {
0-66
609 ColoredVertex *vdst = reinterpret_cast<ColoredVertex *>(g->vertexData());-
610 for (int i = 0; i < g->vertexCount()
i < g->vertexCount()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i)
0
611 vdst[i].set(vdst[i].x, vdst[i].y, d->strokeColor);
never executed: vdst[i].set(vdst[i].x, vdst[i].y, d->strokeColor);
0
612 return;
never executed: return;
0
613 }-
614-
615 g->allocate(d->strokeVertices.count(), 0);-
616 g->setDrawingMode(QSGGeometry::DrawTriangleStrip);-
617 memcpy(g->vertexData(), d->strokeVertices.constData(), g->vertexCount() * g->sizeOfVertex());-
618}
executed 66 times by 1 test: end of block
Executed by:
  • tst_examples
66
619-
620QSGMaterial *QQuickShapeGenericMaterialFactory::createVertexColor(QQuickWindow *window)-
621{-
622 QSGRendererInterface::GraphicsApi api = window->rendererInterface()->graphicsApi();-
623-
624-
625 if (api == QSGRendererInterface::OpenGL
api == QSGRend...erface::OpenGLDescription
TRUEevaluated 1341 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
)
0-1341
626 return
executed 1341 times by 1 test: return new QSGVertexColorMaterial;
Executed by:
  • tst_examples
new QSGVertexColorMaterial;
executed 1341 times by 1 test: return new QSGVertexColorMaterial;
Executed by:
  • tst_examples
1341
627-
628-
629 QMessageLogger(__FILE__, 687, __PRETTY_FUNCTION__).warning("Vertex-color material: Unsupported graphics API %d", api);-
630 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
631}-
632-
633QSGMaterial *QQuickShapeGenericMaterialFactory::createLinearGradient(QQuickWindow *window,-
634 QQuickShapeGenericStrokeFillNode *node)-
635{-
636 QSGRendererInterface::GraphicsApi api = window->rendererInterface()->graphicsApi();-
637-
638-
639 if (api == QSGRendererInterface::OpenGL
api == QSGRend...erface::OpenGLDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
)
0-12
640 return
executed 12 times by 1 test: return new QQuickShapeLinearGradientMaterial(node);
Executed by:
  • tst_examples
new QQuickShapeLinearGradientMaterial(node);
executed 12 times by 1 test: return new QQuickShapeLinearGradientMaterial(node);
Executed by:
  • tst_examples
12
641-
642-
643-
644-
645 QMessageLogger(__FILE__, 703, __PRETTY_FUNCTION__).warning("Linear gradient material: Unsupported graphics API %d", api);-
646 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
647}-
648-
649QSGMaterial *QQuickShapeGenericMaterialFactory::createRadialGradient(QQuickWindow *window,-
650 QQuickShapeGenericStrokeFillNode *node)-
651{-
652 QSGRendererInterface::GraphicsApi api = window->rendererInterface()->graphicsApi();-
653-
654-
655 if (api == QSGRendererInterface::OpenGL
api == QSGRend...erface::OpenGLDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
)
0-4
656 return
executed 4 times by 1 test: return new QQuickShapeRadialGradientMaterial(node);
Executed by:
  • tst_examples
new QQuickShapeRadialGradientMaterial(node);
executed 4 times by 1 test: return new QQuickShapeRadialGradientMaterial(node);
Executed by:
  • tst_examples
4
657-
658-
659-
660-
661 QMessageLogger(__FILE__, 719, __PRETTY_FUNCTION__).warning("Radial gradient material: Unsupported graphics API %d", api);-
662 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
663}-
664-
665QSGMaterial *QQuickShapeGenericMaterialFactory::createConicalGradient(QQuickWindow *window,-
666 QQuickShapeGenericStrokeFillNode *node)-
667{-
668 QSGRendererInterface::GraphicsApi api = window->rendererInterface()->graphicsApi();-
669-
670-
671 if (api == QSGRendererInterface::OpenGL
api == QSGRend...erface::OpenGLDescription
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
)
0-3
672 return
executed 3 times by 1 test: return new QQuickShapeConicalGradientMaterial(node);
Executed by:
  • tst_examples
new QQuickShapeConicalGradientMaterial(node);
executed 3 times by 1 test: return new QQuickShapeConicalGradientMaterial(node);
Executed by:
  • tst_examples
3
673-
674-
675-
676-
677 QMessageLogger(__FILE__, 735, __PRETTY_FUNCTION__).warning("Conical gradient material: Unsupported graphics API %d", api);-
678 return
never executed: return nullptr;
nullptr;
never executed: return nullptr;
0
679}-
680-
681-
682-
683QSGMaterialType QQuickShapeLinearGradientShader::type;-
684-
685QQuickShapeLinearGradientShader::QQuickShapeLinearGradientShader()-
686{-
687 setShaderSourceFile(QOpenGLShader::Vertex,-
688 ([]() noexcept -> QString { enum { Size = sizeof(u"" ":/qt-project.org/shapes/shaders/lineargradient.vert")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" ":/qt-project.org/shapes/shaders/lineargradient.vert" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 8 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_examples
qstring_literal_temp;
executed 8 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_examples
}()));
8
689 setShaderSourceFile(QOpenGLShader::Fragment,-
690 ([]() noexcept -> QString { enum { Size = sizeof(u"" ":/qt-project.org/shapes/shaders/lineargradient.frag")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" ":/qt-project.org/shapes/shaders/lineargradient.frag" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 8 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_examples
qstring_literal_temp;
executed 8 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_examples
}()));
8
691}
executed 8 times by 1 test: end of block
Executed by:
  • tst_examples
8
692-
693void QQuickShapeLinearGradientShader::initialize()-
694{-
695 m_opacityLoc = program()->uniformLocation("opacity");-
696 m_matrixLoc = program()->uniformLocation("matrix");-
697 m_gradStartLoc = program()->uniformLocation("gradStart");-
698 m_gradEndLoc = program()->uniformLocation("gradEnd");-
699}
executed 8 times by 1 test: end of block
Executed by:
  • tst_examples
8
700-
701void QQuickShapeLinearGradientShader::updateState(const RenderState &state, QSGMaterial *mat, QSGMaterial *)-
702{-
703 QQuickShapeLinearGradientMaterial *m = static_cast<QQuickShapeLinearGradientMaterial *>(mat);-
704-
705 if (state.isOpacityDirty()
state.isOpacityDirty()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
)
0-8
706 program()->setUniformValue(m_opacityLoc, state.opacity());
executed 8 times by 1 test: program()->setUniformValue(m_opacityLoc, state.opacity());
Executed by:
  • tst_examples
8
707-
708 if (state.isMatrixDirty()
state.isMatrixDirty()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
)
0-8
709 program()->setUniformValue(m_matrixLoc, state.combinedMatrix());
executed 8 times by 1 test: program()->setUniformValue(m_matrixLoc, state.combinedMatrix());
Executed by:
  • tst_examples
8
710-
711 QQuickShapeGenericStrokeFillNode *node = m->node();-
712 program()->setUniformValue(m_gradStartLoc, QVector2D(node->m_fillGradient.a));-
713 program()->setUniformValue(m_gradEndLoc, QVector2D(node->m_fillGradient.b));-
714-
715 const QQuickShapeGradientCache::Key cacheKey(node->m_fillGradient.stops, node->m_fillGradient.spread);-
716 QSGTexture *tx = QQuickShapeGradientCache::currentCache()->get(cacheKey);-
717 tx->bind();-
718}
executed 8 times by 1 test: end of block
Executed by:
  • tst_examples
8
719-
720char const *const *QQuickShapeLinearGradientShader::attributeNames() const-
721{-
722 static const char *const attr[] = { "vertexCoord", "vertexColor", nullptr };-
723 return
executed 32 times by 1 test: return attr;
Executed by:
  • tst_examples
attr;
executed 32 times by 1 test: return attr;
Executed by:
  • tst_examples
32
724}-
725-
726int QQuickShapeLinearGradientMaterial::compare(const QSGMaterial *other) const-
727{-
728 ((other && type() == other->type()) ? static_cast<void>(0) : qt_assert("other && type() == other->type()", __FILE__, 786));-
729 const QQuickShapeLinearGradientMaterial *m = static_cast<const QQuickShapeLinearGradientMaterial *>(other);-
730-
731 QQuickShapeGenericStrokeFillNode *a = node();-
732 QQuickShapeGenericStrokeFillNode *b = m->node();-
733 ((a && b) ? static_cast<void>(0) : qt_assert("a && b", __FILE__, 791));-
734 if (a == b
a == bDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
735 return
never executed: return 0;
0;
never executed: return 0;
0
736-
737 const QQuickAbstractPathRenderer::GradientDesc *ga = &a->m_fillGradient;-
738 const QQuickAbstractPathRenderer::GradientDesc *gb = &b->m_fillGradient;-
739-
740 if (int d = ga->spread - gb->spread
int d = ga->sp...d - gb->spreadDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
741 return
never executed: return d;
d;
never executed: return d;
0
742-
743 if (int d = ga->a.x() - gb->a.x()
int d = ga->a.x() - gb->a.x()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
744 return
never executed: return d;
d;
never executed: return d;
0
745 if (int d = ga->a.y() - gb->a.y()
int d = ga->a.y() - gb->a.y()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
746 return
never executed: return d;
d;
never executed: return d;
0
747 if (int d = ga->b.x() - gb->b.x()
int d = ga->b.x() - gb->b.x()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
748 return
never executed: return d;
d;
never executed: return d;
0
749 if (int d = ga->b.y() - gb->b.y()
int d = ga->b.y() - gb->b.y()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
750 return
never executed: return d;
d;
never executed: return d;
0
751-
752 if (int d = ga->stops.count() - gb->stops.count()
int d = ga->st...>stops.count()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
753 return
never executed: return d;
d;
never executed: return d;
0
754-
755 for (int i = 0; i < ga->stops.count()
i < ga->stops.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
756 if (int d = ga->stops[i].first - gb->stops[i].first
int d = ga->st...stops[i].firstDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
757 return
never executed: return d;
d;
never executed: return d;
0
758 if (int d = ga->stops[i].second.rgba() - gb->stops[i].second.rgba()
int d = ga->st....second.rgba()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
759 return
never executed: return d;
d;
never executed: return d;
0
760 }
never executed: end of block
0
761-
762 return
never executed: return 0;
0;
never executed: return 0;
0
763}-
764-
765QSGMaterialType QQuickShapeRadialGradientShader::type;-
766-
767QQuickShapeRadialGradientShader::QQuickShapeRadialGradientShader()-
768{-
769 setShaderSourceFile(QOpenGLShader::Vertex,-
770 ([]() noexcept -> QString { enum { Size = sizeof(u"" ":/qt-project.org/shapes/shaders/radialgradient.vert")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" ":/qt-project.org/shapes/shaders/radialgradient.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_examples
qstring_literal_temp;
executed 4 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_examples
}()));
4
771 setShaderSourceFile(QOpenGLShader::Fragment,-
772 ([]() noexcept -> QString { enum { Size = sizeof(u"" ":/qt-project.org/shapes/shaders/radialgradient.frag")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" ":/qt-project.org/shapes/shaders/radialgradient.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_examples
qstring_literal_temp;
executed 4 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_examples
}()));
4
773}
executed 4 times by 1 test: end of block
Executed by:
  • tst_examples
4
774-
775void QQuickShapeRadialGradientShader::initialize()-
776{-
777 QOpenGLShaderProgram *prog = program();-
778 m_opacityLoc = prog->uniformLocation("opacity");-
779 m_matrixLoc = prog->uniformLocation("matrix");-
780 m_translationPointLoc = prog->uniformLocation("translationPoint");-
781 m_focalToCenterLoc = prog->uniformLocation("focalToCenter");-
782 m_centerRadiusLoc = prog->uniformLocation("centerRadius");-
783 m_focalRadiusLoc = prog->uniformLocation("focalRadius");-
784}
executed 4 times by 1 test: end of block
Executed by:
  • tst_examples
4
785-
786void QQuickShapeRadialGradientShader::updateState(const RenderState &state, QSGMaterial *mat, QSGMaterial *)-
787{-
788 QQuickShapeRadialGradientMaterial *m = static_cast<QQuickShapeRadialGradientMaterial *>(mat);-
789-
790 if (state.isOpacityDirty()
state.isOpacityDirty()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
)
0-4
791 program()->setUniformValue(m_opacityLoc, state.opacity());
executed 4 times by 1 test: program()->setUniformValue(m_opacityLoc, state.opacity());
Executed by:
  • tst_examples
4
792-
793 if (state.isMatrixDirty()
state.isMatrixDirty()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
)
0-4
794 program()->setUniformValue(m_matrixLoc, state.combinedMatrix());
executed 4 times by 1 test: program()->setUniformValue(m_matrixLoc, state.combinedMatrix());
Executed by:
  • tst_examples
4
795-
796 QQuickShapeGenericStrokeFillNode *node = m->node();-
797-
798 const QPointF centerPoint = node->m_fillGradient.a;-
799 const QPointF focalPoint = node->m_fillGradient.b;-
800 const QPointF focalToCenter = centerPoint - focalPoint;-
801 const GLfloat centerRadius = node->m_fillGradient.v0;-
802 const GLfloat focalRadius = node->m_fillGradient.v1;-
803-
804 program()->setUniformValue(m_translationPointLoc, focalPoint);-
805 program()->setUniformValue(m_centerRadiusLoc, centerRadius);-
806 program()->setUniformValue(m_focalRadiusLoc, focalRadius);-
807 program()->setUniformValue(m_focalToCenterLoc, focalToCenter);-
808-
809 const QQuickShapeGradientCache::Key cacheKey(node->m_fillGradient.stops, node->m_fillGradient.spread);-
810 QSGTexture *tx = QQuickShapeGradientCache::currentCache()->get(cacheKey);-
811 tx->bind();-
812}
executed 4 times by 1 test: end of block
Executed by:
  • tst_examples
4
813-
814char const *const *QQuickShapeRadialGradientShader::attributeNames() const-
815{-
816 static const char *const attr[] = { "vertexCoord", "vertexColor", nullptr };-
817 return
executed 16 times by 1 test: return attr;
Executed by:
  • tst_examples
attr;
executed 16 times by 1 test: return attr;
Executed by:
  • tst_examples
16
818}-
819-
820int QQuickShapeRadialGradientMaterial::compare(const QSGMaterial *other) const-
821{-
822 ((other && type() == other->type()) ? static_cast<void>(0) : qt_assert("other && type() == other->type()", __FILE__, 880));-
823 const QQuickShapeRadialGradientMaterial *m = static_cast<const QQuickShapeRadialGradientMaterial *>(other);-
824-
825 QQuickShapeGenericStrokeFillNode *a = node();-
826 QQuickShapeGenericStrokeFillNode *b = m->node();-
827 ((a && b) ? static_cast<void>(0) : qt_assert("a && b", __FILE__, 885));-
828 if (a == b
a == bDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
829 return
never executed: return 0;
0;
never executed: return 0;
0
830-
831 const QQuickAbstractPathRenderer::GradientDesc *ga = &a->m_fillGradient;-
832 const QQuickAbstractPathRenderer::GradientDesc *gb = &b->m_fillGradient;-
833-
834 if (int d = ga->spread - gb->spread
int d = ga->sp...d - gb->spreadDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
835 return
never executed: return d;
d;
never executed: return d;
0
836-
837 if (int d = ga->a.x() - gb->a.x()
int d = ga->a.x() - gb->a.x()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
838 return
never executed: return d;
d;
never executed: return d;
0
839 if (int d = ga->a.y() - gb->a.y()
int d = ga->a.y() - gb->a.y()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
840 return
never executed: return d;
d;
never executed: return d;
0
841 if (int d = ga->b.x() - gb->b.x()
int d = ga->b.x() - gb->b.x()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
842 return
never executed: return d;
d;
never executed: return d;
0
843 if (int d = ga->b.y() - gb->b.y()
int d = ga->b.y() - gb->b.y()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
844 return
never executed: return d;
d;
never executed: return d;
0
845-
846 if (int d = ga->v0 - gb->v0
int d = ga->v0 - gb->v0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
847 return
never executed: return d;
d;
never executed: return d;
0
848 if (int d = ga->v1 - gb->v1
int d = ga->v1 - gb->v1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
849 return
never executed: return d;
d;
never executed: return d;
0
850-
851 if (int d = ga->stops.count() - gb->stops.count()
int d = ga->st...>stops.count()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
852 return
never executed: return d;
d;
never executed: return d;
0
853-
854 for (int i = 0; i < ga->stops.count()
i < ga->stops.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
855 if (int d = ga->stops[i].first - gb->stops[i].first
int d = ga->st...stops[i].firstDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
856 return
never executed: return d;
d;
never executed: return d;
0
857 if (int d = ga->stops[i].second.rgba() - gb->stops[i].second.rgba()
int d = ga->st....second.rgba()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
858 return
never executed: return d;
d;
never executed: return d;
0
859 }
never executed: end of block
0
860-
861 return
never executed: return 0;
0;
never executed: return 0;
0
862}-
863-
864QSGMaterialType QQuickShapeConicalGradientShader::type;-
865-
866QQuickShapeConicalGradientShader::QQuickShapeConicalGradientShader()-
867{-
868 setShaderSourceFile(QOpenGLShader::Vertex,-
869 ([]() noexcept -> QString { enum { Size = sizeof(u"" ":/qt-project.org/shapes/shaders/conicalgradient.vert")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" ":/qt-project.org/shapes/shaders/conicalgradient.vert" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 3 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_examples
qstring_literal_temp;
executed 3 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_examples
}()));
3
870 setShaderSourceFile(QOpenGLShader::Fragment,-
871 ([]() noexcept -> QString { enum { Size = sizeof(u"" ":/qt-project.org/shapes/shaders/conicalgradient.frag")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" ":/qt-project.org/shapes/shaders/conicalgradient.frag" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return
executed 3 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_examples
qstring_literal_temp;
executed 3 times by 1 test: return qstring_literal_temp;
Executed by:
  • tst_examples
}()));
3
872}
executed 3 times by 1 test: end of block
Executed by:
  • tst_examples
3
873-
874void QQuickShapeConicalGradientShader::initialize()-
875{-
876 QOpenGLShaderProgram *prog = program();-
877 m_opacityLoc = prog->uniformLocation("opacity");-
878 m_matrixLoc = prog->uniformLocation("matrix");-
879 m_angleLoc = prog->uniformLocation("angle");-
880 m_translationPointLoc = prog->uniformLocation("translationPoint");-
881}
executed 3 times by 1 test: end of block
Executed by:
  • tst_examples
3
882-
883void QQuickShapeConicalGradientShader::updateState(const RenderState &state, QSGMaterial *mat, QSGMaterial *)-
884{-
885 QQuickShapeConicalGradientMaterial *m = static_cast<QQuickShapeConicalGradientMaterial *>(mat);-
886-
887 if (state.isOpacityDirty()
state.isOpacityDirty()Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
)
0-3
888 program()->setUniformValue(m_opacityLoc, state.opacity());
executed 3 times by 1 test: program()->setUniformValue(m_opacityLoc, state.opacity());
Executed by:
  • tst_examples
3
889-
890 if (state.isMatrixDirty()
state.isMatrixDirty()Description
TRUEevaluated 3 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
)
0-3
891 program()->setUniformValue(m_matrixLoc, state.combinedMatrix());
executed 3 times by 1 test: program()->setUniformValue(m_matrixLoc, state.combinedMatrix());
Executed by:
  • tst_examples
3
892-
893 QQuickShapeGenericStrokeFillNode *node = m->node();-
894-
895 const QPointF centerPoint = node->m_fillGradient.a;-
896 const GLfloat angle = -qDegreesToRadians(node->m_fillGradient.v0);-
897-
898 program()->setUniformValue(m_angleLoc, angle);-
899 program()->setUniformValue(m_translationPointLoc, centerPoint);-
900-
901 const QQuickShapeGradientCache::Key cacheKey(node->m_fillGradient.stops, QQuickShapeGradient::RepeatSpread);-
902 QSGTexture *tx = QQuickShapeGradientCache::currentCache()->get(cacheKey);-
903 tx->bind();-
904}
executed 3 times by 1 test: end of block
Executed by:
  • tst_examples
3
905-
906char const *const *QQuickShapeConicalGradientShader::attributeNames() const-
907{-
908 static const char *const attr[] = { "vertexCoord", "vertexColor", nullptr };-
909 return
executed 12 times by 1 test: return attr;
Executed by:
  • tst_examples
attr;
executed 12 times by 1 test: return attr;
Executed by:
  • tst_examples
12
910}-
911-
912int QQuickShapeConicalGradientMaterial::compare(const QSGMaterial *other) const-
913{-
914 ((other && type() == other->type()) ? static_cast<void>(0) : qt_assert("other && type() == other->type()", __FILE__, 972));-
915 const QQuickShapeConicalGradientMaterial *m = static_cast<const QQuickShapeConicalGradientMaterial *>(other);-
916-
917 QQuickShapeGenericStrokeFillNode *a = node();-
918 QQuickShapeGenericStrokeFillNode *b = m->node();-
919 ((a && b) ? static_cast<void>(0) : qt_assert("a && b", __FILE__, 977));-
920 if (a == b
a == bDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
921 return
never executed: return 0;
0;
never executed: return 0;
0
922-
923 const QQuickAbstractPathRenderer::GradientDesc *ga = &a->m_fillGradient;-
924 const QQuickAbstractPathRenderer::GradientDesc *gb = &b->m_fillGradient;-
925-
926 if (int d = ga->a.x() - gb->a.x()
int d = ga->a.x() - gb->a.x()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
927 return
never executed: return d;
d;
never executed: return d;
0
928 if (int d = ga->a.y() - gb->a.y()
int d = ga->a.y() - gb->a.y()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
929 return
never executed: return d;
d;
never executed: return d;
0
930-
931 if (int d = ga->v0 - gb->v0
int d = ga->v0 - gb->v0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
932 return
never executed: return d;
d;
never executed: return d;
0
933-
934 if (int d = ga->stops.count() - gb->stops.count()
int d = ga->st...>stops.count()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
935 return
never executed: return d;
d;
never executed: return d;
0
936-
937 for (int i = 0; i < ga->stops.count()
i < ga->stops.count()Description
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
938 if (int d = ga->stops[i].first - gb->stops[i].first
int d = ga->st...stops[i].firstDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
939 return
never executed: return d;
d;
never executed: return d;
0
940 if (int d = ga->stops[i].second.rgba() - gb->stops[i].second.rgba()
int d = ga->st....second.rgba()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
941 return
never executed: return d;
d;
never executed: return d;
0
942 }
never executed: end of block
0
943-
944 return
never executed: return 0;
0;
never executed: return 0;
0
945}-
946-
947-
948-
949-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0