OpenCoverage

qquickshape.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quickshapes/qquickshape.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4const QLoggingCategory &QQSHAPE_LOG_TIME_DIRTY_SYNC() { static const QLoggingCategory category("qt.shape.time.sync"); return
executed 91 times by 2 tests: return category;
Executed by:
  • tst_examples
  • tst_qquickshape
category;
executed 91 times by 2 tests: return category;
Executed by:
  • tst_examples
  • tst_qquickshape
}
91
5QQuickShapeStrokeFillParams::QQuickShapeStrokeFillParams()-
6 : strokeColor(Qt::white),-
7 strokeWidth(1),-
8 fillColor(Qt::white),-
9 fillRule(QQuickShapePath::OddEvenFill),-
10 joinStyle(QQuickShapePath::BevelJoin),-
11 miterLimit(2),-
12 capStyle(QQuickShapePath::SquareCap),-
13 strokeStyle(QQuickShapePath::SolidLine),-
14 dashOffset(0),-
15 fillGradient(nullptr)-
16{-
17 dashPattern << 4 << 2;-
18}
executed 1072 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
1072
19QQuickShapePathPrivate::QQuickShapePathPrivate()-
20 : dirty(DirtyAll)-
21{-
22-
23 isShapePath = true;-
24}
executed 1072 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
1072
25-
26QQuickShapePath::QQuickShapePath(QObject *parent)-
27 : QQuickPath(*(new QQuickShapePathPrivate), parent)-
28{-
29-
30-
31-
32-
33-
34 connect(this, &QQuickPath::changed, [this]() {-
35 QQuickShapePathPrivate * const d = d_func();-
36 d->dirty |= QQuickShapePathPrivate::DirtyPath;-
37 shapePathChanged();-
38 }
executed 1158 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
)
;
1158
39}
executed 1072 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
1072
40-
41QQuickShapePath::~QQuickShapePath()-
42{-
43}-
44QColor QQuickShapePath::strokeColor() const-
45{-
46 const QQuickShapePathPrivate * const d = d_func();-
47 return
executed 1053 times by 2 tests: return d->sfp.strokeColor;
Executed by:
  • tst_examples
  • tst_qquickshape
d->sfp.strokeColor;
executed 1053 times by 2 tests: return d->sfp.strokeColor;
Executed by:
  • tst_examples
  • tst_qquickshape
1053
48}-
49-
50void QQuickShapePath::setStrokeColor(const QColor &color)-
51{-
52 QQuickShapePathPrivate * const d = d_func();-
53 if (d->sfp.strokeColor != color
d->sfp.strokeColor != colorDescription
TRUEevaluated 410 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
) {
0-410
54 d->sfp.strokeColor = color;-
55 d->dirty |= QQuickShapePathPrivate::DirtyStrokeColor;-
56 strokeColorChanged();-
57 shapePathChanged();-
58 }
executed 410 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
410
59}
executed 410 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
410
60qreal QQuickShapePath::strokeWidth() const-
61{-
62 const QQuickShapePathPrivate * const d = d_func();-
63 return
executed 1057 times by 2 tests: return d->sfp.strokeWidth;
Executed by:
  • tst_examples
  • tst_qquickshape
d->sfp.strokeWidth;
executed 1057 times by 2 tests: return d->sfp.strokeWidth;
Executed by:
  • tst_examples
  • tst_qquickshape
1057
64}-
65-
66void QQuickShapePath::setStrokeWidth(qreal w)-
67{-
68 QQuickShapePathPrivate * const d = d_func();-
69 if (d->sfp.strokeWidth != w
d->sfp.strokeWidth != wDescription
TRUEevaluated 1016 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEevaluated 38 times by 1 test
Evaluated by:
  • tst_examples
) {
38-1016
70 d->sfp.strokeWidth = w;-
71 d->dirty |= QQuickShapePathPrivate::DirtyStrokeWidth;-
72 strokeWidthChanged();-
73 shapePathChanged();-
74 }
executed 1016 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
1016
75}
executed 1054 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
1054
76QColor QQuickShapePath::fillColor() const-
77{-
78 const QQuickShapePathPrivate * const d = d_func();-
79 return
executed 1053 times by 2 tests: return d->sfp.fillColor;
Executed by:
  • tst_examples
  • tst_qquickshape
d->sfp.fillColor;
executed 1053 times by 2 tests: return d->sfp.fillColor;
Executed by:
  • tst_examples
  • tst_qquickshape
1053
80}-
81-
82void QQuickShapePath::setFillColor(const QColor &color)-
83{-
84 QQuickShapePathPrivate * const d = d_func();-
85 if (d->sfp.fillColor != color
d->sfp.fillColor != colorDescription
TRUEevaluated 824 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEevaluated 224 times by 1 test
Evaluated by:
  • tst_examples
) {
224-824
86 d->sfp.fillColor = color;-
87 d->dirty |= QQuickShapePathPrivate::DirtyFillColor;-
88 fillColorChanged();-
89 shapePathChanged();-
90 }
executed 824 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
824
91}
executed 1048 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
1048
92QQuickShapePath::FillRule QQuickShapePath::fillRule() const-
93{-
94 const QQuickShapePathPrivate * const d = d_func();-
95 return
executed 1057 times by 2 tests: return d->sfp.fillRule;
Executed by:
  • tst_examples
  • tst_qquickshape
d->sfp.fillRule;
executed 1057 times by 2 tests: return d->sfp.fillRule;
Executed by:
  • tst_examples
  • tst_qquickshape
1057
96}-
97-
98void QQuickShapePath::setFillRule(FillRule fillRule)-
99{-
100 QQuickShapePathPrivate * const d = d_func();-
101 if (d->sfp.fillRule != fillRule
d->sfp.fillRule != fillRuleDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickshape
FALSEnever evaluated
) {
0-2
102 d->sfp.fillRule = fillRule;-
103 d->dirty |= QQuickShapePathPrivate::DirtyFillRule;-
104 fillRuleChanged();-
105 shapePathChanged();-
106 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickshape
2
107}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickshape
2
108QQuickShapePath::JoinStyle QQuickShapePath::joinStyle() const-
109{-
110 const QQuickShapePathPrivate * const d = d_func();-
111 return
executed 1053 times by 2 tests: return d->sfp.joinStyle;
Executed by:
  • tst_examples
  • tst_qquickshape
d->sfp.joinStyle;
executed 1053 times by 2 tests: return d->sfp.joinStyle;
Executed by:
  • tst_examples
  • tst_qquickshape
1053
112}-
113-
114void QQuickShapePath::setJoinStyle(JoinStyle style)-
115{-
116 QQuickShapePathPrivate * const d = d_func();-
117 if (d->sfp.joinStyle != style
d->sfp.joinStyle != styleDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickshape
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
) {
2-4
118 d->sfp.joinStyle = style;-
119 d->dirty |= QQuickShapePathPrivate::DirtyStyle;-
120 joinStyleChanged();-
121 shapePathChanged();-
122 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickshape
2
123}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
6
124int QQuickShapePath::miterLimit() const-
125{-
126 const QQuickShapePathPrivate * const d = d_func();-
127 return
executed 1053 times by 2 tests: return d->sfp.miterLimit;
Executed by:
  • tst_examples
  • tst_qquickshape
d->sfp.miterLimit;
executed 1053 times by 2 tests: return d->sfp.miterLimit;
Executed by:
  • tst_examples
  • tst_qquickshape
1053
128}-
129-
130void QQuickShapePath::setMiterLimit(int limit)-
131{-
132 QQuickShapePathPrivate * const d = d_func();-
133 if (d->sfp.miterLimit != limit
d->sfp.miterLimit != limitDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickshape
FALSEnever evaluated
) {
0-2
134 d->sfp.miterLimit = limit;-
135 d->dirty |= QQuickShapePathPrivate::DirtyStyle;-
136 miterLimitChanged();-
137 shapePathChanged();-
138 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickshape
2
139}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickshape
2
140QQuickShapePath::CapStyle QQuickShapePath::capStyle() const-
141{-
142 const QQuickShapePathPrivate * const d = d_func();-
143 return
executed 1053 times by 2 tests: return d->sfp.capStyle;
Executed by:
  • tst_examples
  • tst_qquickshape
d->sfp.capStyle;
executed 1053 times by 2 tests: return d->sfp.capStyle;
Executed by:
  • tst_examples
  • tst_qquickshape
1053
144}-
145-
146void QQuickShapePath::setCapStyle(CapStyle style)-
147{-
148 QQuickShapePathPrivate * const d = d_func();-
149 if (d->sfp.capStyle != style
d->sfp.capStyle != styleDescription
TRUEevaluated 20 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
) {
0-20
150 d->sfp.capStyle = style;-
151 d->dirty |= QQuickShapePathPrivate::DirtyStyle;-
152 capStyleChanged();-
153 shapePathChanged();-
154 }
executed 20 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
20
155}
executed 20 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
20
156QQuickShapePath::StrokeStyle QQuickShapePath::strokeStyle() const-
157{-
158 const QQuickShapePathPrivate * const d = d_func();-
159 return
executed 1055 times by 2 tests: return d->sfp.strokeStyle;
Executed by:
  • tst_examples
  • tst_qquickshape
d->sfp.strokeStyle;
executed 1055 times by 2 tests: return d->sfp.strokeStyle;
Executed by:
  • tst_examples
  • tst_qquickshape
1055
160}-
161-
162void QQuickShapePath::setStrokeStyle(StrokeStyle style)-
163{-
164 QQuickShapePathPrivate * const d = d_func();-
165 if (d->sfp.strokeStyle != style
d->sfp.strokeStyle != styleDescription
TRUEevaluated 38 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
) {
0-38
166 d->sfp.strokeStyle = style;-
167 d->dirty |= QQuickShapePathPrivate::DirtyDash;-
168 strokeStyleChanged();-
169 shapePathChanged();-
170 }
executed 38 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
38
171}
executed 38 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
38
172qreal QQuickShapePath::dashOffset() const-
173{-
174 const QQuickShapePathPrivate * const d = d_func();-
175 return
executed 1053 times by 2 tests: return d->sfp.dashOffset;
Executed by:
  • tst_examples
  • tst_qquickshape
d->sfp.dashOffset;
executed 1053 times by 2 tests: return d->sfp.dashOffset;
Executed by:
  • tst_examples
  • tst_qquickshape
1053
176}-
177-
178void QQuickShapePath::setDashOffset(qreal offset)-
179{-
180 QQuickShapePathPrivate * const d = d_func();-
181 if (d->sfp.dashOffset != offset
d->sfp.dashOffset != offsetDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickshape
FALSEnever evaluated
) {
0-2
182 d->sfp.dashOffset = offset;-
183 d->dirty |= QQuickShapePathPrivate::DirtyDash;-
184 dashOffsetChanged();-
185 shapePathChanged();-
186 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickshape
2
187}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickshape
2
188QVector<qreal> QQuickShapePath::dashPattern() const-
189{-
190 const QQuickShapePathPrivate * const d = d_func();-
191 return
executed 1053 times by 2 tests: return d->sfp.dashPattern;
Executed by:
  • tst_examples
  • tst_qquickshape
d->sfp.dashPattern;
executed 1053 times by 2 tests: return d->sfp.dashPattern;
Executed by:
  • tst_examples
  • tst_qquickshape
1053
192}-
193-
194void QQuickShapePath::setDashPattern(const QVector<qreal> &array)-
195{-
196 QQuickShapePathPrivate * const d = d_func();-
197 if (d->sfp.dashPattern != array
d->sfp.dashPattern != arrayDescription
TRUEevaluated 24 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
) {
0-24
198 d->sfp.dashPattern = array;-
199 d->dirty |= QQuickShapePathPrivate::DirtyDash;-
200 dashPatternChanged();-
201 shapePathChanged();-
202 }
executed 24 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
24
203}
executed 24 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
24
204QQuickShapeGradient *QQuickShapePath::fillGradient() const-
205{-
206 const QQuickShapePathPrivate * const d = d_func();-
207 return
executed 1059 times by 2 tests: return d->sfp.fillGradient;
Executed by:
  • tst_examples
  • tst_qquickshape
d->sfp.fillGradient;
executed 1059 times by 2 tests: return d->sfp.fillGradient;
Executed by:
  • tst_examples
  • tst_qquickshape
1059
208}-
209-
210void QQuickShapePath::setFillGradient(QQuickShapeGradient *gradient)-
211{-
212 QQuickShapePathPrivate * const d = d_func();-
213 if (d->sfp.fillGradient != gradient
d->sfp.fillGra...nt != gradientDescription
TRUEevaluated 36 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
) {
0-36
214 if (d->sfp.fillGradient
d->sfp.fillGradientDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickshape
FALSEevaluated 34 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
)
2-34
215 { QQuickShapeGradient *sender = (d->sfp.fillGradient); QQuickShapePath *receiver = (this); const char *signal = (qFlagLocation("2""updated()" "\0" __FILE__ ":" "488")); const char *method = (qFlagLocation("1""_q_fillGradientChanged()" "\0" __FILE__ ":" "488")); static int signalIdx = -1; static int methodIdx = -1; if (signalIdx < 0
signalIdx < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickshape
FALSEnever evaluated
) { ((((int)(*signal) - '0') == 2) ? static_cast<void>(0) : qt_assert("((int)(*signal) - '0') == QSIGNAL_CODE",
0-2
216 __FILE__-
217 ,-
218 488-
219 )); signalIdx = QQuickShapeGradient::staticMetaObject.indexOfSignal(signal+1); }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickshape
if (methodIdx < 0
methodIdx < 0Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickshape
FALSEnever evaluated
) { int code = ((int)(*method) - '0'); ((code == 1 || code == 2) ? static_cast<void>(0) : qt_assert("code == QSLOT_CODE || code == QSIGNAL_CODE",
0-2
220 __FILE__-
221 ,-
222 488-
223 )); if (code == 1
code == 1Description
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickshape
FALSEnever evaluated
) methodIdx = QQuickShapePath::staticMetaObject.indexOfSlot(method+1);
executed 2 times by 1 test: methodIdx = QQuickShapePath::staticMetaObject.indexOfSlot(method+1);
Executed by:
  • tst_qquickshape
else methodIdx = QQuickShapePath::staticMetaObject.indexOfSignal(method+1);
never executed: methodIdx = QQuickShapePath::staticMetaObject.indexOfSignal(method+1);
} ((signalIdx != -1 && methodIdx != -1) ? static_cast<void>(0) : qt_assert("signalIdx != -1 && methodIdx != -1",
0-2
224 __FILE__-
225 ,-
226 488-
227 )); QMetaObject::disconnect(sender, signalIdx, receiver, methodIdx); }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickshape
2
228 ;-
229 d->sfp.fillGradient = gradient;-
230 if (d->sfp.fillGradient
d->sfp.fillGradientDescription
TRUEevaluated 34 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickshape
)
2-34
231 { QQuickShapeGradient *sender = (d->sfp.fillGradient); QQuickShapePath *receiver = (this); const char *signal = (qFlagLocation("2""updated()" "\0" __FILE__ ":" "492")); const char *method = (qFlagLocation("1""_q_fillGradientChanged()" "\0" __FILE__ ":" "492")); static int signalIdx = -1; static int methodIdx = -1; if (signalIdx < 0
signalIdx < 0Description
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEevaluated 30 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
) { ((((int)(*signal) - '0') == 2) ? static_cast<void>(0) : qt_assert("((int)(*signal) - '0') == QSIGNAL_CODE",
4-30
232 __FILE__-
233 ,-
234 492-
235 )); signalIdx = QQuickShapeGradient::staticMetaObject.indexOfSignal(signal+1); }
executed 4 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
if (methodIdx < 0
methodIdx < 0Description
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEevaluated 30 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
) { int code = ((int)(*method) - '0'); ((code == 1 || code == 2) ? static_cast<void>(0) : qt_assert("code == QSLOT_CODE || code == QSIGNAL_CODE",
4-30
236 __FILE__-
237 ,-
238 492-
239 )); if (code == 1
code == 1Description
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
) methodIdx = QQuickShapePath::staticMetaObject.indexOfSlot(method+1);
executed 4 times by 2 tests: methodIdx = QQuickShapePath::staticMetaObject.indexOfSlot(method+1);
Executed by:
  • tst_examples
  • tst_qquickshape
else methodIdx = QQuickShapePath::staticMetaObject.indexOfSignal(method+1);
never executed: methodIdx = QQuickShapePath::staticMetaObject.indexOfSignal(method+1);
} ((signalIdx != -1 && methodIdx != -1) ? static_cast<void>(0) : qt_assert("signalIdx != -1 && methodIdx != -1",
0-4
240 __FILE__-
241 ,-
242 492-
243 )); QMetaObject::connect(sender, signalIdx, receiver, methodIdx, Qt::DirectConnection); }
executed 34 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
34
244 ;-
245 d->dirty |= QQuickShapePathPrivate::DirtyFillGradient;-
246 shapePathChanged();-
247 }
executed 36 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
36
248}
executed 36 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
36
249-
250void QQuickShapePathPrivate::_q_fillGradientChanged()-
251{-
252 QQuickShapePath * const q = q_func();-
253 dirty |= DirtyFillGradient;-
254 q->shapePathChanged();-
255}
executed 22 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
22
256-
257void QQuickShapePath::resetFillGradient()-
258{-
259 setFillGradient(nullptr);-
260}
never executed: end of block
0
261QQuickShapePrivate::QQuickShapePrivate()-
262 : effectRefCount(0)-
263{-
264}
executed 112 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
112
265-
266QQuickShapePrivate::~QQuickShapePrivate()-
267{-
268 delete renderer;-
269}
executed 112 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
112
270-
271void QQuickShapePrivate::_q_shapePathChanged()-
272{-
273 QQuickShape * const q = q_func();-
274 spChanged = true;-
275 q->polish();-
276}
executed 258 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
258
277-
278void QQuickShapePrivate::setStatus(QQuickShape::Status newStatus)-
279{-
280 QQuickShape * const q = q_func();-
281 if (status != newStatus
status != newStatusDescription
TRUEevaluated 91 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
) {
0-91
282 status = newStatus;-
283 q->statusChanged();-
284 }
executed 91 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
91
285}
executed 91 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
91
286-
287struct QQuickShapeResourceInitializer-
288{-
289 QQuickShapeResourceInitializer()-
290 {-
291-
292-
293-
294 }-
295};-
296-
297namespace { namespace Q_QGS_initQQuickShapeResources { typedef QQuickShapeResourceInitializer Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
guard.load() =...c::InitializedDescription
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
) guard.store(QtGlobalStatic::Destroyed);
executed 4 times by 2 tests: guard.store(QtGlobalStatic::Destroyed);
Executed by:
  • tst_examples
  • tst_qquickshape
}
executed 4 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
}; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; return
executed 112 times by 2 tests: return &holder.value;
Executed by:
  • tst_examples
  • tst_qquickshape
&holder.value;
executed 112 times by 2 tests: return &holder.value;
Executed by:
  • tst_examples
  • tst_qquickshape
} } } static QGlobalStatic<QQuickShapeResourceInitializer, Q_QGS_initQQuickShapeResources::innerFunction, Q_QGS_initQQuickShapeResources::guard> initQQuickShapeResources;
0-112
298-
299QQuickShape::QQuickShape(QQuickItem *parent)-
300 : QQuickItem(*(new QQuickShapePrivate), parent)-
301{-
302 initQQuickShapeResources();-
303 setFlag(ItemHasContents);-
304}
executed 112 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
112
305-
306QQuickShape::~QQuickShape()-
307{-
308}-
309QQuickShape::RendererType QQuickShape::rendererType() const-
310{-
311 const QQuickShapePrivate * const d = d_func();-
312 return
executed 8 times by 2 tests: return d->rendererType;
Executed by:
  • tst_examples
  • tst_qquickshape
d->rendererType;
executed 8 times by 2 tests: return d->rendererType;
Executed by:
  • tst_examples
  • tst_qquickshape
8
313}-
314bool QQuickShape::asynchronous() const-
315{-
316 const QQuickShapePrivate * const d = d_func();-
317 return
executed 4 times by 1 test: return d->async;
Executed by:
  • tst_qquickshape
d->async;
executed 4 times by 1 test: return d->async;
Executed by:
  • tst_qquickshape
4
318}-
319-
320void QQuickShape::setAsynchronous(bool async)-
321{-
322 QQuickShapePrivate * const d = d_func();-
323 if (d->async != async
d->async != asyncDescription
TRUEevaluated 8 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
) {
0-8
324 d->async = async;-
325 asynchronousChanged();-
326 if (d->componentComplete
d->componentCompleteDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickshape
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
)
4
327 d->_q_shapePathChanged();
executed 4 times by 1 test: d->_q_shapePathChanged();
Executed by:
  • tst_qquickshape
4
328 }
executed 8 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
8
329}
executed 8 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
8
330bool QQuickShape::vendorExtensionsEnabled() const-
331{-
332 const QQuickShapePrivate * const d = d_func();-
333 return
executed 4 times by 1 test: return d->enableVendorExts;
Executed by:
  • tst_qquickshape
d->enableVendorExts;
executed 4 times by 1 test: return d->enableVendorExts;
Executed by:
  • tst_qquickshape
4
334}-
335-
336void QQuickShape::setVendorExtensionsEnabled(bool enable)-
337{-
338 QQuickShapePrivate * const d = d_func();-
339 if (d->enableVendorExts != enable
d->enableVendorExts != enableDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_qquickshape
FALSEnever evaluated
) {
0-12
340 d->enableVendorExts = enable;-
341 vendorExtensionsEnabledChanged();-
342 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquickshape
12
343}
executed 12 times by 1 test: end of block
Executed by:
  • tst_qquickshape
12
344QQuickShape::Status QQuickShape::status() const-
345{-
346 const QQuickShapePrivate * const d = d_func();-
347 return
executed 8 times by 2 tests: return d->status;
Executed by:
  • tst_examples
  • tst_qquickshape
d->status;
executed 8 times by 2 tests: return d->status;
Executed by:
  • tst_examples
  • tst_qquickshape
8
348}-
349QQuickShape::ContainsMode QQuickShape::containsMode() const-
350{-
351 const QQuickShapePrivate * const d = d_func();-
352 return
never executed: return d->containsMode;
d->containsMode;
never executed: return d->containsMode;
0
353}-
354-
355void QQuickShape::setContainsMode(QQuickShape::ContainsMode containsMode)-
356{-
357 QQuickShapePrivate * const d = d_func();-
358 if (d->containsMode == containsMode
d->containsMod...= containsModeDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_examples
)
0-8
359 return;
never executed: return;
0
360-
361 d->containsMode = containsMode;-
362 containsModeChanged();-
363}
executed 8 times by 1 test: end of block
Executed by:
  • tst_examples
8
364-
365bool QQuickShape::contains(const QPointF &point) const-
366{-
367 const QQuickShapePrivate * const d = d_func();-
368 switch (d->containsMode) {-
369 case
never executed: case BoundingRectContains:
BoundingRectContains:
never executed: case BoundingRectContains:
0
370 return
never executed: return QQuickItem::contains(point);
QQuickItem::contains(point);
never executed: return QQuickItem::contains(point);
0
371 case
never executed: case FillContains:
FillContains:
never executed: case FillContains:
0
372 for (QQuickShapePath *path : d->sp) {-
373 if (path->path().contains(point)
path->path().contains(point)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
374 return
never executed: return true;
true;
never executed: return true;
0
375 }
never executed: end of block
0
376 }
never executed: end of block
0
377 return
never executed: return false;
false;
never executed: return false;
0
378}-
379-
380static void vpe_append(QQmlListProperty<QObject> *property, QObject *obj)-
381{-
382 QQuickShape *item = static_cast<QQuickShape *>(property->object);-
383 QQuickShapePrivate *d = QQuickShapePrivate::get(item);-
384 QQuickShapePath *path = qobject_cast<QQuickShapePath *>(obj);-
385 if (path
pathDescription
TRUEevaluated 1072 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_examples
)
16-1072
386 d->sp.append(path);
executed 1072 times by 2 tests: d->sp.append(path);
Executed by:
  • tst_examples
  • tst_qquickshape
1072
387-
388 QQuickItemPrivate::data_append(property, obj);-
389-
390 if (path
pathDescription
TRUEevaluated 1072 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_examples
&& d->componentComplete
d->componentCompleteDescription
TRUEnever evaluated
FALSEevaluated 1072 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
) {
0-1072
391 QObject::connect(path, qFlagLocation("2""shapePathChanged()" "\0" __FILE__ ":" "865"), item, qFlagLocation("1""_q_shapePathChanged()" "\0" __FILE__ ":" "865"));-
392 d->_q_shapePathChanged();-
393 }
never executed: end of block
0
394}
executed 1088 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
1088
395-
396static void vpe_clear(QQmlListProperty<QObject> *property)-
397{-
398 QQuickShape *item = static_cast<QQuickShape *>(property->object);-
399 QQuickShapePrivate *d = QQuickShapePrivate::get(item);-
400-
401 for (QQuickShapePath *p : d->sp)-
402 QObject::disconnect(p, qFlagLocation("2""shapePathChanged()" "\0" __FILE__ ":" "876"), item, qFlagLocation("1""_q_shapePathChanged()" "\0" __FILE__ ":" "876"));
never executed: QObject::disconnect(p, qFlagLocation("2""shapePathChanged()" "\0" __FILE__ ":" "876"), item, qFlagLocation("1""_q_shapePathChanged()" "\0" __FILE__ ":" "876"));
0
403-
404 d->sp.clear();-
405-
406 QQuickItemPrivate::data_clear(property);-
407-
408 if (d->componentComplete
d->componentCompleteDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
409 d->_q_shapePathChanged();
never executed: d->_q_shapePathChanged();
0
410}
never executed: end of block
0
411QQmlListProperty<QObject> QQuickShape::data()-
412{-
413 return
executed 118 times by 2 tests: return QQmlListProperty<QObject>(this, nullptr, vpe_append, QQuickItemPrivate::data_count, QQuickItemPrivate::data_at, vpe_clear);
Executed by:
  • tst_examples
  • tst_qquickshape
QQmlListProperty<QObject>(this,
executed 118 times by 2 tests: return QQmlListProperty<QObject>(this, nullptr, vpe_append, QQuickItemPrivate::data_count, QQuickItemPrivate::data_at, vpe_clear);
Executed by:
  • tst_examples
  • tst_qquickshape
118
414 nullptr,
executed 118 times by 2 tests: return QQmlListProperty<QObject>(this, nullptr, vpe_append, QQuickItemPrivate::data_count, QQuickItemPrivate::data_at, vpe_clear);
Executed by:
  • tst_examples
  • tst_qquickshape
118
415 vpe_append,
executed 118 times by 2 tests: return QQmlListProperty<QObject>(this, nullptr, vpe_append, QQuickItemPrivate::data_count, QQuickItemPrivate::data_at, vpe_clear);
Executed by:
  • tst_examples
  • tst_qquickshape
118
416 QQuickItemPrivate::data_count,
executed 118 times by 2 tests: return QQmlListProperty<QObject>(this, nullptr, vpe_append, QQuickItemPrivate::data_count, QQuickItemPrivate::data_at, vpe_clear);
Executed by:
  • tst_examples
  • tst_qquickshape
118
417 QQuickItemPrivate::data_at,
executed 118 times by 2 tests: return QQmlListProperty<QObject>(this, nullptr, vpe_append, QQuickItemPrivate::data_count, QQuickItemPrivate::data_at, vpe_clear);
Executed by:
  • tst_examples
  • tst_qquickshape
118
418 vpe_clear);
executed 118 times by 2 tests: return QQmlListProperty<QObject>(this, nullptr, vpe_append, QQuickItemPrivate::data_count, QQuickItemPrivate::data_at, vpe_clear);
Executed by:
  • tst_examples
  • tst_qquickshape
118
419}-
420-
421void QQuickShape::classBegin()-
422{-
423 QQuickItem::classBegin();-
424}
executed 112 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
112
425-
426void QQuickShape::componentComplete()-
427{-
428 QQuickShapePrivate * const d = d_func();-
429-
430 QQuickItem::componentComplete();-
431-
432 for (QQuickShapePath *p : d->sp)-
433 connect(p, qFlagLocation("2""shapePathChanged()" "\0" __FILE__ ":" "918"), this, qFlagLocation("1""_q_shapePathChanged()" "\0" __FILE__ ":" "918"));
executed 1072 times by 2 tests: connect(p, qFlagLocation("2""shapePathChanged()" "\0" __FILE__ ":" "918"), this, qFlagLocation("1""_q_shapePathChanged()" "\0" __FILE__ ":" "918"));
Executed by:
  • tst_examples
  • tst_qquickshape
1072
434-
435 d->_q_shapePathChanged();-
436}
executed 112 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
112
437-
438void QQuickShape::updatePolish()-
439{-
440 QQuickShapePrivate * const d = d_func();-
441-
442 const int currentEffectRefCount = d->extra.isAllocated()
d->extra.isAllocated()Description
TRUEevaluated 91 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
? d->extra->recursiveEffectRefCount : 0;
0-91
443 if (!d->spChanged
!d->spChangedDescription
TRUEnever evaluated
FALSEevaluated 91 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
&& currentEffectRefCount <= d->effectRefCount
currentEffectR...effectRefCountDescription
TRUEnever evaluated
FALSEnever evaluated
)
0-91
444 return;
never executed: return;
0
445-
446 d->spChanged = false;-
447 d->effectRefCount = currentEffectRefCount;-
448-
449 if (!d->renderer
!d->rendererDescription
TRUEevaluated 91 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
) {
0-91
450 d->createRenderer();-
451 if (!d->renderer
!d->rendererDescription
TRUEnever evaluated
FALSEevaluated 91 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
)
0-91
452 return;
never executed: return;
0
453 rendererChanged();-
454 }
executed 91 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
91
455-
456-
457-
458-
459 if (isVisible()
isVisible()Description
TRUEevaluated 91 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
|| d->effectRefCount > 0
d->effectRefCount > 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0-91
460 d->sync();
executed 91 times by 2 tests: d->sync();
Executed by:
  • tst_examples
  • tst_qquickshape
91
461-
462 update();-
463}
executed 91 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
91
464-
465void QQuickShape::itemChange(ItemChange change, const ItemChangeData &data)-
466{-
467 QQuickShapePrivate * const d = d_func();-
468-
469-
470 if (change == ItemVisibleHasChanged
change == Item...ibleHasChangedDescription
TRUEevaluated 82 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 440 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
&& data.boolValue
data.boolValueDescription
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 42 times by 1 test
Evaluated by:
  • tst_examples
)
40-440
471 d->_q_shapePathChanged();
executed 40 times by 1 test: d->_q_shapePathChanged();
Executed by:
  • tst_examples
40
472-
473 QQuickItem::itemChange(change, data);-
474}
executed 522 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
522
475-
476QSGNode *QQuickShape::updatePaintNode(QSGNode *node, UpdatePaintNodeData *)-
477{-
478-
479-
480-
481 QQuickShapePrivate * const d = d_func();-
482 if (d->renderer
d->rendererDescription
TRUEevaluated 91 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
) {
0-91
483 if (!node
!nodeDescription
TRUEevaluated 91 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
)
0-91
484 node = d->createNode();
executed 91 times by 2 tests: node = d->createNode();
Executed by:
  • tst_examples
  • tst_qquickshape
91
485 d->renderer->updateNode();-
486 }
executed 91 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
91
487 return
executed 91 times by 2 tests: return node;
Executed by:
  • tst_examples
  • tst_qquickshape
node;
executed 91 times by 2 tests: return node;
Executed by:
  • tst_examples
  • tst_qquickshape
91
488}-
489-
490-
491void QQuickShapePrivate::createRenderer()-
492{-
493 QQuickShape * const q = q_func();-
494 QSGRendererInterface *ri = q->window()->rendererInterface();-
495 if (!ri
!riDescription
TRUEnever evaluated
FALSEevaluated 91 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
)
0-91
496 return;
never executed: return;
0
497-
498 switch (ri->graphicsApi()) {-
499-
500 case
executed 83 times by 1 test: case QSGRendererInterface::OpenGL:
Executed by:
  • tst_examples
QSGRendererInterface::OpenGL:
executed 83 times by 1 test: case QSGRendererInterface::OpenGL:
Executed by:
  • tst_examples
83
501 if (enableVendorExts
enableVendorExtsDescription
TRUEevaluated 83 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
&& QQuickShapeNvprRenderNode::isSupported()
QQuickShapeNvp...:isSupported()Description
TRUEnever evaluated
FALSEevaluated 83 times by 1 test
Evaluated by:
  • tst_examples
) {
0-83
502 rendererType = QQuickShape::NvprRenderer;-
503 renderer = new QQuickShapeNvprRenderer;-
504 }
never executed: end of block
else {
0
505 rendererType = QQuickShape::GeometryRenderer;-
506 renderer = new QQuickShapeGenericRenderer(q);-
507 }
executed 83 times by 1 test: end of block
Executed by:
  • tst_examples
83
508 break;
executed 83 times by 1 test: break;
Executed by:
  • tst_examples
83
509-
510 case
executed 8 times by 1 test: case QSGRendererInterface::Software:
Executed by:
  • tst_qquickshape
QSGRendererInterface::Software:
executed 8 times by 1 test: case QSGRendererInterface::Software:
Executed by:
  • tst_qquickshape
8
511 rendererType = QQuickShape::SoftwareRenderer;-
512 renderer = new QQuickShapeSoftwareRenderer;-
513 break;
executed 8 times by 1 test: break;
Executed by:
  • tst_qquickshape
8
514 default
never executed: default:
:
never executed: default:
0
515 QMessageLogger(__FILE__, 1000, __PRETTY_FUNCTION__).warning("No path backend for this graphics API yet");-
516 break;
never executed: break;
0
517 }-
518}-
519-
520-
521QSGNode *QQuickShapePrivate::createNode()-
522{-
523 QQuickShape * const q = q_func();-
524 QSGNode *node = nullptr;-
525 if (!q->window()
!q->window()Description
TRUEnever evaluated
FALSEevaluated 91 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
)
0-91
526 return
never executed: return node;
node;
never executed: return node;
0
527 QSGRendererInterface *ri = q->window()->rendererInterface();-
528 if (!ri
!riDescription
TRUEnever evaluated
FALSEevaluated 91 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
)
0-91
529 return
never executed: return node;
node;
never executed: return node;
0
530-
531 switch (ri->graphicsApi()) {-
532-
533 case
executed 83 times by 1 test: case QSGRendererInterface::OpenGL:
Executed by:
  • tst_examples
QSGRendererInterface::OpenGL:
executed 83 times by 1 test: case QSGRendererInterface::OpenGL:
Executed by:
  • tst_examples
83
534 if (enableVendorExts
enableVendorExtsDescription
TRUEevaluated 83 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
&& QQuickShapeNvprRenderNode::isSupported()
QQuickShapeNvp...:isSupported()Description
TRUEnever evaluated
FALSEevaluated 83 times by 1 test
Evaluated by:
  • tst_examples
) {
0-83
535 node = new QQuickShapeNvprRenderNode;-
536 static_cast<QQuickShapeNvprRenderer *>(renderer)->setNode(-
537 static_cast<QQuickShapeNvprRenderNode *>(node));-
538 }
never executed: end of block
else {
0
539 node = new QQuickShapeGenericNode;-
540 static_cast<QQuickShapeGenericRenderer *>(renderer)->setRootNode(-
541 static_cast<QQuickShapeGenericNode *>(node));-
542 }
executed 83 times by 1 test: end of block
Executed by:
  • tst_examples
83
543 break;
executed 83 times by 1 test: break;
Executed by:
  • tst_examples
83
544-
545 case
executed 8 times by 1 test: case QSGRendererInterface::Software:
Executed by:
  • tst_qquickshape
QSGRendererInterface::Software:
executed 8 times by 1 test: case QSGRendererInterface::Software:
Executed by:
  • tst_qquickshape
8
546 node = new QQuickShapeSoftwareRenderNode(q);-
547 static_cast<QQuickShapeSoftwareRenderer *>(renderer)->setNode(-
548 static_cast<QQuickShapeSoftwareRenderNode *>(node));-
549 break;
executed 8 times by 1 test: break;
Executed by:
  • tst_qquickshape
8
550 default
never executed: default:
:
never executed: default:
0
551 QMessageLogger(__FILE__, 1036, __PRETTY_FUNCTION__).warning("No path backend for this graphics API yet");-
552 break;
never executed: break;
0
553 }-
554-
555 return
executed 91 times by 2 tests: return node;
Executed by:
  • tst_examples
  • tst_qquickshape
node;
executed 91 times by 2 tests: return node;
Executed by:
  • tst_examples
  • tst_qquickshape
91
556}-
557-
558void QQuickShapePrivate::asyncShapeReady(void *data)-
559{-
560 QQuickShapePrivate *self = static_cast<QQuickShapePrivate *>(data);-
561 self->setStatus(QQuickShape::Ready);-
562 if (self->syncTimingActive
self->syncTimingActiveDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
563 QMessageLogger(__FILE__, 1048, __PRETTY_FUNCTION__).debug("[Shape %p] [%d] [dirty=0x%x] async update took %lld ms",
never executed: QMessageLogger(__FILE__, 1048, __PRETTY_FUNCTION__).debug("[Shape %p] [%d] [dirty=0x%x] async update took %lld ms", self->q_func(), self->syncTimeCounter, self->syncTimingTotalDirty, self->syncTimer.elapsed());
0
564 self->q_func(), self->syncTimeCounter, self->syncTimingTotalDirty, self->syncTimer.elapsed());
never executed: QMessageLogger(__FILE__, 1048, __PRETTY_FUNCTION__).debug("[Shape %p] [%d] [dirty=0x%x] async update took %lld ms", self->q_func(), self->syncTimeCounter, self->syncTimingTotalDirty, self->syncTimer.elapsed());
0
565}
never executed: end of block
0
566-
567void QQuickShapePrivate::sync()-
568{-
569 syncTimingTotalDirty = 0;-
570 syncTimingActive = QQSHAPE_LOG_TIME_DIRTY_SYNC().isDebugEnabled();-
571 if (syncTimingActive
syncTimingActiveDescription
TRUEnever evaluated
FALSEevaluated 91 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
)
0-91
572 syncTimer.start();
never executed: syncTimer.start();
0
573-
574 const bool useAsync = async
asyncDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 87 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
&& renderer->flags().testFlag(QQuickAbstractPathRenderer::SupportsAsync)
renderer->flag...SupportsAsync)Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
;
0-87
575 if (useAsync
useAsyncDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 87 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
) {
4-87
576 setStatus(QQuickShape::Processing);-
577 renderer->setAsyncCallback(asyncShapeReady, this);-
578 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_examples
4
579-
580 const int count = sp.count();-
581 renderer->beginSync(count);-
582-
583 for (int i = 0; i < count
i < countDescription
TRUEevaluated 1051 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEevaluated 91 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
; ++i) {
91-1051
584 QQuickShapePath *p = sp[i];-
585 int &dirty(QQuickShapePathPrivate::get(p)->dirty);-
586 syncTimingTotalDirty |= dirty;-
587-
588 if (dirty & QQuickShapePathPrivate::DirtyPath
dirty & QQuick...ate::DirtyPathDescription
TRUEevaluated 1051 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
)
0-1051
589 renderer->setPath(i, p);
executed 1051 times by 2 tests: renderer->setPath(i, p);
Executed by:
  • tst_examples
  • tst_qquickshape
1051
590 if (dirty & QQuickShapePathPrivate::DirtyStrokeColor
dirty & QQuick...rtyStrokeColorDescription
TRUEevaluated 1051 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
)
0-1051
591 renderer->setStrokeColor(i, p->strokeColor());
executed 1051 times by 2 tests: renderer->setStrokeColor(i, p->strokeColor());
Executed by:
  • tst_examples
  • tst_qquickshape
1051
592 if (dirty & QQuickShapePathPrivate::DirtyStrokeWidth
dirty & QQuick...rtyStrokeWidthDescription
TRUEevaluated 1051 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
)
0-1051
593 renderer->setStrokeWidth(i, p->strokeWidth());
executed 1051 times by 2 tests: renderer->setStrokeWidth(i, p->strokeWidth());
Executed by:
  • tst_examples
  • tst_qquickshape
1051
594 if (dirty & QQuickShapePathPrivate::DirtyFillColor
dirty & QQuick...DirtyFillColorDescription
TRUEevaluated 1051 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
)
0-1051
595 renderer->setFillColor(i, p->fillColor());
executed 1051 times by 2 tests: renderer->setFillColor(i, p->fillColor());
Executed by:
  • tst_examples
  • tst_qquickshape
1051
596 if (dirty & QQuickShapePathPrivate::DirtyFillRule
dirty & QQuick...:DirtyFillRuleDescription
TRUEevaluated 1051 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
)
0-1051
597 renderer->setFillRule(i, p->fillRule());
executed 1051 times by 2 tests: renderer->setFillRule(i, p->fillRule());
Executed by:
  • tst_examples
  • tst_qquickshape
1051
598 if (dirty & QQuickShapePathPrivate::DirtyStyle
dirty & QQuick...te::DirtyStyleDescription
TRUEevaluated 1051 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
) {
0-1051
599 renderer->setJoinStyle(i, p->joinStyle(), p->miterLimit());-
600 renderer->setCapStyle(i, p->capStyle());-
601 }
executed 1051 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
1051
602 if (dirty & QQuickShapePathPrivate::DirtyDash
dirty & QQuick...ate::DirtyDashDescription
TRUEevaluated 1051 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
)
0-1051
603 renderer->setStrokeStyle(i, p->strokeStyle(), p->dashOffset(), p->dashPattern());
executed 1051 times by 2 tests: renderer->setStrokeStyle(i, p->strokeStyle(), p->dashOffset(), p->dashPattern());
Executed by:
  • tst_examples
  • tst_qquickshape
1051
604 if (dirty & QQuickShapePathPrivate::DirtyFillGradient
dirty & QQuick...tyFillGradientDescription
TRUEevaluated 1051 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
)
0-1051
605 renderer->setFillGradient(i, p->fillGradient());
executed 1051 times by 2 tests: renderer->setFillGradient(i, p->fillGradient());
Executed by:
  • tst_examples
  • tst_qquickshape
1051
606-
607 dirty = 0;-
608 }
executed 1051 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
1051
609-
610 if (syncTimingTotalDirty
syncTimingTotalDirtyDescription
TRUEevaluated 91 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
)
0-91
611 ++
executed 91 times by 2 tests: ++syncTimeCounter;
Executed by:
  • tst_examples
  • tst_qquickshape
syncTimeCounter;
executed 91 times by 2 tests: ++syncTimeCounter;
Executed by:
  • tst_examples
  • tst_qquickshape
91
612 else-
613 syncTimingActive = false;
never executed: syncTimingActive = false;
0
614-
615 renderer->endSync(useAsync);-
616-
617 if (!useAsync
!useAsyncDescription
TRUEevaluated 87 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
) {
4-87
618 setStatus(QQuickShape::Ready);-
619 if (syncTimingActive
syncTimingActiveDescription
TRUEnever evaluated
FALSEevaluated 87 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
)
0-87
620 QMessageLogger(__FILE__, 1105, __PRETTY_FUNCTION__).debug("[Shape %p] [%d] [dirty=0x%x] update took %lld ms",
never executed: QMessageLogger(__FILE__, 1105, __PRETTY_FUNCTION__).debug("[Shape %p] [%d] [dirty=0x%x] update took %lld ms", q_func(), syncTimeCounter, syncTimingTotalDirty, syncTimer.elapsed());
0
621 q_func(), syncTimeCounter, syncTimingTotalDirty, syncTimer.elapsed());
never executed: QMessageLogger(__FILE__, 1105, __PRETTY_FUNCTION__).debug("[Shape %p] [%d] [dirty=0x%x] update took %lld ms", q_func(), syncTimeCounter, syncTimingTotalDirty, syncTimer.elapsed());
0
622 }
executed 87 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
87
623}
executed 91 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
91
624QQuickShapeGradient::QQuickShapeGradient(QObject *parent)-
625 : QQuickGradient(parent),-
626 m_spread(PadSpread)-
627{-
628}
executed 32 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
32
629QQuickShapeGradient::SpreadMode QQuickShapeGradient::spread() const-
630{-
631 return
executed 29 times by 2 tests: return m_spread;
Executed by:
  • tst_examples
  • tst_qquickshape
m_spread;
executed 29 times by 2 tests: return m_spread;
Executed by:
  • tst_examples
  • tst_qquickshape
29
632}-
633-
634void QQuickShapeGradient::setSpread(SpreadMode mode)-
635{-
636 if (m_spread != mode
m_spread != modeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
637 m_spread = mode;-
638 spreadChanged();-
639 updated();-
640 }
never executed: end of block
0
641}
never executed: end of block
0
642QQuickShapeLinearGradient::QQuickShapeLinearGradient(QObject *parent)-
643 : QQuickShapeGradient(parent)-
644{-
645}
executed 20 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
20
646qreal QQuickShapeLinearGradient::x1() const-
647{-
648 return
executed 18 times by 2 tests: return m_start.x();
Executed by:
  • tst_examples
  • tst_qquickshape
m_start.x();
executed 18 times by 2 tests: return m_start.x();
Executed by:
  • tst_examples
  • tst_qquickshape
18
649}-
650-
651void QQuickShapeLinearGradient::setX1(qreal v)-
652{-
653 if (m_start.x() != v
m_start.x() != vDescription
TRUEevaluated 10 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
) {
0-10
654 m_start.setX(v);-
655 x1Changed();-
656 updated();-
657 }
executed 10 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
10
658}
executed 10 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
10
659-
660qreal QQuickShapeLinearGradient::y1() const-
661{-
662 return
executed 16 times by 2 tests: return m_start.y();
Executed by:
  • tst_examples
  • tst_qquickshape
m_start.y();
executed 16 times by 2 tests: return m_start.y();
Executed by:
  • tst_examples
  • tst_qquickshape
16
663}-
664-
665void QQuickShapeLinearGradient::setY1(qreal v)-
666{-
667 if (m_start.y() != v
m_start.y() != vDescription
TRUEevaluated 14 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
) {
0-14
668 m_start.setY(v);-
669 y1Changed();-
670 updated();-
671 }
executed 14 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
14
672}
executed 14 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
14
673-
674qreal QQuickShapeLinearGradient::x2() const-
675{-
676 return
executed 16 times by 2 tests: return m_end.x();
Executed by:
  • tst_examples
  • tst_qquickshape
m_end.x();
executed 16 times by 2 tests: return m_end.x();
Executed by:
  • tst_examples
  • tst_qquickshape
16
677}-
678-
679void QQuickShapeLinearGradient::setX2(qreal v)-
680{-
681 if (m_end.x() != v
m_end.x() != vDescription
TRUEevaluated 12 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
) {
0-12
682 m_end.setX(v);-
683 x2Changed();-
684 updated();-
685 }
executed 12 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
12
686}
executed 12 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
12
687-
688qreal QQuickShapeLinearGradient::y2() const-
689{-
690 return
executed 16 times by 2 tests: return m_end.y();
Executed by:
  • tst_examples
  • tst_qquickshape
m_end.y();
executed 16 times by 2 tests: return m_end.y();
Executed by:
  • tst_examples
  • tst_qquickshape
16
691}-
692-
693void QQuickShapeLinearGradient::setY2(qreal v)-
694{-
695 if (m_end.y() != v
m_end.y() != vDescription
TRUEevaluated 20 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
) {
0-20
696 m_end.setY(v);-
697 y2Changed();-
698 updated();-
699 }
executed 20 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
20
700}
executed 20 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
20
701QQuickShapeRadialGradient::QQuickShapeRadialGradient(QObject *parent)-
702 : QQuickShapeGradient(parent)-
703{-
704}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
6
705qreal QQuickShapeRadialGradient::centerX() const-
706{-
707 return
executed 6 times by 2 tests: return m_centerPoint.x();
Executed by:
  • tst_examples
  • tst_qquickshape
m_centerPoint.x();
executed 6 times by 2 tests: return m_centerPoint.x();
Executed by:
  • tst_examples
  • tst_qquickshape
6
708}-
709-
710void QQuickShapeRadialGradient::setCenterX(qreal v)-
711{-
712 if (m_centerPoint.x() != v
m_centerPoint.x() != vDescription
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
) {
0-6
713 m_centerPoint.setX(v);-
714 centerXChanged();-
715 updated();-
716 }
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
6
717}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
6
718-
719qreal QQuickShapeRadialGradient::centerY() const-
720{-
721 return
executed 6 times by 2 tests: return m_centerPoint.y();
Executed by:
  • tst_examples
  • tst_qquickshape
m_centerPoint.y();
executed 6 times by 2 tests: return m_centerPoint.y();
Executed by:
  • tst_examples
  • tst_qquickshape
6
722}-
723-
724void QQuickShapeRadialGradient::setCenterY(qreal v)-
725{-
726 if (m_centerPoint.y() != v
m_centerPoint.y() != vDescription
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
) {
0-6
727 m_centerPoint.setY(v);-
728 centerYChanged();-
729 updated();-
730 }
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
6
731}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
6
732qreal QQuickShapeRadialGradient::centerRadius() const-
733{-
734 return
executed 6 times by 2 tests: return m_centerRadius;
Executed by:
  • tst_examples
  • tst_qquickshape
m_centerRadius;
executed 6 times by 2 tests: return m_centerRadius;
Executed by:
  • tst_examples
  • tst_qquickshape
6
735}-
736-
737void QQuickShapeRadialGradient::setCenterRadius(qreal v)-
738{-
739 if (m_centerRadius != v
m_centerRadius != vDescription
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
) {
0-6
740 m_centerRadius = v;-
741 centerRadiusChanged();-
742 updated();-
743 }
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
6
744}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
6
745-
746qreal QQuickShapeRadialGradient::focalX() const-
747{-
748 return
executed 6 times by 2 tests: return m_focalPoint.x();
Executed by:
  • tst_examples
  • tst_qquickshape
m_focalPoint.x();
executed 6 times by 2 tests: return m_focalPoint.x();
Executed by:
  • tst_examples
  • tst_qquickshape
6
749}-
750-
751void QQuickShapeRadialGradient::setFocalX(qreal v)-
752{-
753 if (m_focalPoint.x() != v
m_focalPoint.x() != vDescription
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
) {
0-6
754 m_focalPoint.setX(v);-
755 focalXChanged();-
756 updated();-
757 }
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
6
758}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
6
759-
760qreal QQuickShapeRadialGradient::focalY() const-
761{-
762 return
executed 6 times by 2 tests: return m_focalPoint.y();
Executed by:
  • tst_examples
  • tst_qquickshape
m_focalPoint.y();
executed 6 times by 2 tests: return m_focalPoint.y();
Executed by:
  • tst_examples
  • tst_qquickshape
6
763}-
764-
765void QQuickShapeRadialGradient::setFocalY(qreal v)-
766{-
767 if (m_focalPoint.y() != v
m_focalPoint.y() != vDescription
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
) {
0-6
768 m_focalPoint.setY(v);-
769 focalYChanged();-
770 updated();-
771 }
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
6
772}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
6
773-
774qreal QQuickShapeRadialGradient::focalRadius() const-
775{-
776 return
executed 6 times by 2 tests: return m_focalRadius;
Executed by:
  • tst_examples
  • tst_qquickshape
m_focalRadius;
executed 6 times by 2 tests: return m_focalRadius;
Executed by:
  • tst_examples
  • tst_qquickshape
6
777}-
778-
779void QQuickShapeRadialGradient::setFocalRadius(qreal v)-
780{-
781 if (m_focalRadius != v
m_focalRadius != vDescription
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
) {
0-6
782 m_focalRadius = v;-
783 focalRadiusChanged();-
784 updated();-
785 }
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
6
786}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
6
787QQuickShapeConicalGradient::QQuickShapeConicalGradient(QObject *parent)-
788 : QQuickShapeGradient(parent)-
789{-
790}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
6
791qreal QQuickShapeConicalGradient::centerX() const-
792{-
793 return
executed 5 times by 2 tests: return m_centerPoint.x();
Executed by:
  • tst_examples
  • tst_qquickshape
m_centerPoint.x();
executed 5 times by 2 tests: return m_centerPoint.x();
Executed by:
  • tst_examples
  • tst_qquickshape
5
794}-
795-
796void QQuickShapeConicalGradient::setCenterX(qreal v)-
797{-
798 if (m_centerPoint.x() != v
m_centerPoint.x() != vDescription
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
) {
0-6
799 m_centerPoint.setX(v);-
800 centerXChanged();-
801 updated();-
802 }
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
6
803}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
6
804-
805qreal QQuickShapeConicalGradient::centerY() const-
806{-
807 return
executed 5 times by 2 tests: return m_centerPoint.y();
Executed by:
  • tst_examples
  • tst_qquickshape
m_centerPoint.y();
executed 5 times by 2 tests: return m_centerPoint.y();
Executed by:
  • tst_examples
  • tst_qquickshape
5
808}-
809-
810void QQuickShapeConicalGradient::setCenterY(qreal v)-
811{-
812 if (m_centerPoint.y() != v
m_centerPoint.y() != vDescription
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickshape
FALSEnever evaluated
) {
0-6
813 m_centerPoint.setY(v);-
814 centerYChanged();-
815 updated();-
816 }
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
6
817}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
6
818qreal QQuickShapeConicalGradient::angle() const-
819{-
820 return
executed 9 times by 2 tests: return m_angle;
Executed by:
  • tst_examples
  • tst_qquickshape
m_angle;
executed 9 times by 2 tests: return m_angle;
Executed by:
  • tst_examples
  • tst_qquickshape
9
821}-
822-
823void QQuickShapeConicalGradient::setAngle(qreal v)-
824{-
825 if (m_angle != v
m_angle != vDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickshape
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
) {
2-4
826 m_angle = v;-
827 angleChanged();-
828 updated();-
829 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickshape
2
830}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickshape
6
831-
832-
833-
834-
835class QQuickShapeGradientCacheWrapper-
836{-
837public:-
838 QQuickShapeGradientCache *get(QOpenGLContext *context)-
839 {-
840 return
executed 15 times by 1 test: return m_resource.value<QQuickShapeGradientCache>(context);
Executed by:
  • tst_examples
m_resource.value<QQuickShapeGradientCache>(context);
executed 15 times by 1 test: return m_resource.value<QQuickShapeGradientCache>(context);
Executed by:
  • tst_examples
15
841 }-
842-
843private:-
844 QOpenGLMultiGroupSharedResource m_resource;-
845};-
846-
847QQuickShapeGradientCache *QQuickShapeGradientCache::currentCache()-
848{-
849 static QQuickShapeGradientCacheWrapper qt_path_gradient_caches;-
850 return
executed 15 times by 1 test: return qt_path_gradient_caches.get(QOpenGLContext::currentContext());
Executed by:
  • tst_examples
qt_path_gradient_caches.get(QOpenGLContext::currentContext());
executed 15 times by 1 test: return qt_path_gradient_caches.get(QOpenGLContext::currentContext());
Executed by:
  • tst_examples
15
851}-
852-
853-
854QQuickShapeGradientCache::~QQuickShapeGradientCache()-
855{-
856 m_cache.clear();-
857}
executed 11 times by 1 test: end of block
Executed by:
  • tst_examples
11
858-
859void QQuickShapeGradientCache::invalidateResource()-
860{-
861 m_cache.clear();-
862}
executed 11 times by 1 test: end of block
Executed by:
  • tst_examples
11
863-
864void QQuickShapeGradientCache::freeResource(QOpenGLContext *)-
865{-
866 qDeleteAll(m_cache);-
867 m_cache.clear();-
868}
never executed: end of block
0
869-
870static void generateGradientColorTable(const QQuickShapeGradientCache::Key &gradient,-
871 uint *colorTable, int size, float opacity)-
872{-
873 int pos = 0;-
874 const QGradientStops &s = gradient.stops;-
875 const bool colorInterpolation = true;-
876-
877 uint alpha = qRound(opacity * 256);-
878 uint current_color = ((((s[0].second.rgba() >> 24) * alpha) >> 8) << 24) | (s[0].second.rgba() & 0x00ffffff);-
879 qreal incr = 1.0 / qreal(size);-
880 qreal fpos = 1.5 * incr;-
881 colorTable[pos++] = ARGB2RGBA(qPremultiply(current_color));-
882-
883 while (fpos <= s.first().first
fpos <= s.first().firstDescription
TRUEnever evaluated
FALSEevaluated 15 times by 1 test
Evaluated by:
  • tst_examples
) {
0-15
884 colorTable[pos] = colorTable[pos - 1];-
885 pos++;-
886 fpos += incr;-
887 }
never executed: end of block
0
888-
889 if (colorInterpolation
colorInterpolationDescription
TRUEevaluated 15 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
)
0-15
890 current_color = qPremultiply(current_color);
executed 15 times by 1 test: current_color = qPremultiply(current_color);
Executed by:
  • tst_examples
15
891-
892 const int sLast = s.size() - 1;-
893 for (int i = 0; i < sLast
i < sLastDescription
TRUEevaluated 66 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 15 times by 1 test
Evaluated by:
  • tst_examples
; ++i) {
15-66
894 qreal delta = 1/(s[i+1].first - s[i].first);-
895 uint next_color = ((((s[i + 1].second.rgba() >> 24) * alpha) >> 8) << 24) | (s[i + 1].second.rgba() & 0x00ffffff);-
896 if (colorInterpolation
colorInterpolationDescription
TRUEevaluated 66 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
)
0-66
897 next_color = qPremultiply(next_color);
executed 66 times by 1 test: next_color = qPremultiply(next_color);
Executed by:
  • tst_examples
66
898-
899 while (fpos < s[i+1].first
fpos < s[i+1].firstDescription
TRUEevaluated 15345 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 66 times by 1 test
Evaluated by:
  • tst_examples
&& pos < size
pos < sizeDescription
TRUEevaluated 15345 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
) {
0-15345
900 int dist = int(256 * ((fpos - s[i].first) * delta));-
901 int idist = 256 - dist;-
902 if (colorInterpolation
colorInterpolationDescription
TRUEevaluated 15345 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
)
0-15345
903 colorTable[pos] = ARGB2RGBA(INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist));
executed 15345 times by 1 test: colorTable[pos] = ARGB2RGBA(INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist));
Executed by:
  • tst_examples
15345
904 else-
905 colorTable[pos] = ARGB2RGBA(qPremultiply(INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist)));
never executed: colorTable[pos] = ARGB2RGBA(qPremultiply(INTERPOLATE_PIXEL_256(current_color, idist, next_color, dist)));
0
906 ++pos;-
907 fpos += incr;-
908 }
executed 15345 times by 1 test: end of block
Executed by:
  • tst_examples
15345
909 current_color = next_color;-
910 }
executed 66 times by 1 test: end of block
Executed by:
  • tst_examples
66
911-
912 ((s.size() > 0) ? static_cast<void>(0) : qt_assert("s.size() > 0", __FILE__, 1570));-
913-
914 uint last_color = ARGB2RGBA(qPremultiply(((((s[sLast].second.rgba() >> 24) * alpha) >> 8) << 24) | (s[sLast].second.rgba() & 0x00ffffff)));-
915 for ( ; pos < size
pos < sizeDescription
TRUEnever evaluated
FALSEevaluated 15 times by 1 test
Evaluated by:
  • tst_examples
; ++pos)
0-15
916 colorTable[pos] = last_color;
never executed: colorTable[pos] = last_color;
0
917-
918 colorTable[size-1] = last_color;-
919}
executed 15 times by 1 test: end of block
Executed by:
  • tst_examples
15
920-
921QSGTexture *QQuickShapeGradientCache::get(const Key &grad)-
922{-
923 QSGPlainTexture *tx = m_cache[grad];-
924 if (!tx
!txDescription
TRUEevaluated 15 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
) {
0-15
925 QOpenGLFunctions *f = QOpenGLContext::currentContext()->functions();-
926 GLuint id;-
927 f->glGenTextures(1, &id);-
928 f->glBindTexture(-
929 0x0DE1-
930 , id);-
931 static const uint W = 1024;-
932 uint buf[W];-
933 generateGradientColorTable(grad, buf, W, 1.0f);-
934 f->glTexImage2D(-
935 0x0DE1-
936 , 0, -
937 0x1908-
938 , W, 1, 0, -
939 0x1908-
940 , -
941 0x1401-
942 , buf);-
943 tx = new QSGPlainTexture;-
944 tx->setTextureId(id);-
945 switch (grad.spread) {-
946 case
executed 12 times by 1 test: case QQuickShapeGradient::PadSpread:
Executed by:
  • tst_examples
QQuickShapeGradient::PadSpread:
executed 12 times by 1 test: case QQuickShapeGradient::PadSpread:
Executed by:
  • tst_examples
12
947 tx->setHorizontalWrapMode(QSGTexture::ClampToEdge);-
948 tx->setVerticalWrapMode(QSGTexture::ClampToEdge);-
949 break;
executed 12 times by 1 test: break;
Executed by:
  • tst_examples
12
950 case
executed 3 times by 1 test: case QQuickShapeGradient::RepeatSpread:
Executed by:
  • tst_examples
QQuickShapeGradient::RepeatSpread:
executed 3 times by 1 test: case QQuickShapeGradient::RepeatSpread:
Executed by:
  • tst_examples
3
951 tx->setHorizontalWrapMode(QSGTexture::Repeat);-
952 tx->setVerticalWrapMode(QSGTexture::Repeat);-
953 break;
executed 3 times by 1 test: break;
Executed by:
  • tst_examples
3
954 case
never executed: case QQuickShapeGradient::ReflectSpread:
QQuickShapeGradient::ReflectSpread:
never executed: case QQuickShapeGradient::ReflectSpread:
0
955 tx->setHorizontalWrapMode(QSGTexture::MirroredRepeat);-
956 tx->setVerticalWrapMode(QSGTexture::MirroredRepeat);-
957 break;
never executed: break;
0
958 default
never executed: default:
:
never executed: default:
0
959 QMessageLogger(__FILE__, 1607, __PRETTY_FUNCTION__).warning("Unknown gradient spread mode %d", grad.spread);-
960 break;
never executed: break;
0
961 }-
962 tx->setFiltering(QSGTexture::Linear);-
963 m_cache[grad] = tx;-
964 }
executed 15 times by 1 test: end of block
Executed by:
  • tst_examples
15
965 return
executed 15 times by 1 test: return tx;
Executed by:
  • tst_examples
tx;
executed 15 times by 1 test: return tx;
Executed by:
  • tst_examples
15
966}-
967-
968-
969-
970-
971-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0