| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/particles/qquickspritegoal.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||
| 2 | - | |||||||||||||||||||
| 3 | QQuickSpriteGoalAffector::QQuickSpriteGoalAffector(QQuickItem *parent) : | - | ||||||||||||||||||
| 4 | QQuickParticleAffector(parent), | - | ||||||||||||||||||
| 5 | m_goalIdx(-1), | - | ||||||||||||||||||
| 6 | m_lastEngine(nullptr), | - | ||||||||||||||||||
| 7 | m_jump(false), | - | ||||||||||||||||||
| 8 | m_systemStates(false), | - | ||||||||||||||||||
| 9 | m_notUsingEngine(false) | - | ||||||||||||||||||
| 10 | { | - | ||||||||||||||||||
| 11 | m_ignoresTime = true; | - | ||||||||||||||||||
| 12 | } executed 16 times by 2 tests: end of blockExecuted by:
| 16 | ||||||||||||||||||
| 13 | - | |||||||||||||||||||
| 14 | void QQuickSpriteGoalAffector::updateStateIndex(QQuickStochasticEngine* e) | - | ||||||||||||||||||
| 15 | { | - | ||||||||||||||||||
| 16 | if (m_systemStates
| 0-2 | ||||||||||||||||||
| 17 | m_goalIdx = m_system->groupIds[m_goalState]; | - | ||||||||||||||||||
| 18 | } never executed: else{end of block | 0 | ||||||||||||||||||
| 19 | m_lastEngine = e; | - | ||||||||||||||||||
| 20 | for (int i=0; i<e->stateCount()
| 0-4 | ||||||||||||||||||
| 21 | if (e->state(i)->name() == m_goalState
| 2 | ||||||||||||||||||
| 22 | m_goalIdx = i; | - | ||||||||||||||||||
| 23 | return; executed 2 times by 1 test: return;Executed by:
| 2 | ||||||||||||||||||
| 24 | } | - | ||||||||||||||||||
| 25 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||
| 26 | m_goalIdx = -1; | - | ||||||||||||||||||
| 27 | } never executed: end of block | 0 | ||||||||||||||||||
| 28 | } | - | ||||||||||||||||||
| 29 | - | |||||||||||||||||||
| 30 | void QQuickSpriteGoalAffector::setGoalState(const QString &arg) | - | ||||||||||||||||||
| 31 | { | - | ||||||||||||||||||
| 32 | if (m_goalState != arg
| 0-16 | ||||||||||||||||||
| 33 | m_goalState = arg; | - | ||||||||||||||||||
| 34 | goalStateChanged(arg); | - | ||||||||||||||||||
| 35 | if (m_goalState.isEmpty()
| 0-16 | ||||||||||||||||||
| 36 | m_goalIdx = -1; never executed: m_goalIdx = -1; | 0 | ||||||||||||||||||
| 37 | else | - | ||||||||||||||||||
| 38 | m_goalIdx = -2; executed 16 times by 2 tests: m_goalIdx = -2;Executed by:
| 16 | ||||||||||||||||||
| 39 | } | - | ||||||||||||||||||
| 40 | } executed 16 times by 2 tests: end of blockExecuted by:
| 16 | ||||||||||||||||||
| 41 | - | |||||||||||||||||||
| 42 | bool QQuickSpriteGoalAffector::affectParticle(QQuickParticleData *d, qreal dt) | - | ||||||||||||||||||
| 43 | { | - | ||||||||||||||||||
| 44 | (void)dt;; | - | ||||||||||||||||||
| 45 | QQuickStochasticEngine *engine = nullptr; | - | ||||||||||||||||||
| 46 | if (!m_systemStates
| 0-22348 | ||||||||||||||||||
| 47 | - | |||||||||||||||||||
| 48 | for (auto _container_ = QtPrivate::qMakeForeachContainer(m_system->groupData[d->groupId]->painters); _container_.control
| 0-44696 | ||||||||||||||||||
| 49 | if (qobject_cast<QQuickImageParticle*>(p)
| 0-22348 | ||||||||||||||||||
| 50 | engine = qobject_cast<QQuickImageParticle*>(p)->spriteEngine(); executed 22348 times by 1 test: engine = qobject_cast<QQuickImageParticle*>(p)->spriteEngine();Executed by:
| 22348 | ||||||||||||||||||
| 51 | } executed 22348 times by 1 test: else{end of blockExecuted by:
| 22348 | ||||||||||||||||||
| 52 | engine = m_system->stateEngine; | - | ||||||||||||||||||
| 53 | if (!engine
| 0 | ||||||||||||||||||
| 54 | m_notUsingEngine = true; never executed: m_notUsingEngine = true; | 0 | ||||||||||||||||||
| 55 | } never executed: end of block | 0 | ||||||||||||||||||
| 56 | if (!engine
| 0-22348 | ||||||||||||||||||
| 57 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 58 | - | |||||||||||||||||||
| 59 | if (m_goalIdx == -2
| 0-22346 | ||||||||||||||||||
| 60 | updateStateIndex(engine); executed 2 times by 1 test: updateStateIndex(engine);Executed by:
| 2 | ||||||||||||||||||
| 61 | int index = d->index; | - | ||||||||||||||||||
| 62 | if (m_systemStates
| 0-22348 | ||||||||||||||||||
| 63 | index = d->systemIndex; never executed: index = d->systemIndex; | 0 | ||||||||||||||||||
| 64 | if (m_notUsingEngine
| 0-22348 | ||||||||||||||||||
| 65 | - | |||||||||||||||||||
| 66 | m_system->moveGroups(d, m_goalIdx); | - | ||||||||||||||||||
| 67 | } never executed: else if (engine->curState(index) != m_goalIdxend of block
| 0-21148 | ||||||||||||||||||
| 68 | engine->setGoal(m_goalIdx, index, m_jump); | - | ||||||||||||||||||
| 69 | return executed 1200 times by 1 test: true;return true;Executed by:
executed 1200 times by 1 test: return true;Executed by:
| 1200 | ||||||||||||||||||
| 70 | } | - | ||||||||||||||||||
| 71 | return executed 21148 times by 1 test: false;return false;Executed by:
executed 21148 times by 1 test: return false;Executed by:
| 21148 | ||||||||||||||||||
| 72 | } | - | ||||||||||||||||||
| 73 | - | |||||||||||||||||||
| 74 | - | |||||||||||||||||||
| 75 | - | |||||||||||||||||||
| Switch to Source code | Preprocessed file |