| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/context2d/qquickcontext2dtile.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | - | |||||||||||||
| 5 | - | |||||||||||||
| 6 | QQuickContext2DTile::QQuickContext2DTile() | - | ||||||||||||
| 7 | : m_dirty(true) | - | ||||||||||||
| 8 | , m_rect(QRect(0, 0, 1, 1)) | - | ||||||||||||
| 9 | , m_device(nullptr) | - | ||||||||||||
| 10 | { | - | ||||||||||||
| 11 | } never executed: end of block | 0 | ||||||||||||
| 12 | - | |||||||||||||
| 13 | QQuickContext2DTile::~QQuickContext2DTile() | - | ||||||||||||
| 14 | { | - | ||||||||||||
| 15 | if (m_painter.isActive()
| 0 | ||||||||||||
| 16 | m_painter.end(); never executed: m_painter.end(); | 0 | ||||||||||||
| 17 | } never executed: end of block | 0 | ||||||||||||
| 18 | - | |||||||||||||
| 19 | QPainter* QQuickContext2DTile::createPainter(bool smooth, bool antialiasing) | - | ||||||||||||
| 20 | { | - | ||||||||||||
| 21 | if (m_painter.isActive()
| 0 | ||||||||||||
| 22 | m_painter.end(); never executed: m_painter.end(); | 0 | ||||||||||||
| 23 | - | |||||||||||||
| 24 | aboutToDraw(); | - | ||||||||||||
| 25 | if (m_device
| 0 | ||||||||||||
| 26 | m_painter.begin(m_device); | - | ||||||||||||
| 27 | m_painter.resetTransform(); | - | ||||||||||||
| 28 | m_painter.setCompositionMode(QPainter::CompositionMode_Source); | - | ||||||||||||
| 29 | if (antialiasing
| 0 | ||||||||||||
| 30 | m_painter.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing, true); never executed: m_painter.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing, true); | 0 | ||||||||||||
| 31 | else | - | ||||||||||||
| 32 | m_painter.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing, false); never executed: m_painter.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing, false); | 0 | ||||||||||||
| 33 | - | |||||||||||||
| 34 | if (smooth
| 0 | ||||||||||||
| 35 | m_painter.setRenderHint(QPainter::SmoothPixmapTransform, true); never executed: m_painter.setRenderHint(QPainter::SmoothPixmapTransform, true); | 0 | ||||||||||||
| 36 | else | - | ||||||||||||
| 37 | m_painter.setRenderHint(QPainter::SmoothPixmapTransform, false); never executed: m_painter.setRenderHint(QPainter::SmoothPixmapTransform, false); | 0 | ||||||||||||
| 38 | - | |||||||||||||
| 39 | m_painter.setCompositionMode(QPainter::CompositionMode_SourceOver); | - | ||||||||||||
| 40 | m_painter.translate(-m_rect.left(), -m_rect.top()); | - | ||||||||||||
| 41 | m_painter.setClipRect(m_rect); | - | ||||||||||||
| 42 | m_painter.setClipping(false); | - | ||||||||||||
| 43 | return never executed: &m_painter;return &m_painter;never executed: return &m_painter; | 0 | ||||||||||||
| 44 | } | - | ||||||||||||
| 45 | - | |||||||||||||
| 46 | return never executed: nullptr;return nullptr;never executed: return nullptr; | 0 | ||||||||||||
| 47 | } | - | ||||||||||||
| 48 | - | |||||||||||||
| 49 | QQuickContext2DFBOTile::QQuickContext2DFBOTile() | - | ||||||||||||
| 50 | : QQuickContext2DTile() | - | ||||||||||||
| 51 | , m_fbo(nullptr) | - | ||||||||||||
| 52 | { | - | ||||||||||||
| 53 | } never executed: end of block | 0 | ||||||||||||
| 54 | - | |||||||||||||
| 55 | - | |||||||||||||
| 56 | QQuickContext2DFBOTile::~QQuickContext2DFBOTile() | - | ||||||||||||
| 57 | { | - | ||||||||||||
| 58 | if (m_fbo
| 0 | ||||||||||||
| 59 | m_fbo->release(); never executed: m_fbo->release(); | 0 | ||||||||||||
| 60 | delete m_fbo; | - | ||||||||||||
| 61 | } never executed: end of block | 0 | ||||||||||||
| 62 | - | |||||||||||||
| 63 | void QQuickContext2DFBOTile::aboutToDraw() | - | ||||||||||||
| 64 | { | - | ||||||||||||
| 65 | m_fbo->bind(); | - | ||||||||||||
| 66 | if (!m_device
| 0 | ||||||||||||
| 67 | QOpenGLPaintDevice *gl_device = new QOpenGLPaintDevice(rect().size()); | - | ||||||||||||
| 68 | m_device = gl_device; | - | ||||||||||||
| 69 | QPainter p(m_device); | - | ||||||||||||
| 70 | p.fillRect(QRectF(0, 0, m_fbo->width(), m_fbo->height()), QColor(qRgba(0, 0, 0, 0))); | - | ||||||||||||
| 71 | p.end(); | - | ||||||||||||
| 72 | } never executed: end of block | 0 | ||||||||||||
| 73 | } never executed: end of block | 0 | ||||||||||||
| 74 | - | |||||||||||||
| 75 | void QQuickContext2DFBOTile::drawFinished() | - | ||||||||||||
| 76 | { | - | ||||||||||||
| 77 | } | - | ||||||||||||
| 78 | - | |||||||||||||
| 79 | void QQuickContext2DFBOTile::setRect(const QRect& r) | - | ||||||||||||
| 80 | { | - | ||||||||||||
| 81 | if (m_rect == r
| 0 | ||||||||||||
| 82 | return; never executed: return; | 0 | ||||||||||||
| 83 | m_rect = r; | - | ||||||||||||
| 84 | m_dirty = true; | - | ||||||||||||
| 85 | if (!m_fbo
| 0 | ||||||||||||
| 86 | QOpenGLFramebufferObjectFormat format; | - | ||||||||||||
| 87 | format.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil); | - | ||||||||||||
| 88 | format.setInternalTextureFormat( | - | ||||||||||||
| 89 | 0x1908 | - | ||||||||||||
| 90 | ); | - | ||||||||||||
| 91 | format.setMipmap(false); | - | ||||||||||||
| 92 | - | |||||||||||||
| 93 | if (m_painter.isActive()
| 0 | ||||||||||||
| 94 | m_painter.end(); never executed: m_painter.end(); | 0 | ||||||||||||
| 95 | - | |||||||||||||
| 96 | delete m_fbo; | - | ||||||||||||
| 97 | m_fbo = new QOpenGLFramebufferObject(r.size(), format); | - | ||||||||||||
| 98 | } never executed: end of block | 0 | ||||||||||||
| 99 | } never executed: end of block | 0 | ||||||||||||
| 100 | - | |||||||||||||
| 101 | - | |||||||||||||
| 102 | QQuickContext2DImageTile::QQuickContext2DImageTile() | - | ||||||||||||
| 103 | : QQuickContext2DTile() | - | ||||||||||||
| 104 | { | - | ||||||||||||
| 105 | } never executed: end of block | 0 | ||||||||||||
| 106 | - | |||||||||||||
| 107 | QQuickContext2DImageTile::~QQuickContext2DImageTile() | - | ||||||||||||
| 108 | { | - | ||||||||||||
| 109 | } | - | ||||||||||||
| 110 | - | |||||||||||||
| 111 | void QQuickContext2DImageTile::setRect(const QRect& r) | - | ||||||||||||
| 112 | { | - | ||||||||||||
| 113 | if (m_rect == r
| 0 | ||||||||||||
| 114 | return; never executed: return; | 0 | ||||||||||||
| 115 | m_rect = r; | - | ||||||||||||
| 116 | m_dirty = true; | - | ||||||||||||
| 117 | if (m_image.size() != r.size()
| 0 | ||||||||||||
| 118 | m_image = QImage(r.size(), QImage::Format_ARGB32_Premultiplied); | - | ||||||||||||
| 119 | } never executed: end of block | 0 | ||||||||||||
| 120 | m_device = &m_image; | - | ||||||||||||
| 121 | } never executed: end of block | 0 | ||||||||||||
| 122 | - | |||||||||||||
| 123 | - | |||||||||||||
| Switch to Source code | Preprocessed file |