OpenCoverage

qquickanimatorjob.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/util/qquickanimatorjob.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8struct QQuickTransformAnimatorHelperStore-
9{-
10 QHash<QQuickItem *, QQuickTransformAnimatorJob::Helper *> store;-
11 QMutex mutex;-
12-
13 QQuickTransformAnimatorJob::Helper *acquire(QQuickItem *item) {-
14 mutex.lock();-
15 QQuickTransformAnimatorJob::Helper *helper = store.value(item);-
16 if (!helper
!helperDescription
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
) {
4-22
17 helper = new QQuickTransformAnimatorJob::Helper();-
18 helper->item = item;-
19 store[item] = helper;-
20 }
executed 22 times by 1 test: end of block
Executed by:
  • tst_examples
else {
22
21 ++helper->ref;-
22 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_examples
4
23 mutex.unlock();-
24 return
executed 26 times by 1 test: return helper;
Executed by:
  • tst_examples
helper;
executed 26 times by 1 test: return helper;
Executed by:
  • tst_examples
26
25 }-
26-
27 void release(QQuickTransformAnimatorJob::Helper *helper) {-
28 mutex.lock();-
29 if (--
--helper->ref == 0Description
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
helper->ref == 0
--helper->ref == 0Description
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
) {
4-22
30 store.remove(helper->item);-
31 delete helper;-
32 }
executed 22 times by 1 test: end of block
Executed by:
  • tst_examples
22
33 mutex.unlock();-
34 }
executed 26 times by 1 test: end of block
Executed by:
  • tst_examples
26
35};-
36namespace { namespace Q_QGS_qquick_transform_animatorjob_helper_store { typedef QQuickTransformAnimatorHelperStore 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 2 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
) guard.store(QtGlobalStatic::Destroyed);
executed 2 times by 1 test: guard.store(QtGlobalStatic::Destroyed);
Executed by:
  • tst_examples
}
executed 2 times by 1 test: end of block
Executed by:
  • tst_examples
}; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; return
executed 52 times by 1 test: return &holder.value;
Executed by:
  • tst_examples
&holder.value;
executed 52 times by 1 test: return &holder.value;
Executed by:
  • tst_examples
} } } static QGlobalStatic<QQuickTransformAnimatorHelperStore, Q_QGS_qquick_transform_animatorjob_helper_store::innerFunction, Q_QGS_qquick_transform_animatorjob_helper_store::guard> qquick_transform_animatorjob_helper_store;;
0-52
37-
38QQuickAnimatorProxyJob::QQuickAnimatorProxyJob(QAbstractAnimationJob *job, QObject *item)-
39 : m_controller(nullptr)-
40 , m_internalState(State_Stopped)-
41{-
42 m_job.reset(job);-
43-
44 m_isRenderThreadProxy = true;-
45 m_animation = qobject_cast<QQuickAbstractAnimation *>(item);-
46-
47 setLoopCount(job->loopCount());-
48 m_duration = -1;-
49-
50 QObject *ctx = findAnimationContext(m_animation);-
51 if (!ctx
!ctxDescription
TRUEnever evaluated
FALSEevaluated 32 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
) {
0-32
52 QMessageLogger(__FILE__, 111, __PRETTY_FUNCTION__).warning("QtQuick: unable to find animation context for RT animation...");-
53 return;
never executed: return;
0
54 }-
55-
56 QQuickWindow *window = qobject_cast<QQuickWindow *>(ctx);-
57 if (window
windowDescription
TRUEnever evaluated
FALSEevaluated 32 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
) {
0-32
58 setWindow(window);-
59 }
never executed: end of block
else {
0
60 QQuickItem *item = qobject_cast<QQuickItem *>(ctx);-
61 if (item->window()
item->window()Description
TRUEevaluated 32 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
)
0-32
62 setWindow(item->window());
executed 32 times by 2 tests: setWindow(item->window());
Executed by:
  • tst_examples
  • tst_qquickanimations
32
63 connect(item, &QQuickItem::windowChanged, this, &QQuickAnimatorProxyJob::windowChanged);-
64 }
executed 32 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
32
65}-
66-
67QQuickAnimatorProxyJob::~QQuickAnimatorProxyJob()-
68{-
69 if (m_job
m_jobDescription
TRUEevaluated 32 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
&& m_controller)
0-32
70 m_controller->cancel(m_job);
never executed: m_controller->cancel(m_job);
0
71 m_job.reset();-
72}
executed 32 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
32
73-
74QObject *QQuickAnimatorProxyJob::findAnimationContext(QQuickAbstractAnimation *a)-
75{-
76 QObject *p = a->parent();-
77 while (p != nullptr
p != nullptrDescription
TRUEevaluated 32 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
&& qobject_cast<QQuickWindow *>(p) == nullptr
qobject_cast<Q...(p) == nullptrDescription
TRUEevaluated 32 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
&& qobject_cast<QQuickItem *>(p) == nullptr
qobject_cast<Q...(p) == nullptrDescription
TRUEnever evaluated
FALSEevaluated 32 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
)
0-32
78 p = p->parent();
never executed: p = p->parent();
0
79 return
executed 32 times by 2 tests: return p;
Executed by:
  • tst_examples
  • tst_qquickanimations
p;
executed 32 times by 2 tests: return p;
Executed by:
  • tst_examples
  • tst_qquickanimations
32
80}-
81-
82void QQuickAnimatorProxyJob::updateCurrentTime(int)-
83{-
84 if (m_internalState != State_Running
m_internalStat... State_RunningDescription
TRUEnever evaluated
FALSEevaluated 653 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
)
0-653
85 return;
never executed: return;
0
86-
87-
88-
89-
90 ((m_controller) ? static_cast<void>(0) : qt_assert("m_controller", __FILE__, 149));-
91 if (!m_controller->isPendingStart(m_job)
!m_controller-...ngStart(m_job)Description
TRUEevaluated 622 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 31 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
31-622
92 && !m_job->isRunning()
!m_job->isRunning()Description
TRUEnever evaluated
FALSEevaluated 622 times by 1 test
Evaluated by:
  • tst_qquickanimations
) {
0-622
93 stop();-
94 }
never executed: end of block
0
95}
executed 653 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
653
96-
97void QQuickAnimatorProxyJob::updateState(QAbstractAnimationJob::State newState, QAbstractAnimationJob::State)-
98{-
99 if (m_state == Running
m_state == RunningDescription
TRUEevaluated 30 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEevaluated 30 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
) {
30
100 m_internalState = State_Starting;-
101 if (m_controller
m_controllerDescription
TRUEevaluated 30 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
) {
0-30
102 m_internalState = State_Running;-
103 m_controller->start(m_job);-
104 }
executed 30 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
30
105-
106 }
executed 30 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
else if (newState == Stopped
newState == StoppedDescription
TRUEevaluated 30 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
) {
0-30
107 m_internalState = State_Stopped;-
108 if (m_controller
m_controllerDescription
TRUEnever evaluated
FALSEevaluated 30 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
) {
0-30
109 syncBackCurrentValues();-
110 m_controller->cancel(m_job);-
111 }
never executed: end of block
0
112 }
executed 30 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
30
113}
executed 60 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
60
114-
115void QQuickAnimatorProxyJob::debugAnimation(QDebug d) const-
116{-
117 d << "QuickAnimatorProxyJob("<< hex << (const void *) this << dec-
118 << "state:" << state() << "duration:" << duration()-
119 << "proxying: (" << job() << ')';-
120}
never executed: end of block
0
121-
122void QQuickAnimatorProxyJob::windowChanged(QQuickWindow *window)-
123{-
124 setWindow(window);-
125}
executed 32 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
32
126-
127void QQuickAnimatorProxyJob::setWindow(QQuickWindow *window)-
128{-
129 if (!window
!windowDescription
TRUEevaluated 32 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEevaluated 32 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
) {
32
130 if (m_job
m_jobDescription
TRUEevaluated 32 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
&& m_controller) {
0-32
131 disconnect(m_controller->window(), &QQuickWindow::sceneGraphInitialized,-
132 this, &QQuickAnimatorProxyJob::sceneGraphInitialized);-
133 m_controller->cancel(m_job);-
134 }
executed 4 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
4
135-
136 m_controller = nullptr;-
137 stop();-
138-
139 }
executed 32 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
else if (!m_controller
!m_controllerDescription
TRUEevaluated 32 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
&& m_job
m_jobDescription
TRUEevaluated 32 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
) {
0-32
140 m_controller = QQuickWindowPrivate::get(window)->animationController;-
141 if (window->isSceneGraphInitialized()
window->isScen...hInitialized()Description
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickanimations
)
4-28
142 readyToAnimate();
executed 28 times by 1 test: readyToAnimate();
Executed by:
  • tst_examples
28
143 else-
144 connect(window, &QQuickWindow::sceneGraphInitialized, this, &QQuickAnimatorProxyJob::sceneGraphInitialized);
executed 4 times by 1 test: connect(window, &QQuickWindow::sceneGraphInitialized, this, &QQuickAnimatorProxyJob::sceneGraphInitialized);
Executed by:
  • tst_qquickanimations
4
145 }-
146}
executed 64 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
64
147-
148void QQuickAnimatorProxyJob::sceneGraphInitialized()-
149{-
150 disconnect(m_controller->window(), &QQuickWindow::sceneGraphInitialized, this, &QQuickAnimatorProxyJob::sceneGraphInitialized);-
151 readyToAnimate();-
152}
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickanimations
2
153-
154void QQuickAnimatorProxyJob::readyToAnimate()-
155{-
156 ((m_controller) ? static_cast<void>(0) : qt_assert("m_controller", __FILE__, 226));-
157 if (m_internalState == State_Starting
m_internalStat...State_StartingDescription
TRUEnever evaluated
FALSEevaluated 30 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
) {
0-30
158 m_internalState = State_Running;-
159 m_controller->start(m_job);-
160 }
never executed: end of block
0
161}
executed 30 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
30
162-
163static void qquick_syncback_helper(QAbstractAnimationJob *job)-
164{-
165 if (job->isRenderThreadJob()
job->isRenderThreadJob()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
166 static_cast<QQuickAnimatorJob *>(job)->writeBack();-
167-
168 }
never executed: end of block
else if (job->isGroup()
job->isGroup()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
169 QAnimationGroupJob *g = static_cast<QAnimationGroupJob *>(job);-
170 for (QAbstractAnimationJob *a = g->firstChild(); a
aDescription
TRUEnever evaluated
FALSEnever evaluated
; a = a->nextSibling())
0
171 qquick_syncback_helper(a);
never executed: qquick_syncback_helper(a);
0
172 }
never executed: end of block
0
173-
174}
never executed: end of block
0
175-
176void QQuickAnimatorProxyJob::syncBackCurrentValues()-
177{-
178 if (m_job
m_jobDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
179 qquick_syncback_helper(m_job.data());
never executed: qquick_syncback_helper(m_job.data());
0
180}
never executed: end of block
0
181-
182QQuickAnimatorJob::QQuickAnimatorJob()-
183 : m_target(nullptr)-
184 , m_controller(nullptr)-
185 , m_from(0)-
186 , m_to(0)-
187 , m_value(0)-
188 , m_duration(0)-
189 , m_isTransform(false)-
190 , m_isUniform(false)-
191{-
192 m_isRenderThreadJob = true;-
193}
executed 36 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
36
194-
195void QQuickAnimatorJob::debugAnimation(QDebug d) const-
196{-
197 d << "QuickAnimatorJob(" << hex << (const void *) this << dec-
198 << ") state:" << state() << "duration:" << duration()-
199 << "target:" << m_target << "value:" << m_value;-
200}
never executed: end of block
0
201-
202qreal QQuickAnimatorJob::progress(int time) const-
203{-
204 return
executed 22 times by 1 test: return m_easing.valueForProgress((m_duration == 0) ? qreal(1) : qreal(time) / qreal(m_duration));
Executed by:
  • tst_examples
m_easing.valueForProgress((m_duration == 0) ? qreal(1) : qreal(time) / qreal(m_duration));
executed 22 times by 1 test: return m_easing.valueForProgress((m_duration == 0) ? qreal(1) : qreal(time) / qreal(m_duration));
Executed by:
  • tst_examples
22
205}-
206-
207qreal QQuickAnimatorJob::value() const-
208{-
209 qreal value = m_to;-
210 if (m_controller
m_controllerDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
211 m_controller->lock();-
212 value = m_value;-
213 m_controller->unlock();-
214 }
never executed: end of block
0
215 return
never executed: return value;
value;
never executed: return value;
0
216}-
217-
218void QQuickAnimatorJob::setTarget(QQuickItem *target)-
219{-
220 m_target = target;-
221}
executed 42 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
42
222-
223void QQuickAnimatorJob::initialize(QQuickAnimatorController *controller)-
224{-
225 m_controller = controller;-
226}
executed 36 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
36
227-
228QQuickTransformAnimatorJob::QQuickTransformAnimatorJob()-
229 : m_helper(nullptr)-
230{-
231 m_isTransform = true;-
232}
executed 26 times by 1 test: end of block
Executed by:
  • tst_examples
26
233-
234QQuickTransformAnimatorJob::~QQuickTransformAnimatorJob()-
235{-
236 if (m_helper
m_helperDescription
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
)
0-26
237 qquick_transform_animatorjob_helper_store()->release(m_helper);
executed 26 times by 1 test: qquick_transform_animatorjob_helper_store()->release(m_helper);
Executed by:
  • tst_examples
26
238}
executed 26 times by 1 test: end of block
Executed by:
  • tst_examples
26
239-
240void QQuickTransformAnimatorJob::setTarget(QQuickItem *item)-
241{-
242-
243-
244-
245 if (m_helper
m_helperDescription
TRUEnever evaluated
FALSEevaluated 34 times by 1 test
Evaluated by:
  • tst_examples
&& m_target
m_targetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0-34
246 m_helper->wasSynced = false;
never executed: m_helper->wasSynced = false;
0
247 QQuickAnimatorJob::setTarget(item);-
248}
executed 34 times by 1 test: end of block
Executed by:
  • tst_examples
34
249-
250void QQuickTransformAnimatorJob::preSync()-
251{-
252-
253 if (m_helper
m_helperDescription
TRUEnever evaluated
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_examples
&& (m_helper->item != m_target
m_helper->item != m_targetDescription
TRUEnever evaluated
FALSEnever evaluated
|| !m_target
!m_targetDescription
TRUEnever evaluated
FALSEnever evaluated
)) {
0-26
254 qquick_transform_animatorjob_helper_store()->release(m_helper);-
255 m_helper = nullptr;-
256 }
never executed: end of block
0
257-
258 if (!m_target
!m_targetDescription
TRUEnever evaluated
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_examples
) {
0-26
259 invalidate();-
260 return;
never executed: return;
0
261 }-
262-
263 if (!m_helper
!m_helperDescription
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
) {
0-26
264 m_helper = qquick_transform_animatorjob_helper_store()->acquire(m_target);-
265 m_helper->wasSynced = false;-
266 }
executed 26 times by 1 test: end of block
Executed by:
  • tst_examples
26
267-
268 m_helper->sync();-
269}
executed 26 times by 1 test: end of block
Executed by:
  • tst_examples
26
270-
271void QQuickTransformAnimatorJob::invalidate()-
272{-
273 if (m_helper
m_helperDescription
TRUEevaluated 34 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
)
0-34
274 m_helper->node = nullptr;
executed 34 times by 1 test: m_helper->node = nullptr;
Executed by:
  • tst_examples
34
275}
executed 34 times by 1 test: end of block
Executed by:
  • tst_examples
34
276-
277void QQuickTransformAnimatorJob::Helper::sync()-
278{-
279 const quint32 mask = QQuickItemPrivate::Position-
280 | QQuickItemPrivate::BasicTransform-
281 | QQuickItemPrivate::TransformOrigin-
282 | QQuickItemPrivate::Size;-
283-
284 QQuickItemPrivate *d = QQuickItemPrivate::get(item);-
285-
286 if (d->extra.isAllocated()
d->extra.isAllocated()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_examples
10-16
287 && d->extra->layer
d->extra->layerDescription
TRUEnever evaluated
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_examples
0-10
288 && d->extra->layer->enabled()
d->extra->layer->enabled()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
289 d = QQuickItemPrivate::get(d->extra->layer->m_effectSource);-
290 }
never executed: end of block
0
291-
292-
293 quint32 dirty = mask & d->dirtyAttributes;-
294-
295 if (!wasSynced
!wasSyncedDescription
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
) {
0-26
296 dirty = 0xffffffffu;-
297 wasSynced = true;-
298 }
executed 26 times by 1 test: end of block
Executed by:
  • tst_examples
26
299-
300 if (dirty == 0
dirty == 0Description
TRUEnever evaluated
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_examples
)
0-26
301 return;
never executed: return;
0
302-
303 node = d->itemNode();-
304-
305 if (dirty & QQuickItemPrivate::Position
dirty & QQuick...vate::PositionDescription
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
) {
0-26
306 dx = item->x();-
307 dy = item->y();-
308 }
executed 26 times by 1 test: end of block
Executed by:
  • tst_examples
26
309-
310 if (dirty & QQuickItemPrivate::BasicTransform
dirty & QQuick...BasicTransformDescription
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
) {
0-26
311 scale = item->scale();-
312 rotation = item->rotation();-
313 }
executed 26 times by 1 test: end of block
Executed by:
  • tst_examples
26
314-
315 if (dirty & (QQuickItemPrivate::TransformOrigin | QQuickItemPrivate::Size)
dirty & (QQuic...Private::Size)Description
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
) {
0-26
316 QPointF o = item->transformOriginPoint();-
317 ox = o.x();-
318 oy = o.y();-
319 }
executed 26 times by 1 test: end of block
Executed by:
  • tst_examples
26
320}
executed 26 times by 1 test: end of block
Executed by:
  • tst_examples
26
321-
322void QQuickTransformAnimatorJob::Helper::commit()-
323{-
324 if (!wasChanged
!wasChangedDescription
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_examples
|| !node
!nodeDescription
TRUEnever evaluated
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_examples
)
0-22
325 return;
executed 22 times by 1 test: return;
Executed by:
  • tst_examples
22
326-
327 QMatrix4x4 m;-
328 m.translate(dx, dy);-
329 m.translate(ox, oy);-
330 m.scale(scale);-
331 m.rotate(rotation, 0, 0, 1);-
332 m.translate(-ox, -oy);-
333 node->setMatrix(m);-
334-
335 wasChanged = false;-
336}
executed 22 times by 1 test: end of block
Executed by:
  • tst_examples
22
337-
338void QQuickTransformAnimatorJob::commit()-
339{-
340 if (m_helper
m_helperDescription
TRUEevaluated 44 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
)
0-44
341 m_helper->commit();
executed 44 times by 1 test: m_helper->commit();
Executed by:
  • tst_examples
44
342}
executed 44 times by 1 test: end of block
Executed by:
  • tst_examples
44
343-
344void QQuickXAnimatorJob::writeBack()-
345{-
346 if (m_target
m_targetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
347 m_target->setX(value());
never executed: m_target->setX(value());
0
348}
never executed: end of block
0
349-
350void QQuickXAnimatorJob::updateCurrentTime(int time)-
351{-
352-
353 ((!m_controller || !m_controller->m_window->openglContext() || m_controller->m_window->openglContext()->thread() == QThread::currentThread()) ? static_cast<void>(0) : qt_assert("!m_controller || !m_controller->m_window->openglContext() || m_controller->m_window->openglContext()->thread() == QThread::currentThread()", __FILE__, 433));-
354-
355 if (!m_helper
!m_helperDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
)
0-4
356 return;
never executed: return;
0
357-
358 m_value = m_from + (m_to - m_from) * progress(time);-
359 m_helper->dx = m_value;-
360 m_helper->wasChanged = true;-
361}
executed 4 times by 1 test: end of block
Executed by:
  • tst_examples
4
362-
363void QQuickYAnimatorJob::writeBack()-
364{-
365 if (m_target
m_targetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
366 m_target->setY(value());
never executed: m_target->setY(value());
0
367}
never executed: end of block
0
368-
369void QQuickYAnimatorJob::updateCurrentTime(int time)-
370{-
371-
372 ((!m_controller || !m_controller->m_window->openglContext() || m_controller->m_window->openglContext()->thread() == QThread::currentThread()) ? static_cast<void>(0) : qt_assert("!m_controller || !m_controller->m_window->openglContext() || m_controller->m_window->openglContext()->thread() == QThread::currentThread()", __FILE__, 452));-
373-
374 if (!m_helper
!m_helperDescription
TRUEnever evaluated
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_examples
)
0-6
375 return;
never executed: return;
0
376-
377 m_value = m_from + (m_to - m_from) * progress(time);-
378 m_helper->dy = m_value;-
379 m_helper->wasChanged = true;-
380}
executed 6 times by 1 test: end of block
Executed by:
  • tst_examples
6
381-
382void QQuickScaleAnimatorJob::writeBack()-
383{-
384 if (m_target
m_targetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
385 m_target->setScale(value());
never executed: m_target->setScale(value());
0
386}
never executed: end of block
0
387-
388void QQuickScaleAnimatorJob::updateCurrentTime(int time)-
389{-
390-
391 ((!m_controller || !m_controller->m_window->openglContext() || m_controller->m_window->openglContext()->thread() == QThread::currentThread()) ? static_cast<void>(0) : qt_assert("!m_controller || !m_controller->m_window->openglContext() || m_controller->m_window->openglContext()->thread() == QThread::currentThread()", __FILE__, 471));-
392-
393 if (!m_helper
!m_helperDescription
TRUEnever evaluated
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_examples
)
0-8
394 return;
never executed: return;
0
395-
396 m_value = m_from + (m_to - m_from) * progress(time);-
397 m_helper->scale = m_value;-
398 m_helper->wasChanged = true;-
399}
executed 8 times by 1 test: end of block
Executed by:
  • tst_examples
8
400-
401-
402QQuickRotationAnimatorJob::QQuickRotationAnimatorJob()-
403 : m_direction(QQuickRotationAnimator::Numerical)-
404{-
405}
executed 4 times by 1 test: end of block
Executed by:
  • tst_examples
4
406-
407extern QVariant _q_interpolateShortestRotation(qreal &f, qreal &t, qreal progress);-
408extern QVariant _q_interpolateClockwiseRotation(qreal &f, qreal &t, qreal progress);-
409extern QVariant _q_interpolateCounterclockwiseRotation(qreal &f, qreal &t, qreal progress);-
410-
411void QQuickRotationAnimatorJob::updateCurrentTime(int time)-
412{-
413-
414 ((!m_controller || !m_controller->m_window->openglContext() || m_controller->m_window->openglContext()->thread() == QThread::currentThread()) ? static_cast<void>(0) : qt_assert("!m_controller || !m_controller->m_window->openglContext() || m_controller->m_window->openglContext()->thread() == QThread::currentThread()", __FILE__, 494));-
415-
416 if (!m_helper
!m_helperDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
)
0-4
417 return;
never executed: return;
0
418-
419 float t = progress(time);-
420-
421 switch (m_direction) {-
422 case
never executed: case QQuickRotationAnimator::Clockwise:
QQuickRotationAnimator::Clockwise:
never executed: case QQuickRotationAnimator::Clockwise:
0
423 m_value = _q_interpolateClockwiseRotation(m_from, m_to, t).toFloat();-
424-
425-
426-
427 if (t == 1
t == 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0
428 m_value = m_to;
never executed: m_value = m_to;
0
429 break;
never executed: break;
0
430 case
never executed: case QQuickRotationAnimator::Counterclockwise:
QQuickRotationAnimator::Counterclockwise:
never executed: case QQuickRotationAnimator::Counterclockwise:
0
431 m_value = _q_interpolateCounterclockwiseRotation(m_from, m_to, t).toFloat();-
432 break;
never executed: break;
0
433 case
never executed: case QQuickRotationAnimator::Shortest:
QQuickRotationAnimator::Shortest:
never executed: case QQuickRotationAnimator::Shortest:
0
434 m_value = _q_interpolateShortestRotation(m_from, m_to, t).toFloat();-
435 break;
never executed: break;
0
436 case
executed 4 times by 1 test: case QQuickRotationAnimator::Numerical:
Executed by:
  • tst_examples
QQuickRotationAnimator::Numerical:
executed 4 times by 1 test: case QQuickRotationAnimator::Numerical:
Executed by:
  • tst_examples
4
437 m_value = m_from + (m_to - m_from) * t;-
438 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_examples
4
439 }-
440 m_helper->rotation = m_value;-
441 m_helper->wasChanged = true;-
442}
executed 4 times by 1 test: end of block
Executed by:
  • tst_examples
4
443-
444void QQuickRotationAnimatorJob::writeBack()-
445{-
446 if (m_target
m_targetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
447 m_target->setRotation(value());
never executed: m_target->setRotation(value());
0
448}
never executed: end of block
0
449-
450-
451QQuickOpacityAnimatorJob::QQuickOpacityAnimatorJob()-
452 : m_opacityNode(nullptr)-
453{-
454}
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
6
455-
456void QQuickOpacityAnimatorJob::postSync()-
457{-
458 if (!m_target
!m_targetDescription
TRUEevaluated 847 times by 1 test
Evaluated by:
  • tst_qquickanimations
FALSEevaluated 8 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
) {
8-847
459 invalidate();-
460 return;
executed 847 times by 1 test: return;
Executed by:
  • tst_qquickanimations
847
461 }-
462-
463 QQuickItemPrivate *d = QQuickItemPrivate::get(m_target);-
464-
465 if (d->extra.isAllocated()
d->extra.isAllocated()Description
TRUEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
4
466 && d->extra->layer
d->extra->layerDescription
TRUEnever evaluated
FALSEevaluated 4 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
0-4
467 && d->extra->layer->enabled()
d->extra->layer->enabled()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
468 d = QQuickItemPrivate::get(d->extra->layer->m_effectSource);-
469 }
never executed: end of block
0
470-
471-
472 m_opacityNode = d->opacityNode();-
473-
474 if (!m_opacityNode
!m_opacityNodeDescription
TRUEevaluated 6 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
) {
2-6
475 m_opacityNode = new QSGOpacityNode();-
476 QSGNode *iNode = d->itemNode();-
477 QSGNode *child = d->childContainerNode();-
478 if (child != iNode
child != iNodeDescription
TRUEnever evaluated
FALSEevaluated 6 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
) {
0-6
479 if (child->parent()
child->parent()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
480 child->parent()->removeChildNode(child);
never executed: child->parent()->removeChildNode(child);
0
481 m_opacityNode->appendChildNode(child);-
482 iNode->appendChildNode(m_opacityNode);-
483 }
never executed: end of block
else {
0
484 iNode->reparentChildNodesTo(m_opacityNode);-
485 iNode->appendChildNode(m_opacityNode);-
486 }
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
6
487-
488 d->extra.value().opacityNode = m_opacityNode;-
489 }
executed 6 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
6
490 ((m_opacityNode) ? static_cast<void>(0) : qt_assert("m_opacityNode", __FILE__, 584));-
491}
executed 8 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
8
492-
493void QQuickOpacityAnimatorJob::invalidate()-
494{-
495 m_opacityNode = nullptr;-
496}
executed 853 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
853
497-
498void QQuickOpacityAnimatorJob::writeBack()-
499{-
500 if (m_target
m_targetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
501 m_target->setOpacity(value());
never executed: m_target->setOpacity(value());
0
502}
never executed: end of block
0
503-
504void QQuickOpacityAnimatorJob::updateCurrentTime(int time)-
505{-
506-
507 ((!m_controller || !m_controller->m_window->openglContext() || m_controller->m_window->openglContext()->thread() == QThread::currentThread()) ? static_cast<void>(0) : qt_assert("!m_controller || !m_controller->m_window->openglContext() || m_controller->m_window->openglContext()->thread() == QThread::currentThread()", __FILE__, 601));-
508-
509-
510 if (!m_opacityNode
!m_opacityNodeDescription
TRUEevaluated 628 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
)
0-628
511 return;
executed 628 times by 2 tests: return;
Executed by:
  • tst_examples
  • tst_qquickanimations
628
512-
513 m_value = m_from + (m_to - m_from) * progress(time);-
514 m_opacityNode->setOpacity(m_value);-
515}
never executed: end of block
0
516-
517-
518-
519QQuickUniformAnimatorJob::QQuickUniformAnimatorJob()-
520 : m_node(nullptr)-
521 , m_uniformIndex(-1)-
522 , m_uniformType(-1)-
523{-
524 m_isUniform = true;-
525}
executed 4 times by 1 test: end of block
Executed by:
  • tst_examples
4
526-
527void QQuickUniformAnimatorJob::setTarget(QQuickItem *target)-
528{-
529 QQuickShaderEffect* effect = qobject_cast<QQuickShaderEffect*>(target);-
530 if (effect
effectDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_examples
&& effect->isOpenGLShaderEffect()
effect->isOpenGLShaderEffect()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
)
0-4
531 m_target = target;
executed 4 times by 1 test: m_target = target;
Executed by:
  • tst_examples
4
532}
executed 6 times by 1 test: end of block
Executed by:
  • tst_examples
6
533-
534void QQuickUniformAnimatorJob::invalidate()-
535{-
536 m_node = nullptr;-
537 m_uniformIndex = -1;-
538 m_uniformType = -1;-
539}
executed 4 times by 1 test: end of block
Executed by:
  • tst_examples
4
540-
541void QQuickUniformAnimatorJob::postSync()-
542{-
543 if (!m_target
!m_targetDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
) {
0-4
544 invalidate();-
545 return;
never executed: return;
0
546 }-
547-
548 m_node = static_cast<QQuickOpenGLShaderEffectNode *>(QQuickItemPrivate::get(m_target)->paintNode);-
549-
550 if (m_node
m_nodeDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
&& m_uniformIndex == -1
m_uniformIndex == -1Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
&& m_uniformType == -1
m_uniformType == -1Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
) {
0-4
551 QQuickOpenGLShaderEffectMaterial *material =-
552 static_cast<QQuickOpenGLShaderEffectMaterial *>(m_node->material());-
553 bool found = false;-
554 for (int t=0; !found
!foundDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
&& t<QQuickOpenGLShaderEffectMaterialKey::ShaderTypeCount
t<QQuickOpenGL...haderTypeCountDescription
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
; ++t) {
0-8
555 const QVector<QQuickOpenGLShaderEffectMaterial::UniformData> &uniforms = material->uniforms[t];-
556 for (int i=0; i<uniforms.size()
i<uniforms.size()Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
; ++i) {
4-8
557 if (uniforms.at(i).name == m_uniform
uniforms.at(i)...e == m_uniformDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
) {
4
558 m_uniformIndex = i;-
559 m_uniformType = t;-
560 found = true;-
561 break;
executed 4 times by 1 test: break;
Executed by:
  • tst_examples
4
562 }-
563 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_examples
4
564 }
executed 8 times by 1 test: end of block
Executed by:
  • tst_examples
8
565 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_examples
4
566-
567}
executed 4 times by 1 test: end of block
Executed by:
  • tst_examples
4
568-
569void QQuickUniformAnimatorJob::updateCurrentTime(int time)-
570{-
571 if (!m_controller
!m_controllerDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
)
0-4
572 return;
never executed: return;
0
573-
574 if (!m_node
!m_nodeDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
|| m_uniformIndex == -1
m_uniformIndex == -1Description
TRUEnever evaluated
FALSEnever evaluated
|| m_uniformType == -1
m_uniformType == -1Description
TRUEnever evaluated
FALSEnever evaluated
)
0-4
575 return;
executed 4 times by 1 test: return;
Executed by:
  • tst_examples
4
576-
577 m_value = m_from + (m_to - m_from) * progress(time);-
578-
579 QQuickOpenGLShaderEffectMaterial *material =-
580 static_cast<QQuickOpenGLShaderEffectMaterial *>(m_node->material());-
581 material->uniforms[m_uniformType][m_uniformIndex].value = m_value;-
582-
583-
584-
585 m_node->markDirty(QSGNode::DirtyMaterial);-
586}
never executed: end of block
0
587-
588void QQuickUniformAnimatorJob::writeBack()-
589{-
590 if (m_target
m_targetDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
591 m_target->setProperty(m_uniform, value());
never executed: m_target->setProperty(m_uniform, value());
0
592}
never executed: end of block
0
593-
594-
595-
596-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0