Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquicksprite.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | static const int unsetDuration = -2; | - | ||||||
4 | QQuickSprite::QQuickSprite(QObject *parent) | - | ||||||
5 | : QQuickStochasticState(parent) | - | ||||||
6 | , m_generatedCount(0) | - | ||||||
7 | , m_framesPerRow(0) | - | ||||||
8 | , m_rowY(0) | - | ||||||
9 | , m_rowStartX(0) | - | ||||||
10 | , m_reverse(false) | - | ||||||
11 | , m_frameHeight(0) | - | ||||||
12 | , m_frameWidth(0) | - | ||||||
13 | , m_frames(1) | - | ||||||
14 | , m_frameX(0) | - | ||||||
15 | , m_frameY(0) | - | ||||||
16 | , m_frameRate(unsetDuration) | - | ||||||
17 | , m_frameRateVariation(0) | - | ||||||
18 | , m_frameDuration(unsetDuration) | - | ||||||
19 | , m_frameDurationVariation(0) | - | ||||||
20 | , m_frameSync(false) | - | ||||||
21 | , m_devicePixelRatio(1.0) | - | ||||||
22 | { | - | ||||||
23 | } executed 90 times by 5 tests: end of block Executed by:
| 90 | ||||||
24 | - | |||||||
25 | - | |||||||
26 | QQuickSprite::~QQuickSprite() | - | ||||||
27 | { | - | ||||||
28 | } | - | ||||||
29 | - | |||||||
30 | int QQuickSprite::variedDuration() const | - | ||||||
31 | { | - | ||||||
32 | if (m_frameSync
| 38-3696 | ||||||
33 | return executed 38 times by 2 tests: 0;return 0; Executed by:
executed 38 times by 2 tests: return 0; Executed by:
| 38 | ||||||
34 | - | |||||||
35 | if (m_frameRate != unsetDuration
| 0-3696 | ||||||
36 | qreal fpms = (m_frameRate | - | ||||||
37 | + (m_frameRateVariation * QRandomGenerator::global()->generateDouble() * 2) | - | ||||||
38 | - m_frameRateVariation) / 1000.0; | - | ||||||
39 | return never executed: qMax(qreal(0.0) , m_frames / fpms);return qMax(qreal(0.0) , m_frames / fpms); never executed: return qMax(qreal(0.0) , m_frames / fpms); | 0 | ||||||
40 | } else if (m_frameDuration != unsetDuration
| 8-3688 | ||||||
41 | int mspf = m_frameDuration | - | ||||||
42 | + (m_frameDurationVariation * QRandomGenerator::global()->generateDouble() * 2) | - | ||||||
43 | - m_frameDurationVariation; | - | ||||||
44 | return executed 3688 times by 4 tests: qMax(0, m_frames * mspf);return qMax(0, m_frames * mspf); Executed by:
executed 3688 times by 4 tests: return qMax(0, m_frames * mspf); Executed by:
| 3688 | ||||||
45 | } else if (duration() >= 0
| 0-8 | ||||||
46 | QMessageLogger(__FILE__, 251, __PRETTY_FUNCTION__).warning() << "Sprite::duration is changing meaning to the full animation duration."; | - | ||||||
47 | QMessageLogger(__FILE__, 252, __PRETTY_FUNCTION__).warning() << "Use Sprite::frameDuration for the old meaning, of per frame duration."; | - | ||||||
48 | QMessageLogger(__FILE__, 253, __PRETTY_FUNCTION__).warning() << "As an interim measure, duration/durationVariation means the same as frameDuration/frameDurationVariation, and you'll get this warning spewed out everywhere to motivate you."; | - | ||||||
49 | - | |||||||
50 | return never executed: QQuickStochasticState::variedDuration() * m_frames;return QQuickStochasticState::variedDuration() * m_frames; never executed: return QQuickStochasticState::variedDuration() * m_frames; | 0 | ||||||
51 | } | - | ||||||
52 | return executed 8 times by 2 tests: 1000;return 1000; Executed by:
executed 8 times by 2 tests: return 1000; Executed by:
| 8 | ||||||
53 | } | - | ||||||
54 | - | |||||||
55 | void QQuickSprite::startImageLoading() | - | ||||||
56 | { | - | ||||||
57 | m_pix.clear(this); | - | ||||||
58 | if (!m_source.isEmpty()
| 0-92 | ||||||
59 | QQmlEngine *e = qmlEngine(this); | - | ||||||
60 | if (!e
| 20-72 | ||||||
61 | e = qmlEngine(parent()); | - | ||||||
62 | if (!e
| 0-20 | ||||||
63 | QMessageLogger(__FILE__, 268, __PRETTY_FUNCTION__).warning() << "QQuickSprite: Cannot find QQmlEngine - this class is only for use in QML and may not work"; never executed: QMessageLogger(__FILE__, 268, __PRETTY_FUNCTION__).warning() << "QQuickSprite: Cannot find QQmlEngine - this class is only for use in QML and may not work"; | 0 | ||||||
64 | } executed 20 times by 1 test: end of block Executed by:
| 20 | ||||||
65 | QUrl loadUrl = m_source; | - | ||||||
66 | QQuickImageBase::resolve2xLocalFile(m_source, m_devicePixelRatio, &loadUrl, &m_devicePixelRatio); | - | ||||||
67 | - | |||||||
68 | m_pix.load(e, loadUrl); | - | ||||||
69 | } executed 92 times by 5 tests: end of block Executed by:
| 92 | ||||||
70 | } executed 92 times by 5 tests: end of block Executed by:
| 92 | ||||||
71 | - | |||||||
72 | - | |||||||
73 | - | |||||||
Switch to Source code | Preprocessed file |