| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/scenegraph/adaptations/software/qsgsoftwareglyphnode.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||
| 2 | - | |||||||
| 3 | - | |||||||
| 4 | QSGSoftwareGlyphNode::QSGSoftwareGlyphNode() | - | ||||||
| 5 | : m_geometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 0) | - | ||||||
| 6 | , m_style(QQuickText::Normal) | - | ||||||
| 7 | { | - | ||||||
| 8 | setMaterial((QSGMaterial*)1); | - | ||||||
| 9 | setGeometry(&m_geometry); | - | ||||||
| 10 | } never executed: end of block | 0 | ||||||
| 11 | - | |||||||
| 12 | - | |||||||
| 13 | void QSGSoftwareGlyphNode::setGlyphs(const QPointF &position, const QGlyphRun &glyphs) | - | ||||||
| 14 | { | - | ||||||
| 15 | m_position = position; | - | ||||||
| 16 | m_glyphRun = glyphs; | - | ||||||
| 17 | m_bounding_rect = glyphs.boundingRect().translated(m_position - QPointF(0.0, glyphs.rawFont().ascent())); | - | ||||||
| 18 | } never executed: end of block | 0 | ||||||
| 19 | - | |||||||
| 20 | void QSGSoftwareGlyphNode::setColor(const QColor &color) | - | ||||||
| 21 | { | - | ||||||
| 22 | m_color = color; | - | ||||||
| 23 | } never executed: end of block | 0 | ||||||
| 24 | - | |||||||
| 25 | void QSGSoftwareGlyphNode::setStyle(QQuickText::TextStyle style) | - | ||||||
| 26 | { | - | ||||||
| 27 | m_style = style; | - | ||||||
| 28 | } never executed: end of block | 0 | ||||||
| 29 | - | |||||||
| 30 | void QSGSoftwareGlyphNode::setStyleColor(const QColor &color) | - | ||||||
| 31 | { | - | ||||||
| 32 | m_styleColor = color; | - | ||||||
| 33 | } never executed: end of block | 0 | ||||||
| 34 | - | |||||||
| 35 | QPointF QSGSoftwareGlyphNode::baseLine() const | - | ||||||
| 36 | { | - | ||||||
| 37 | return never executed: QPointF();return QPointF();never executed: return QPointF(); | 0 | ||||||
| 38 | } | - | ||||||
| 39 | - | |||||||
| 40 | void QSGSoftwareGlyphNode::setPreferredAntialiasingMode(QSGGlyphNode::AntialiasingMode) | - | ||||||
| 41 | { | - | ||||||
| 42 | } | - | ||||||
| 43 | - | |||||||
| 44 | void QSGSoftwareGlyphNode::update() | - | ||||||
| 45 | { | - | ||||||
| 46 | } | - | ||||||
| 47 | - | |||||||
| 48 | void QSGSoftwareGlyphNode::paint(QPainter *painter) | - | ||||||
| 49 | { | - | ||||||
| 50 | painter->setBrush(QBrush()); | - | ||||||
| 51 | QPointF pos = m_position - QPointF(0, m_glyphRun.rawFont().ascent()); | - | ||||||
| 52 | - | |||||||
| 53 | qreal offset = 1.0; | - | ||||||
| 54 | if (painter->device()->devicePixelRatio() != 0
| 0 | ||||||
| 55 | offset = 1.0 / painter->device()->devicePixelRatio(); never executed: offset = 1.0 / painter->device()->devicePixelRatio(); | 0 | ||||||
| 56 | - | |||||||
| 57 | switch (m_style) { | - | ||||||
| 58 | case never executed: QQuickText::Normal:case QQuickText::Normal:never executed: break;case QQuickText::Normal:never executed: break; | 0 | ||||||
| 59 | case never executed: QQuickText::Outline:case QQuickText::Outline:never executed: case QQuickText::Outline: | 0 | ||||||
| 60 | painter->setPen(m_styleColor); | - | ||||||
| 61 | painter->drawGlyphRun(pos + QPointF(0, offset), m_glyphRun); | - | ||||||
| 62 | painter->drawGlyphRun(pos + QPointF(0, -offset), m_glyphRun); | - | ||||||
| 63 | painter->drawGlyphRun(pos + QPointF(offset, 0), m_glyphRun); | - | ||||||
| 64 | painter->drawGlyphRun(pos + QPointF(-offset, 0), m_glyphRun); | - | ||||||
| 65 | break; never executed: break; | 0 | ||||||
| 66 | case never executed: QQuickText::Raised:case QQuickText::Raised:never executed: case QQuickText::Raised: | 0 | ||||||
| 67 | painter->setPen(m_styleColor); | - | ||||||
| 68 | painter->drawGlyphRun(pos + QPointF(0, offset), m_glyphRun); | - | ||||||
| 69 | break; never executed: break; | 0 | ||||||
| 70 | case never executed: QQuickText::Sunken:case QQuickText::Sunken:never executed: case QQuickText::Sunken: | 0 | ||||||
| 71 | painter->setPen(m_styleColor); | - | ||||||
| 72 | painter->drawGlyphRun(pos + QPointF(0, -offset), m_glyphRun); | - | ||||||
| 73 | break; never executed: break; | 0 | ||||||
| 74 | } | - | ||||||
| 75 | - | |||||||
| 76 | painter->setPen(m_color); | - | ||||||
| 77 | painter->drawGlyphRun(pos, m_glyphRun); | - | ||||||
| 78 | } never executed: end of block | 0 | ||||||
| 79 | - | |||||||
| 80 | - | |||||||
| Switch to Source code | Preprocessed file |