OpenCoverage

qsgsoftwarerenderer.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderer.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5const QLoggingCategory &lcRenderer() { static const QLoggingCategory category("qt.scenegraph.softwarecontext.renderer"); return
executed 24 times by 1 test: return category;
Executed by:
  • tst_qquickshape
category;
executed 24 times by 1 test: return category;
Executed by:
  • tst_qquickshape
}
24
6-
7-
8-
9QSGSoftwareRenderer::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:
  • tst_qquickshape
8
15-
16QSGSoftwareRenderer::~QSGSoftwareRenderer()-
17{-
18}-
19-
20void QSGSoftwareRenderer::setCurrentPaintDevice(QPaintDevice *device)-
21{-
22 m_paintDevice = device;-
23 m_backingStore = nullptr;-
24}
never executed: end of block
0
25-
26QPaintDevice *QSGSoftwareRenderer::currentPaintDevice() const-
27{-
28 return
never executed: return m_paintDevice;
m_paintDevice;
never executed: return m_paintDevice;
0
29}-
30-
31void 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:
  • tst_qquickshape
24
36-
37QRegion QSGSoftwareRenderer::flushRegion() const-
38{-
39 return
never executed: return m_flushRegion;
m_flushRegion;
never executed: return m_flushRegion;
0
40}-
41-
42void 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:
  • tst_qquickshape
24
51-
52void QSGSoftwareRenderer::render()-
53{-
54 if (!m_paintDevice
!m_paintDeviceDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquickshape
FALSEnever evaluated
&& !m_backingStore
!m_backingStoreDescription
TRUEnever evaluated
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquickshape
)
0-24
55 return;
never executed: return;
0
56-
57-
58 if (m_backingStore
m_backingStoreDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquickshape
FALSEnever evaluated
) {
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:
  • tst_qquickshape
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
m_backingStore != nullptrDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquickshape
FALSEnever evaluated
) {
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:
  • tst_qquickshape
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
m_backingStore != nullptrDescription
TRUEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquickshape
FALSEnever evaluated
)
0-24
105 m_backingStore->endPaint();
executed 24 times by 1 test: m_backingStore->endPaint();
Executed by:
  • tst_qquickshape
24
106-
107 rc->m_activePainter = prevPainter;-
108 for (bool qt_category_enabled = lcRenderer().isDebugEnabled(); qt_category_enabled
qt_category_enabledDescription
TRUEnever evaluated
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquickshape
; qt_category_enabled = false) QMessageLogger(__FILE__, 164, __PRETTY_FUNCTION__, lcRenderer().categoryName()).debug() << "render" << m_flushRegion << buildRenderListTime << optimizeRenderListTime << renderTime;
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:
  • tst_qquickshape
24
110-
111-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0