OpenCoverage

qquickanimatorcontroller.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/util/qquickanimatorcontroller.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8QQuickAnimatorController::~QQuickAnimatorController()-
9{-
10}-
11-
12QQuickAnimatorController::QQuickAnimatorController(QQuickWindow *window)-
13 : m_window(window)-
14{-
15}
executed 5366 times by 90 tests: end of block
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickdroparea
  • ...
5366
16-
17static void qquickanimator_invalidate_jobs(QAbstractAnimationJob *job)-
18{-
19 if (job->isRenderThreadJob()
job->isRenderThreadJob()Description
TRUEevaluated 44 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEevaluated 14 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
) {
14-44
20 static_cast<QQuickAnimatorJob *>(job)->invalidate();-
21 }
executed 44 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
else if (job->isGroup()
job->isGroup()Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickanimations
) {
2-44
22 QAnimationGroupJob *g = static_cast<QAnimationGroupJob *>(job);-
23 for (QAbstractAnimationJob *a = g->firstChild(); a
aDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 12 times by 1 test
Evaluated by:
  • tst_examples
; a = a->nextSibling())
12-24
24 qquickanimator_invalidate_jobs(a);
executed 24 times by 1 test: qquickanimator_invalidate_jobs(a);
Executed by:
  • tst_examples
24
25 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_examples
12
26}
executed 58 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
58
27-
28void QQuickAnimatorController::windowNodesDestroyed()-
29{-
30 for (const QSharedPointer<QAbstractAnimationJob> &toStop : qAsConst(m_rootsPendingStop)) {-
31 qquickanimator_invalidate_jobs(toStop.data());-
32 toStop->stop();-
33 }
executed 4 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
4
34 m_rootsPendingStop.clear();-
35-
36-
37-
38 const auto roots = m_animationRoots;-
39 m_animationRoots.clear();-
40 for (const QSharedPointer<QAbstractAnimationJob> &job : roots) {-
41 qquickanimator_invalidate_jobs(job.data());-
42-
43-
44-
45 job->stop();-
46 m_rootsPendingStart.insert(job);-
47 }
executed 30 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
30
48}
executed 5362 times by 90 tests: end of block
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlcomponent
  • tst_qqmldebugjs
  • tst_qqmlimport
  • tst_qqmltypeloader
  • tst_qquickaccessible
  • tst_qquickage
  • tst_qquickanchors
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickapplication
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdesignersupport
  • tst_qquickdrag
  • tst_qquickdraghandler
  • tst_qquickdroparea
  • ...
5362
49-
50void QQuickAnimatorController::advance()-
51{-
52 bool running = false;-
53 for (const QSharedPointer<QAbstractAnimationJob> &job : qAsConst(m_animationRoots)) {-
54 if (job->isRunning()
job->isRunning()Description
TRUEevaluated 855 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
) {
0-855
55 running = true;-
56 break;
executed 855 times by 2 tests: break;
Executed by:
  • tst_examples
  • tst_qquickanimations
855
57 }-
58 }
never executed: end of block
0
59-
60 for (QQuickAnimatorJob *job : qAsConst(m_runningAnimators))-
61 job->commit();
executed 881 times by 2 tests: job->commit();
Executed by:
  • tst_examples
  • tst_qquickanimations
881
62-
63 if (running
runningDescription
TRUEevaluated 855 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEevaluated 49768 times by 75 tests
Evaluated by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlcomponent
  • tst_qqmltypeloader
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdraghandler
  • tst_qquickellipseextruder
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickframebufferobject
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgridview
  • ...
)
855-49768
64 m_window->update();
executed 855 times by 2 tests: m_window->update();
Executed by:
  • tst_examples
  • tst_qquickanimations
855
65}
executed 50623 times by 76 tests: end of block
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlcomponent
  • tst_qqmltypeloader
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdraghandler
  • tst_qquickellipseextruder
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickframebufferobject
  • tst_qquickfriction
  • tst_qquickgravity
  • ...
50623
66-
67static void qquickanimator_sync_before_start(QAbstractAnimationJob *job)-
68{-
69 if (job->isRenderThreadJob()
job->isRenderThreadJob()Description
TRUEevaluated 36 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_examples
) {
6-36
70 static_cast<QQuickAnimatorJob *>(job)->preSync();-
71 }
executed 36 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
else if (job->isGroup()
job->isGroup()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
) {
0-36
72 QAnimationGroupJob *g = static_cast<QAnimationGroupJob *>(job);-
73 for (QAbstractAnimationJob *a = g->firstChild(); a
aDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_examples
; a = a->nextSibling())
6-12
74 qquickanimator_sync_before_start(a);
executed 12 times by 1 test: qquickanimator_sync_before_start(a);
Executed by:
  • tst_examples
12
75 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_examples
6
76}
executed 42 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
42
77-
78void QQuickAnimatorController::beforeNodeSync()-
79{-
80 for (const QSharedPointer<QAbstractAnimationJob> &toStop : qAsConst(m_rootsPendingStop)) {-
81 toStop->stop();-
82 m_animationRoots.remove(toStop.data());-
83 }
never executed: end of block
0
84 m_rootsPendingStop.clear();-
85-
86-
87 for (QQuickAnimatorJob *job : qAsConst(m_runningAnimators))-
88 job->preSync();
executed 849 times by 1 test: job->preSync();
Executed by:
  • tst_qquickanimations
849
89-
90-
91 for (const QSharedPointer<QAbstractAnimationJob> &job : qAsConst(m_rootsPendingStart)) {-
92 ((!job->isRunning()) ? static_cast<void>(0) : qt_assert("!job->isRunning()", __FILE__, 138));-
93-
94-
95-
96-
97-
98 qquickanimator_sync_before_start(job.data());-
99-
100-
101 job->start();-
102 m_animationRoots.insert(job.data(), job);-
103 }
executed 30 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
30
104 m_rootsPendingStart.clear();-
105-
106-
107 if (m_animationRoots.size()
m_animationRoots.size()Description
TRUEevaluated 855 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEevaluated 49764 times by 75 tests
Evaluated by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlcomponent
  • tst_qqmltypeloader
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdraghandler
  • tst_qquickellipseextruder
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickframebufferobject
  • tst_qquickfriction
  • tst_qquickgravity
  • tst_qquickgridview
  • ...
)
855-49764
108 m_window->update();
executed 855 times by 2 tests: m_window->update();
Executed by:
  • tst_examples
  • tst_qquickanimations
855
109}
executed 50619 times by 76 tests: end of block
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlcomponent
  • tst_qqmltypeloader
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdraghandler
  • tst_qquickellipseextruder
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickframebufferobject
  • tst_qquickfriction
  • tst_qquickgravity
  • ...
50619
110-
111void QQuickAnimatorController::afterNodeSync()-
112{-
113 for (QQuickAnimatorJob *job : qAsConst(m_runningAnimators))-
114 job->postSync();
executed 881 times by 2 tests: job->postSync();
Executed by:
  • tst_examples
  • tst_qquickanimations
881
115}
executed 50619 times by 76 tests: end of block
Executed by:
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_qqmlcomponent
  • tst_qqmltypeloader
  • tst_qquickage
  • tst_qquickangleddirection
  • tst_qquickanimatedimage
  • tst_qquickanimatedsprite
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickborderimage
  • tst_qquickcumulativedirection
  • tst_qquickcustomaffector
  • tst_qquickcustomparticle
  • tst_qquickdraghandler
  • tst_qquickellipseextruder
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickfontloader
  • tst_qquickfontloader_static
  • tst_qquickframebufferobject
  • tst_qquickfriction
  • tst_qquickgravity
  • ...
50619
116-
117void QQuickAnimatorController::animationFinished(QAbstractAnimationJob *job)-
118{-
119 m_animationRoots.remove(job);-
120}
never executed: end of block
0
121-
122void QQuickAnimatorController::animationStateChanged(QAbstractAnimationJob *job,-
123 QAbstractAnimationJob::State newState,-
124 QAbstractAnimationJob::State oldState)-
125{-
126 ((job->isRenderThreadJob()) ? static_cast<void>(0) : qt_assert("job->isRenderThreadJob()", __FILE__, 172));-
127 QQuickAnimatorJob *animator = static_cast<QQuickAnimatorJob *>(job);-
128 if (newState == QAbstractAnimationJob::Running
newState == QA...onJob::RunningDescription
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
129 m_runningAnimators.insert(animator);-
130 }
executed 32 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
else if (oldState == QAbstractAnimationJob::Running
oldState == QA...onJob::RunningDescription
TRUEevaluated 32 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEnever evaluated
) {
0-32
131 animator->commit();-
132 m_runningAnimators.remove(animator);-
133 }
executed 32 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
32
134}
executed 64 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
64
135-
136-
137void QQuickAnimatorController::requestSync()-
138{-
139-
140 m_window->maybeUpdate();-
141}
executed 30 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
30
142-
143-
144-
145void QQuickAnimatorController::start_helper(QAbstractAnimationJob *job)-
146{-
147 if (job->isRenderThreadJob()
job->isRenderThreadJob()Description
TRUEevaluated 36 times by 2 tests
Evaluated by:
  • tst_examples
  • tst_qquickanimations
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_examples
) {
6-36
148 QQuickAnimatorJob *j = static_cast<QQuickAnimatorJob *>(job);-
149 j->addAnimationChangeListener(this, QAbstractAnimationJob::StateChange);-
150 j->initialize(this);-
151 }
executed 36 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
else if (job->isGroup()
job->isGroup()Description
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_examples
FALSEnever evaluated
) {
0-36
152 QAnimationGroupJob *g = static_cast<QAnimationGroupJob *>(job);-
153 for (QAbstractAnimationJob *a = g->firstChild(); a
aDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_examples
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_examples
; a = a->nextSibling())
6-12
154 start_helper(a);
executed 12 times by 1 test: start_helper(a);
Executed by:
  • tst_examples
12
155 }
executed 6 times by 1 test: end of block
Executed by:
  • tst_examples
6
156}
executed 42 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
42
157-
158-
159void QQuickAnimatorController::start(const QSharedPointer<QAbstractAnimationJob> &job)-
160{-
161 m_rootsPendingStart.insert(job);-
162 m_rootsPendingStop.remove(job);-
163 job->addAnimationChangeListener(this, QAbstractAnimationJob::Completion);-
164 start_helper(job.data());-
165 requestSync();-
166}
executed 30 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
30
167-
168-
169-
170void QQuickAnimatorController::cancel(const QSharedPointer<QAbstractAnimationJob> &job)-
171{-
172 m_rootsPendingStart.remove(job);-
173 m_rootsPendingStop.insert(job);-
174}
executed 4 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickanimations
4
175-
176-
177-
178-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0