Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderer.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||
2 | - | |||||||||||||
3 | - | |||||||||||||
4 | - | |||||||||||||
5 | const QLoggingCategory &lcRenderer() { static const QLoggingCategory category("qt.scenegraph.softwarecontext.renderer"); return executed 24 times by 1 test: category;return category; Executed by:
executed 24 times by 1 test: }return category; Executed by:
| 24 | ||||||||||||
6 | - | |||||||||||||
7 | - | |||||||||||||
8 | - | |||||||||||||
9 | QSGSoftwareRenderer::QSGSoftwareRenderer(QSGRenderContext *context) | - | ||||||||||||
10 | : QSGAbstractSoftwareRenderer(context) | - | ||||||||||||
11 | , m_paintDevice(nullptr) | - | ||||||||||||
12 | , m_backingStore(nullptr) | - | ||||||||||||
13 | { | - | ||||||||||||
14 | } executed 8 times by 1 test: end of block Executed by:
| 8 | ||||||||||||
15 | - | |||||||||||||
16 | QSGSoftwareRenderer::~QSGSoftwareRenderer() | - | ||||||||||||
17 | { | - | ||||||||||||
18 | } | - | ||||||||||||
19 | - | |||||||||||||
20 | void QSGSoftwareRenderer::setCurrentPaintDevice(QPaintDevice *device) | - | ||||||||||||
21 | { | - | ||||||||||||
22 | m_paintDevice = device; | - | ||||||||||||
23 | m_backingStore = nullptr; | - | ||||||||||||
24 | } never executed: end of block | 0 | ||||||||||||
25 | - | |||||||||||||
26 | QPaintDevice *QSGSoftwareRenderer::currentPaintDevice() const | - | ||||||||||||
27 | { | - | ||||||||||||
28 | return never executed: m_paintDevice;return m_paintDevice; never executed: return m_paintDevice; | 0 | ||||||||||||
29 | } | - | ||||||||||||
30 | - | |||||||||||||
31 | void QSGSoftwareRenderer::setBackingStore(QBackingStore *backingStore) | - | ||||||||||||
32 | { | - | ||||||||||||
33 | m_backingStore = backingStore; | - | ||||||||||||
34 | m_paintDevice = nullptr; | - | ||||||||||||
35 | } executed 24 times by 1 test: end of block Executed by:
| 24 | ||||||||||||
36 | - | |||||||||||||
37 | QRegion QSGSoftwareRenderer::flushRegion() const | - | ||||||||||||
38 | { | - | ||||||||||||
39 | return never executed: m_flushRegion;return m_flushRegion; never executed: return m_flushRegion; | 0 | ||||||||||||
40 | } | - | ||||||||||||
41 | - | |||||||||||||
42 | void QSGSoftwareRenderer::renderScene(uint) | - | ||||||||||||
43 | { | - | ||||||||||||
44 | class B : public QSGBindable | - | ||||||||||||
45 | { | - | ||||||||||||
46 | public: | - | ||||||||||||
47 | void bind() const override { } | - | ||||||||||||
48 | } bindable; | - | ||||||||||||
49 | QSGRenderer::renderScene(bindable); | - | ||||||||||||
50 | } executed 24 times by 1 test: end of block Executed by:
| 24 | ||||||||||||
51 | - | |||||||||||||
52 | void QSGSoftwareRenderer::render() | - | ||||||||||||
53 | { | - | ||||||||||||
54 | if (!m_paintDevice
| 0-24 | ||||||||||||
55 | return; never executed: return; | 0 | ||||||||||||
56 | - | |||||||||||||
57 | - | |||||||||||||
58 | if (m_backingStore
| 0-24 | ||||||||||||
59 | - | |||||||||||||
60 | - | |||||||||||||
61 | m_backingStore->beginPaint(QRegion()); | - | ||||||||||||
62 | m_paintDevice = m_backingStore->paintDevice(); | - | ||||||||||||
63 | m_backingStore->endPaint(); | - | ||||||||||||
64 | } executed 24 times by 1 test: end of block Executed by:
| 24 | ||||||||||||
65 | - | |||||||||||||
66 | QElapsedTimer renderTimer; | - | ||||||||||||
67 | - | |||||||||||||
68 | setBackgroundColor(clearColor()); | - | ||||||||||||
69 | setBackgroundRect(QRect(0, 0, | - | ||||||||||||
70 | m_paintDevice->width() / m_paintDevice->devicePixelRatio(), | - | ||||||||||||
71 | m_paintDevice->height() / m_paintDevice->devicePixelRatio())); | - | ||||||||||||
72 | - | |||||||||||||
73 | - | |||||||||||||
74 | - | |||||||||||||
75 | - | |||||||||||||
76 | - | |||||||||||||
77 | - | |||||||||||||
78 | - | |||||||||||||
79 | renderTimer.start(); | - | ||||||||||||
80 | buildRenderList(); | - | ||||||||||||
81 | qint64 buildRenderListTime = renderTimer.restart(); | - | ||||||||||||
82 | const QRegion updateRegion = optimizeRenderList(); | - | ||||||||||||
83 | qint64 optimizeRenderListTime = renderTimer.restart(); | - | ||||||||||||
84 | - | |||||||||||||
85 | - | |||||||||||||
86 | if (m_backingStore != nullptr
| 0-24 | ||||||||||||
87 | m_backingStore->beginPaint(updateRegion); | - | ||||||||||||
88 | - | |||||||||||||
89 | - | |||||||||||||
90 | m_paintDevice = m_backingStore->paintDevice(); | - | ||||||||||||
91 | } executed 24 times by 1 test: end of block Executed by:
| 24 | ||||||||||||
92 | - | |||||||||||||
93 | QPainter painter(m_paintDevice); | - | ||||||||||||
94 | painter.setRenderHint(QPainter::Antialiasing); | - | ||||||||||||
95 | auto rc = static_cast<QSGSoftwareRenderContext *>(context()); | - | ||||||||||||
96 | QPainter *prevPainter = rc->m_activePainter; | - | ||||||||||||
97 | rc->m_activePainter = &painter; | - | ||||||||||||
98 | - | |||||||||||||
99 | - | |||||||||||||
100 | m_flushRegion = renderNodes(&painter); | - | ||||||||||||
101 | qint64 renderTime = renderTimer.elapsed(); | - | ||||||||||||
102 | - | |||||||||||||
103 | painter.end(); | - | ||||||||||||
104 | if (m_backingStore != nullptr
| 0-24 | ||||||||||||
105 | m_backingStore->endPaint(); executed 24 times by 1 test: m_backingStore->endPaint(); Executed by:
| 24 | ||||||||||||
106 | - | |||||||||||||
107 | rc->m_activePainter = prevPainter; | - | ||||||||||||
108 | for (bool qt_category_enabled = lcRenderer().isDebugEnabled(); qt_category_enabled
never executed: QMessageLogger(__FILE__, 164, __PRETTY_FUNCTION__, lcRenderer().categoryName()).debug() << "render" << m_flushRegion << buildRenderListTime << optimizeRenderListTime << renderTime; | 0-24 | ||||||||||||
109 | } executed 24 times by 1 test: end of block Executed by:
| 24 | ||||||||||||
110 | - | |||||||||||||
111 | - | |||||||||||||
Switch to Source code | Preprocessed file |