OpenCoverage

qsgsoftwarerenderablenodeupdater.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7QSGSoftwareRenderableNodeUpdater::QSGSoftwareRenderableNodeUpdater(QSGAbstractSoftwareRenderer *renderer)-
8 : m_renderer(renderer)-
9{-
10 m_opacityState.push(1.0f);-
11-
12 m_clipState.push(QRegion());-
13 m_hasClip = false;-
14 m_transformState.push(QTransform());-
15}
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquickshape
8
16-
17QSGSoftwareRenderableNodeUpdater::~QSGSoftwareRenderableNodeUpdater()-
18{-
19-
20}-
21-
22bool QSGSoftwareRenderableNodeUpdater::visit(QSGTransformNode *node)-
23{-
24 m_transformState.push(node->matrix().toTransform() * m_transformState.top());-
25 m_stateMap[node] = currentState(node);-
26 return
executed 40 times by 1 test: return true;
Executed by:
  • tst_qquickshape
true;
executed 40 times by 1 test: return true;
Executed by:
  • tst_qquickshape
40
27}-
28-
29void QSGSoftwareRenderableNodeUpdater::endVisit(QSGTransformNode *)-
30{-
31 m_transformState.pop();-
32}
executed 40 times by 1 test: end of block
Executed by:
  • tst_qquickshape
40
33-
34bool QSGSoftwareRenderableNodeUpdater::visit(QSGClipNode *node)-
35{-
36-
37 if (m_clipState.count() == 0
m_clipState.count() == 0Description
TRUEnever evaluated
FALSEnever evaluated
|| (m_clipState.count() == 1
m_clipState.count() == 1Description
TRUEnever evaluated
FALSEnever evaluated
&& m_clipState.top().isNull()
m_clipState.top().isNull()Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0
38 m_clipState.push(m_transformState.top().map(QRegion(node->clipRect().toRect())));-
39 m_hasClip = true;-
40 }
never executed: end of block
else {
0
41 const QRegion transformedClipRect = m_transformState.top().map(QRegion(node->clipRect().toRect()));-
42 m_clipState.push(transformedClipRect.intersected(m_clipState.top()));-
43 }
never executed: end of block
0
44 m_stateMap[node] = currentState(node);-
45 return
never executed: return true;
true;
never executed: return true;
0
46}-
47-
48void QSGSoftwareRenderableNodeUpdater::endVisit(QSGClipNode *)-
49{-
50 m_clipState.pop();-
51 if (m_clipState.count() == 0
m_clipState.count() == 0Description
TRUEnever evaluated
FALSEnever evaluated
|| (m_clipState.count() == 1
m_clipState.count() == 1Description
TRUEnever evaluated
FALSEnever evaluated
&& m_clipState.top().isNull()
m_clipState.top().isNull()Description
TRUEnever evaluated
FALSEnever evaluated
))
0
52 m_hasClip = false;
never executed: m_hasClip = false;
0
53}
never executed: end of block
0
54-
55bool QSGSoftwareRenderableNodeUpdater::visit(QSGGeometryNode *node)-
56{-
57 if (QSGSimpleRectNode *rectNode = dynamic_cast<QSGSimpleRectNode *>(node)
QSGSimpleRectN...tNode *>(node)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
58 return
never executed: return updateRenderableNode(QSGSoftwareRenderableNode::SimpleRect, rectNode);
updateRenderableNode(QSGSoftwareRenderableNode::SimpleRect, rectNode);
never executed: return updateRenderableNode(QSGSoftwareRenderableNode::SimpleRect, rectNode);
0
59 } else if (QSGSimpleTextureNode *tn = dynamic_cast<QSGSimpleTextureNode *>(node)
QSGSimpleTextu...eNode *>(node)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
60 return
never executed: return updateRenderableNode(QSGSoftwareRenderableNode::SimpleTexture, tn);
updateRenderableNode(QSGSoftwareRenderableNode::SimpleTexture, tn);
never executed: return updateRenderableNode(QSGSoftwareRenderableNode::SimpleTexture, tn);
0
61 } else if (QSGNinePatchNode *nn = dynamic_cast<QSGNinePatchNode *>(node)
QSGNinePatchNo...hNode *>(node)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
62 return
never executed: return updateRenderableNode(QSGSoftwareRenderableNode::NinePatch, nn);
updateRenderableNode(QSGSoftwareRenderableNode::NinePatch, nn);
never executed: return updateRenderableNode(QSGSoftwareRenderableNode::NinePatch, nn);
0
63 } else if (QSGRectangleNode *rn = dynamic_cast<QSGRectangleNode *>(node)
QSGRectangleNo...eNode *>(node)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
64 return
never executed: return updateRenderableNode(QSGSoftwareRenderableNode::SimpleRectangle, rn);
updateRenderableNode(QSGSoftwareRenderableNode::SimpleRectangle, rn);
never executed: return updateRenderableNode(QSGSoftwareRenderableNode::SimpleRectangle, rn);
0
65 } else if (QSGImageNode *n = dynamic_cast<QSGImageNode *>(node)
QSGImageNode *...eNode *>(node)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
66 return
never executed: return updateRenderableNode(QSGSoftwareRenderableNode::SimpleImage, n);
updateRenderableNode(QSGSoftwareRenderableNode::SimpleImage, n);
never executed: return updateRenderableNode(QSGSoftwareRenderableNode::SimpleImage, n);
0
67 } else {-
68-
69 return
never executed: return false;
false;
never executed: return false;
0
70 }-
71}-
72-
73void QSGSoftwareRenderableNodeUpdater::endVisit(QSGGeometryNode *)-
74{-
75}-
76-
77bool QSGSoftwareRenderableNodeUpdater::visit(QSGOpacityNode *node)-
78{-
79 m_opacityState.push(m_opacityState.top() * node->opacity());-
80 m_stateMap[node] = currentState(node);-
81 return
never executed: return true;
true;
never executed: return true;
0
82}-
83-
84void QSGSoftwareRenderableNodeUpdater::endVisit(QSGOpacityNode *)-
85{-
86 m_opacityState.pop();-
87}
never executed: end of block
0
88-
89bool QSGSoftwareRenderableNodeUpdater::visit(QSGInternalImageNode *node)-
90{-
91 return
never executed: return updateRenderableNode(QSGSoftwareRenderableNode::Image, node);
updateRenderableNode(QSGSoftwareRenderableNode::Image, node);
never executed: return updateRenderableNode(QSGSoftwareRenderableNode::Image, node);
0
92}-
93-
94void QSGSoftwareRenderableNodeUpdater::endVisit(QSGInternalImageNode *)-
95{-
96}-
97-
98bool QSGSoftwareRenderableNodeUpdater::visit(QSGPainterNode *node)-
99{-
100 return
never executed: return updateRenderableNode(QSGSoftwareRenderableNode::Painter, node);
updateRenderableNode(QSGSoftwareRenderableNode::Painter, node);
never executed: return updateRenderableNode(QSGSoftwareRenderableNode::Painter, node);
0
101}-
102-
103void QSGSoftwareRenderableNodeUpdater::endVisit(QSGPainterNode *)-
104{-
105}-
106-
107bool QSGSoftwareRenderableNodeUpdater::visit(QSGInternalRectangleNode *node)-
108{-
109 return
never executed: return updateRenderableNode(QSGSoftwareRenderableNode::Rectangle, node);
updateRenderableNode(QSGSoftwareRenderableNode::Rectangle, node);
never executed: return updateRenderableNode(QSGSoftwareRenderableNode::Rectangle, node);
0
110}-
111-
112void QSGSoftwareRenderableNodeUpdater::endVisit(QSGInternalRectangleNode *)-
113{-
114}-
115-
116bool QSGSoftwareRenderableNodeUpdater::visit(QSGGlyphNode *node)-
117{-
118 return
never executed: return updateRenderableNode(QSGSoftwareRenderableNode::Glyph, node);
updateRenderableNode(QSGSoftwareRenderableNode::Glyph, node);
never executed: return updateRenderableNode(QSGSoftwareRenderableNode::Glyph, node);
0
119}-
120-
121void QSGSoftwareRenderableNodeUpdater::endVisit(QSGGlyphNode *)-
122{-
123}-
124-
125bool QSGSoftwareRenderableNodeUpdater::visit(QSGRootNode *node)-
126{-
127 m_stateMap[node] = currentState(node);-
128 return
executed 8 times by 1 test: return true;
Executed by:
  • tst_qquickshape
true;
executed 8 times by 1 test: return true;
Executed by:
  • tst_qquickshape
8
129}-
130-
131void QSGSoftwareRenderableNodeUpdater::endVisit(QSGRootNode *)-
132{-
133}-
134-
135-
136bool QSGSoftwareRenderableNodeUpdater::visit(QSGSpriteNode *node)-
137{-
138 return
never executed: return updateRenderableNode(QSGSoftwareRenderableNode::SpriteNode, node);
updateRenderableNode(QSGSoftwareRenderableNode::SpriteNode, node);
never executed: return updateRenderableNode(QSGSoftwareRenderableNode::SpriteNode, node);
0
139}-
140-
141void QSGSoftwareRenderableNodeUpdater::endVisit(QSGSpriteNode *)-
142{-
143-
144}-
145-
146-
147bool QSGSoftwareRenderableNodeUpdater::visit(QSGRenderNode *node)-
148{-
149 return
executed 8 times by 1 test: return updateRenderableNode(QSGSoftwareRenderableNode::RenderNode, node);
Executed by:
  • tst_qquickshape
updateRenderableNode(QSGSoftwareRenderableNode::RenderNode, node);
executed 8 times by 1 test: return updateRenderableNode(QSGSoftwareRenderableNode::RenderNode, node);
Executed by:
  • tst_qquickshape
8
150}-
151-
152void QSGSoftwareRenderableNodeUpdater::endVisit(QSGRenderNode *)-
153{-
154}-
155-
156void QSGSoftwareRenderableNodeUpdater::updateNodes(QSGNode *node, bool isNodeRemoved)-
157{-
158 m_opacityState.clear();-
159 m_clipState.clear();-
160 m_transformState.clear();-
161-
162 auto parentNode = node->parent();-
163-
164-
165 if ((!parentNode
!parentNodeDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickshape
FALSEevaluated 72 times by 1 test
Evaluated by:
  • tst_qquickshape
|| isNodeRemoved
isNodeRemovedDescription
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_qquickshape
FALSEevaluated 40 times by 1 test
Evaluated by:
  • tst_qquickshape
) && m_stateMap.contains(node)
m_stateMap.contains(node)Description
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_qquickshape
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickshape
)
8-72
166 parentNode = m_stateMap[node].parent;
executed 40 times by 1 test: parentNode = m_stateMap[node].parent;
Executed by:
  • tst_qquickshape
40
167-
168-
169 if (parentNode
parentNodeDescription
TRUEevaluated 72 times by 1 test
Evaluated by:
  • tst_qquickshape
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickshape
&& m_stateMap.contains(parentNode)
m_stateMap.con...ns(parentNode)Description
TRUEevaluated 72 times by 1 test
Evaluated by:
  • tst_qquickshape
FALSEnever evaluated
) {
0-72
170 auto state = m_stateMap[parentNode];-
171 m_opacityState.push(state.opacity);-
172 m_transformState.push(state.transform);-
173 m_clipState.push(state.clip);-
174 m_hasClip = state.hasClip;-
175 }
executed 72 times by 1 test: end of block
Executed by:
  • tst_qquickshape
else {
72
176-
177 m_opacityState.push(1.0f);-
178 m_transformState.push(QTransform());-
179 m_clipState.push(QRegion());-
180 m_hasClip = false;-
181 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquickshape
16
182-
183-
184-
185 if (isNodeRemoved
isNodeRemovedDescription
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_qquickshape
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquickshape
) {
40-48
186 m_stateMap.remove(node);-
187 return;
executed 40 times by 1 test: return;
Executed by:
  • tst_qquickshape
40
188 }-
189-
190-
191 switch (node->type()) {-
192 case
never executed: case QSGNode::ClipNodeType:
QSGNode::ClipNodeType:
never executed: case QSGNode::ClipNodeType:
{
0
193 QSGClipNode *c = static_cast<QSGClipNode*>(node);-
194 if (visit(c)
visit(c)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
195 visitChildren(c);
never executed: visitChildren(c);
0
196 endVisit(c);-
197 break;
never executed: break;
0
198 }-
199 case
executed 32 times by 1 test: case QSGNode::TransformNodeType:
Executed by:
  • tst_qquickshape
QSGNode::TransformNodeType:
executed 32 times by 1 test: case QSGNode::TransformNodeType:
Executed by:
  • tst_qquickshape
{
32
200 QSGTransformNode *c = static_cast<QSGTransformNode*>(node);-
201 if (visit(c)
visit(c)Description
TRUEevaluated 32 times by 1 test
Evaluated by:
  • tst_qquickshape
FALSEnever evaluated
)
0-32
202 visitChildren(c);
executed 32 times by 1 test: visitChildren(c);
Executed by:
  • tst_qquickshape
32
203 endVisit(c);-
204 break;
executed 32 times by 1 test: break;
Executed by:
  • tst_qquickshape
32
205 }-
206 case
never executed: case QSGNode::OpacityNodeType:
QSGNode::OpacityNodeType:
never executed: case QSGNode::OpacityNodeType:
{
0
207 QSGOpacityNode *c = static_cast<QSGOpacityNode*>(node);-
208 if (visit(c)
visit(c)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
209 visitChildren(c);
never executed: visitChildren(c);
0
210 endVisit(c);-
211 break;
never executed: break;
0
212 }-
213 case
never executed: case QSGNode::GeometryNodeType:
QSGNode::GeometryNodeType:
never executed: case QSGNode::GeometryNodeType:
{
0
214 if (node->flags() & QSGNode::IsVisitableNode
node->flags() ...sVisitableNodeDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
215 QSGVisitableNode *v = static_cast<QSGVisitableNode*>(node);-
216 v->accept(this);-
217 }
never executed: end of block
else {
0
218 QSGGeometryNode *c = static_cast<QSGGeometryNode*>(node);-
219 if (visit(c)
visit(c)Description
TRUEnever evaluated
FALSEnever evaluated
)
0
220 visitChildren(c);
never executed: visitChildren(c);
0
221 endVisit(c);-
222 }
never executed: end of block
0
223 break;
never executed: break;
0
224 }-
225 case
executed 8 times by 1 test: case QSGNode::RootNodeType:
Executed by:
  • tst_qquickshape
QSGNode::RootNodeType:
executed 8 times by 1 test: case QSGNode::RootNodeType:
Executed by:
  • tst_qquickshape
{
8
226 QSGRootNode *root = static_cast<QSGRootNode*>(node);-
227 if (visit(root)
visit(root)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickshape
FALSEnever evaluated
)
0-8
228 visitChildren(root);
executed 8 times by 1 test: visitChildren(root);
Executed by:
  • tst_qquickshape
8
229 endVisit(root);-
230 break;
executed 8 times by 1 test: break;
Executed by:
  • tst_qquickshape
8
231 }-
232 case
never executed: case QSGNode::BasicNodeType:
QSGNode::BasicNodeType:
never executed: case QSGNode::BasicNodeType:
{
0
233 visitChildren(node);-
234 break;
never executed: break;
0
235 }-
236 case
executed 8 times by 1 test: case QSGNode::RenderNodeType:
Executed by:
  • tst_qquickshape
QSGNode::RenderNodeType:
executed 8 times by 1 test: case QSGNode::RenderNodeType:
Executed by:
  • tst_qquickshape
{
8
237 QSGRenderNode *r = static_cast<QSGRenderNode*>(node);-
238 if (visit(r)
visit(r)Description
TRUEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickshape
FALSEnever evaluated
)
0-8
239 visitChildren(r);
executed 8 times by 1 test: visitChildren(r);
Executed by:
  • tst_qquickshape
8
240 endVisit(r);-
241 break;
executed 8 times by 1 test: break;
Executed by:
  • tst_qquickshape
8
242 }-
243 default
never executed: default:
:
never executed: default:
0
244 do { ((false) ? static_cast<void>(0) : qt_assert_x("Q_UNREACHABLE()", "Q_UNREACHABLE was reached", __FILE__, 293)); __builtin_unreachable(); } while (false);-
245 break;
never executed: break;
0
246 }-
247}-
248-
249QSGSoftwareRenderableNodeUpdater::NodeState QSGSoftwareRenderableNodeUpdater::currentState(QSGNode *node) const-
250{-
251 NodeState state;-
252 state.opacity = m_opacityState.top();-
253 state.clip = m_clipState.top();-
254 state.hasClip = m_hasClip;-
255 state.transform = m_transformState.top();-
256 state.parent = node->parent();-
257 return
executed 56 times by 1 test: return state;
Executed by:
  • tst_qquickshape
state;
executed 56 times by 1 test: return state;
Executed by:
  • tst_qquickshape
56
258}-
259-
260-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0