Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/scenegraph/util/qsgdefaultrectanglenode.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | - | |||||||
3 | - | |||||||
4 | - | |||||||
5 | - | |||||||
6 | - | |||||||
7 | QSGDefaultRectangleNode::QSGDefaultRectangleNode() | - | ||||||
8 | : m_geometry(QSGGeometry::defaultAttributes_ColoredPoint2D(), 4) | - | ||||||
9 | { | - | ||||||
10 | QSGGeometry::updateColoredRectGeometry(&m_geometry, QRectF()); | - | ||||||
11 | setMaterial(&m_material); | - | ||||||
12 | setGeometry(&m_geometry); | - | ||||||
13 | setColor(QColor(255, 255, 255)); | - | ||||||
14 | - | |||||||
15 | qsgnode_set_description(this, QLatin1String("rectangle")); | - | ||||||
16 | - | |||||||
17 | } never executed: end of block | 0 | ||||||
18 | - | |||||||
19 | void QSGDefaultRectangleNode::setRect(const QRectF &rect) | - | ||||||
20 | { | - | ||||||
21 | QSGGeometry::updateColoredRectGeometry(&m_geometry, rect); | - | ||||||
22 | markDirty(QSGNode::DirtyGeometry); | - | ||||||
23 | } never executed: end of block | 0 | ||||||
24 | - | |||||||
25 | QRectF QSGDefaultRectangleNode::rect() const | - | ||||||
26 | { | - | ||||||
27 | const QSGGeometry::ColoredPoint2D *pts = m_geometry.vertexDataAsColoredPoint2D(); | - | ||||||
28 | return never executed: QRectF(pts[0].x,return QRectF(pts[0].x, pts[0].y, pts[3].x - pts[0].x, pts[3].y - pts[0].y); never executed: return QRectF(pts[0].x, pts[0].y, pts[3].x - pts[0].x, pts[3].y - pts[0].y); | 0 | ||||||
29 | pts[0].y, never executed: return QRectF(pts[0].x, pts[0].y, pts[3].x - pts[0].x, pts[3].y - pts[0].y); | 0 | ||||||
30 | pts[3].x - pts[0].x, never executed: return QRectF(pts[0].x, pts[0].y, pts[3].x - pts[0].x, pts[3].y - pts[0].y); | 0 | ||||||
31 | pts[3].y - pts[0].y); never executed: return QRectF(pts[0].x, pts[0].y, pts[3].x - pts[0].x, pts[3].y - pts[0].y); | 0 | ||||||
32 | } | - | ||||||
33 | - | |||||||
34 | void QSGDefaultRectangleNode::setColor(const QColor &color) | - | ||||||
35 | { | - | ||||||
36 | if (color != m_color
| 0 | ||||||
37 | m_color = color; | - | ||||||
38 | QSGGeometry::ColoredPoint2D *pts = m_geometry.vertexDataAsColoredPoint2D(); | - | ||||||
39 | for (int i = 0; i < 4
| 0 | ||||||
40 | pts[i].r = uchar(qRound(m_color.redF() * m_color.alphaF() * 255)); | - | ||||||
41 | pts[i].g = uchar(qRound(m_color.greenF() * m_color.alphaF() * 255)); | - | ||||||
42 | pts[i].b = uchar(qRound(m_color.blueF() * m_color.alphaF() * 255)); | - | ||||||
43 | pts[i].a = uchar(qRound(m_color.alphaF() * 255)); | - | ||||||
44 | } never executed: end of block | 0 | ||||||
45 | markDirty(QSGNode::DirtyGeometry); | - | ||||||
46 | } never executed: end of block | 0 | ||||||
47 | } never executed: end of block | 0 | ||||||
48 | - | |||||||
49 | QColor QSGDefaultRectangleNode::color() const | - | ||||||
50 | { | - | ||||||
51 | return never executed: m_color;return m_color; never executed: return m_color; | 0 | ||||||
52 | } | - | ||||||
53 | - | |||||||
54 | - | |||||||
Switch to Source code | Preprocessed file |