OpenCoverage

qquickclipnode.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickclipnode.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3QQuickDefaultClipNode::QQuickDefaultClipNode(const QRectF &rect)-
4 : m_rect(rect)-
5 , m_radius(0)-
6 , m_dirty_geometry(true)-
7 , m_geometry(QSGGeometry::defaultAttributes_Point2D(), 0)-
8{-
9 (void)m_reserved;;-
10 setGeometry(&m_geometry);-
11 setIsRectangular(true);-
12}
executed 386 times by 9 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquicktableview
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_rendernode
  • tst_scenegraph
386
13-
14void QQuickDefaultClipNode::setRect(const QRectF &rect)-
15{-
16 m_rect = rect;-
17 m_dirty_geometry = true;-
18}
executed 330 times by 9 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquicktableview
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_rendernode
  • tst_scenegraph
330
19-
20void QQuickDefaultClipNode::setRadius(qreal radius)-
21{-
22 m_radius = radius;-
23 m_dirty_geometry = true;-
24 setIsRectangular(radius == 0);-
25}
never executed: end of block
0
26-
27void QQuickDefaultClipNode::update()-
28{-
29 if (m_dirty_geometry
m_dirty_geometryDescription
TRUEevaluated 592 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquicktableview
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_rendernode
  • tst_scenegraph
FALSEnever evaluated
) {
0-592
30 updateGeometry();-
31 m_dirty_geometry = false;-
32 }
executed 592 times by 9 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquicktableview
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_rendernode
  • tst_scenegraph
592
33}
executed 592 times by 9 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquicktableview
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_rendernode
  • tst_scenegraph
592
34-
35void QQuickDefaultClipNode::updateGeometry()-
36{-
37 QSGGeometry *g = geometry();-
38-
39 if (qFuzzyIsNull(m_radius)
qFuzzyIsNull(m_radius)Description
TRUEevaluated 592 times by 9 tests
Evaluated by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquicktableview
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_rendernode
  • tst_scenegraph
FALSEnever evaluated
) {
0-592
40 g->allocate(4);-
41 QSGGeometry::updateRectGeometry(g, m_rect);-
42-
43 }
executed 592 times by 9 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquicktableview
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_rendernode
  • tst_scenegraph
else {
592
44 int vertexCount = 0;-
45-
46-
47 qreal radius = qMin(qMin(m_rect.width() / 2, m_rect.height() / 2), m_radius);-
48 QRectF rect = m_rect;-
49 rect.adjust(radius, radius, -radius, -radius);-
50-
51 int segments = qMin(30, qCeil(radius));-
52-
53 g->allocate((segments + 1) * 4);-
54-
55 QVector2D *vertices = (QVector2D *)g->vertexData();-
56-
57 for (int part = 0; part < 2
part < 2Description
TRUEnever evaluated
FALSEnever evaluated
; ++part) {
0
58 for (int i = 0; i <= segments
i <= segmentsDescription
TRUEnever evaluated
FALSEnever evaluated
; ++i) {
0
59-
60 qreal angle = qreal(0.5 * -
61 3.14159265358979323846-
62 ) * (part + i / qreal(segments));-
63 qreal s = qFastSin(angle);-
64 qreal c = qFastCos(angle);-
65 qreal y = (part
partDescription
TRUEnever evaluated
FALSEnever evaluated
? rect.bottom() : rect.top()) - radius * c;
0
66 qreal lx = rect.left() - radius * s;-
67 qreal rx = rect.right() + radius * s;-
68-
69 vertices[vertexCount++] = QVector2D(rx, y);-
70 vertices[vertexCount++] = QVector2D(lx, y);-
71 }
never executed: end of block
0
72 }
never executed: end of block
0
73-
74 }
never executed: end of block
0
75 setClipRect(m_rect);-
76 markDirty(DirtyGeometry);-
77}
executed 592 times by 9 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquicktableview
  • tst_qquicktextedit
  • tst_qquicktextinput
  • tst_rendernode
  • tst_scenegraph
592
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0