| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickpainteditem.cpp | 
| Switch to Source code | Preprocessed file | 
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||
| 2 | - | |||||||||||||||||||
| 3 | - | |||||||||||||||||||
| 4 | - | |||||||||||||||||||
| 5 | - | |||||||||||||||||||
| 6 | class QQuickPaintedItemTextureProvider : public QSGTextureProvider | - | ||||||||||||||||||
| 7 | { | - | ||||||||||||||||||
| 8 | public: | - | ||||||||||||||||||
| 9 | QSGPainterNode *node; | - | ||||||||||||||||||
| 10 | QSGTexture *texture() const override { return never executed: node ? node->texture() : nullptr; return node ? node->texture() : nullptr;never executed: } return node ? node->texture() : nullptr; | 0 | ||||||||||||||||||
| 11 | void fireTextureChanged() { textureChanged(); } never executed:  end of block | 0 | ||||||||||||||||||
| 12 | }; | - | ||||||||||||||||||
| 13 | QQuickPaintedItemPrivate::QQuickPaintedItemPrivate() | - | ||||||||||||||||||
| 14 | : QQuickItemPrivate() | - | ||||||||||||||||||
| 15 | , contentsScale(1.0) | - | ||||||||||||||||||
| 16 | , fillColor(Qt::transparent) | - | ||||||||||||||||||
| 17 | , renderTarget(QQuickPaintedItem::Image) | - | ||||||||||||||||||
| 18 | , performanceHints(nullptr) | - | ||||||||||||||||||
| 19 | , opaquePainting(false) | - | ||||||||||||||||||
| 20 | , antialiasing(false) | - | ||||||||||||||||||
| 21 | , mipmap(false) | - | ||||||||||||||||||
| 22 | , textureProvider(nullptr) | - | ||||||||||||||||||
| 23 | , node(nullptr) | - | ||||||||||||||||||
| 24 | { | - | ||||||||||||||||||
| 25 | } executed 20 times by 1 test:  end of blockExecuted by: 
 | 20 | ||||||||||||||||||
| 26 | - | |||||||||||||||||||
| 27 | - | |||||||||||||||||||
| 28 | - | |||||||||||||||||||
| 29 | - | |||||||||||||||||||
| 30 | QQuickPaintedItem::QQuickPaintedItem(QQuickItem *parent) | - | ||||||||||||||||||
| 31 | : QQuickItem(*(new QQuickPaintedItemPrivate), parent) | - | ||||||||||||||||||
| 32 | { | - | ||||||||||||||||||
| 33 | setFlag(ItemHasContents); | - | ||||||||||||||||||
| 34 | } executed 20 times by 1 test:  end of blockExecuted by: 
 | 20 | ||||||||||||||||||
| 35 | - | |||||||||||||||||||
| 36 | - | |||||||||||||||||||
| 37 | - | |||||||||||||||||||
| 38 | - | |||||||||||||||||||
| 39 | QQuickPaintedItem::QQuickPaintedItem(QQuickPaintedItemPrivate &dd, QQuickItem *parent) | - | ||||||||||||||||||
| 40 | : QQuickItem(dd, parent) | - | ||||||||||||||||||
| 41 | { | - | ||||||||||||||||||
| 42 | setFlag(ItemHasContents); | - | ||||||||||||||||||
| 43 | } never executed:  end of block | 0 | ||||||||||||||||||
| 44 | - | |||||||||||||||||||
| 45 | - | |||||||||||||||||||
| 46 | - | |||||||||||||||||||
| 47 | - | |||||||||||||||||||
| 48 | QQuickPaintedItem::~QQuickPaintedItem() | - | ||||||||||||||||||
| 49 | { | - | ||||||||||||||||||
| 50 | QQuickPaintedItemPrivate * const d = d_func(); | - | ||||||||||||||||||
| 51 | if (d->textureProvider 
 | 0-20 | ||||||||||||||||||
| 52 | QQuickWindowQObjectCleanupJob::schedule(window(), d->textureProvider); never executed:  QQuickWindowQObjectCleanupJob::schedule(window(), d->textureProvider); | 0 | ||||||||||||||||||
| 53 | } executed 20 times by 1 test:  end of blockExecuted by: 
 | 20 | ||||||||||||||||||
| 54 | void QQuickPaintedItem::update(const QRect &rect) | - | ||||||||||||||||||
| 55 | { | - | ||||||||||||||||||
| 56 | QQuickPaintedItemPrivate * const d = d_func(); | - | ||||||||||||||||||
| 57 | - | |||||||||||||||||||
| 58 | if (rect.isNull() 
 
 | 0-52 | ||||||||||||||||||
| 59 | d->dirtyRect = contentsBoundingRect().toAlignedRect(); never executed:  d->dirtyRect = contentsBoundingRect().toAlignedRect(); | 0 | ||||||||||||||||||
| 60 | else | - | ||||||||||||||||||
| 61 | d->dirtyRect |= (contentsBoundingRect() & rect).toAlignedRect(); executed 58 times by 1 test:  d->dirtyRect |= (contentsBoundingRect() & rect).toAlignedRect();Executed by: 
 | 58 | ||||||||||||||||||
| 62 | QQuickItem::update(); | - | ||||||||||||||||||
| 63 | } executed 58 times by 1 test:  end of blockExecuted by: 
 | 58 | ||||||||||||||||||
| 64 | bool QQuickPaintedItem::opaquePainting() const | - | ||||||||||||||||||
| 65 | { | - | ||||||||||||||||||
| 66 | const QQuickPaintedItemPrivate * const d = d_func(); | - | ||||||||||||||||||
| 67 | return executed 10 times by 1 test: d->opaquePainting; return d->opaquePainting;Executed by: 
 executed 10 times by 1 test:  return d->opaquePainting;Executed by: 
 | 10 | ||||||||||||||||||
| 68 | } | - | ||||||||||||||||||
| 69 | void QQuickPaintedItem::setOpaquePainting(bool opaque) | - | ||||||||||||||||||
| 70 | { | - | ||||||||||||||||||
| 71 | QQuickPaintedItemPrivate * const d = d_func(); | - | ||||||||||||||||||
| 72 | - | |||||||||||||||||||
| 73 | if (d->opaquePainting == opaque 
 | 4 | ||||||||||||||||||
| 74 | return; executed 4 times by 1 test:  return;Executed by: 
 | 4 | ||||||||||||||||||
| 75 | - | |||||||||||||||||||
| 76 | d->opaquePainting = opaque; | - | ||||||||||||||||||
| 77 | QQuickItem::update(); | - | ||||||||||||||||||
| 78 | } executed 4 times by 1 test:  end of blockExecuted by: 
 | 4 | ||||||||||||||||||
| 79 | bool QQuickPaintedItem::antialiasing() const | - | ||||||||||||||||||
| 80 | { | - | ||||||||||||||||||
| 81 | const QQuickPaintedItemPrivate * const d = d_func(); | - | ||||||||||||||||||
| 82 | return executed 10 times by 1 test: d->antialiasing; return d->antialiasing;Executed by: 
 executed 10 times by 1 test:  return d->antialiasing;Executed by: 
 | 10 | ||||||||||||||||||
| 83 | } | - | ||||||||||||||||||
| 84 | void QQuickPaintedItem::setAntialiasing(bool enable) | - | ||||||||||||||||||
| 85 | { | - | ||||||||||||||||||
| 86 | QQuickPaintedItemPrivate * const d = d_func(); | - | ||||||||||||||||||
| 87 | - | |||||||||||||||||||
| 88 | if (d->antialiasing == enable 
 | 4 | ||||||||||||||||||
| 89 | return; executed 4 times by 1 test:  return;Executed by: 
 | 4 | ||||||||||||||||||
| 90 | - | |||||||||||||||||||
| 91 | d->antialiasing = enable; | - | ||||||||||||||||||
| 92 | update(); | - | ||||||||||||||||||
| 93 | } executed 4 times by 1 test:  end of blockExecuted by: 
 | 4 | ||||||||||||||||||
| 94 | bool QQuickPaintedItem::mipmap() const | - | ||||||||||||||||||
| 95 | { | - | ||||||||||||||||||
| 96 | const QQuickPaintedItemPrivate * const d = d_func(); | - | ||||||||||||||||||
| 97 | return executed 10 times by 1 test: d->mipmap; return d->mipmap;Executed by: 
 executed 10 times by 1 test:  return d->mipmap;Executed by: 
 | 10 | ||||||||||||||||||
| 98 | } | - | ||||||||||||||||||
| 99 | void QQuickPaintedItem::setMipmap(bool enable) | - | ||||||||||||||||||
| 100 | { | - | ||||||||||||||||||
| 101 | QQuickPaintedItemPrivate * const d = d_func(); | - | ||||||||||||||||||
| 102 | - | |||||||||||||||||||
| 103 | if (d->mipmap == enable 
 | 4 | ||||||||||||||||||
| 104 | return; executed 4 times by 1 test:  return;Executed by: 
 | 4 | ||||||||||||||||||
| 105 | - | |||||||||||||||||||
| 106 | d->mipmap = enable; | - | ||||||||||||||||||
| 107 | update(); | - | ||||||||||||||||||
| 108 | } executed 4 times by 1 test:  end of blockExecuted by: 
 | 4 | ||||||||||||||||||
| 109 | QQuickPaintedItem::PerformanceHints QQuickPaintedItem::performanceHints() const | - | ||||||||||||||||||
| 110 | { | - | ||||||||||||||||||
| 111 | const QQuickPaintedItemPrivate * const d = d_func(); | - | ||||||||||||||||||
| 112 | return executed 10 times by 1 test: d->performanceHints; return d->performanceHints;Executed by: 
 executed 10 times by 1 test:  return d->performanceHints;Executed by: 
 | 10 | ||||||||||||||||||
| 113 | } | - | ||||||||||||||||||
| 114 | void QQuickPaintedItem::setPerformanceHint(QQuickPaintedItem::PerformanceHint hint, bool enabled) | - | ||||||||||||||||||
| 115 | { | - | ||||||||||||||||||
| 116 | QQuickPaintedItemPrivate * const d = d_func(); | - | ||||||||||||||||||
| 117 | PerformanceHints oldHints = d->performanceHints; | - | ||||||||||||||||||
| 118 | if (enabled 
 | 2 | ||||||||||||||||||
| 119 | d->performanceHints |= hint; executed 2 times by 1 test:  d->performanceHints |= hint;Executed by: 
 | 2 | ||||||||||||||||||
| 120 | else | - | ||||||||||||||||||
| 121 | d->performanceHints &= ~hint; executed 2 times by 1 test:  d->performanceHints &= ~hint;Executed by: 
 | 2 | ||||||||||||||||||
| 122 | if (oldHints != d->performanceHints 
 | 2 | ||||||||||||||||||
| 123 | update(); executed 2 times by 1 test:  update();Executed by: 
 | 2 | ||||||||||||||||||
| 124 | } executed 4 times by 1 test:  end of blockExecuted by: 
 | 4 | ||||||||||||||||||
| 125 | void QQuickPaintedItem::setPerformanceHints(QQuickPaintedItem::PerformanceHints hints) | - | ||||||||||||||||||
| 126 | { | - | ||||||||||||||||||
| 127 | QQuickPaintedItemPrivate * const d = d_func(); | - | ||||||||||||||||||
| 128 | if (d->performanceHints == hints 
 | 2 | ||||||||||||||||||
| 129 | return; executed 2 times by 1 test:  return;Executed by: 
 | 2 | ||||||||||||||||||
| 130 | d->performanceHints = hints; | - | ||||||||||||||||||
| 131 | update(); | - | ||||||||||||||||||
| 132 | } executed 2 times by 1 test:  end of blockExecuted by: 
 | 2 | ||||||||||||||||||
| 133 | - | |||||||||||||||||||
| 134 | QSize QQuickPaintedItem::textureSize() const | - | ||||||||||||||||||
| 135 | { | - | ||||||||||||||||||
| 136 | const QQuickPaintedItemPrivate * const d = d_func(); | - | ||||||||||||||||||
| 137 | return never executed: d->textureSize; return d->textureSize;never executed:  return d->textureSize; | 0 | ||||||||||||||||||
| 138 | } | - | ||||||||||||||||||
| 139 | void QQuickPaintedItem::setTextureSize(const QSize &size) | - | ||||||||||||||||||
| 140 | { | - | ||||||||||||||||||
| 141 | QQuickPaintedItemPrivate * const d = d_func(); | - | ||||||||||||||||||
| 142 | if (d->textureSize == size 
 | 0 | ||||||||||||||||||
| 143 | return; never executed:  return; | 0 | ||||||||||||||||||
| 144 | d->textureSize = size; | - | ||||||||||||||||||
| 145 | textureSizeChanged(); | - | ||||||||||||||||||
| 146 | } never executed:  end of block | 0 | ||||||||||||||||||
| 147 | QRectF QQuickPaintedItem::contentsBoundingRect() const | - | ||||||||||||||||||
| 148 | { | - | ||||||||||||||||||
| 149 | const QQuickPaintedItemPrivate * const d = d_func(); | - | ||||||||||||||||||
| 150 | - | |||||||||||||||||||
| 151 | qreal w = d->width; | - | ||||||||||||||||||
| 152 | QSizeF sz = d->contentsSize * d->contentsScale; | - | ||||||||||||||||||
| 153 | if (w < sz.width() 
 | 8-72 | ||||||||||||||||||
| 154 | w = sz.width(); executed 8 times by 1 test:  w = sz.width();Executed by: 
 | 8 | ||||||||||||||||||
| 155 | qreal h = d->height; | - | ||||||||||||||||||
| 156 | if (h < sz.height() 
 | 20-60 | ||||||||||||||||||
| 157 | h = sz.height(); executed 20 times by 1 test:  h = sz.height();Executed by: 
 | 20 | ||||||||||||||||||
| 158 | - | |||||||||||||||||||
| 159 | return executed 80 times by 1 test: QRectF(0, 0, w, h); return QRectF(0, 0, w, h);Executed by: 
 executed 80 times by 1 test:  return QRectF(0, 0, w, h);Executed by: 
 | 80 | ||||||||||||||||||
| 160 | } | - | ||||||||||||||||||
| 161 | QSize QQuickPaintedItem::contentsSize() const | - | ||||||||||||||||||
| 162 | { | - | ||||||||||||||||||
| 163 | const QQuickPaintedItemPrivate * const d = d_func(); | - | ||||||||||||||||||
| 164 | return executed 10 times by 1 test: d->contentsSize; return d->contentsSize;Executed by: 
 executed 10 times by 1 test:  return d->contentsSize;Executed by: 
 | 10 | ||||||||||||||||||
| 165 | } | - | ||||||||||||||||||
| 166 | - | |||||||||||||||||||
| 167 | void QQuickPaintedItem::setContentsSize(const QSize &size) | - | ||||||||||||||||||
| 168 | { | - | ||||||||||||||||||
| 169 | QQuickPaintedItemPrivate * const d = d_func(); | - | ||||||||||||||||||
| 170 | - | |||||||||||||||||||
| 171 | if (d->contentsSize == size 
 | 4-8 | ||||||||||||||||||
| 172 | return; executed 4 times by 1 test:  return;Executed by: 
 | 4 | ||||||||||||||||||
| 173 | - | |||||||||||||||||||
| 174 | d->contentsSize = size; | - | ||||||||||||||||||
| 175 | update(); | - | ||||||||||||||||||
| 176 | - | |||||||||||||||||||
| 177 | contentsSizeChanged(); | - | ||||||||||||||||||
| 178 | } executed 8 times by 1 test:  end of blockExecuted by: 
 | 8 | ||||||||||||||||||
| 179 | - | |||||||||||||||||||
| 180 | - | |||||||||||||||||||
| 181 | - | |||||||||||||||||||
| 182 | - | |||||||||||||||||||
| 183 | - | |||||||||||||||||||
| 184 | void QQuickPaintedItem::resetContentsSize() | - | ||||||||||||||||||
| 185 | { | - | ||||||||||||||||||
| 186 | setContentsSize(QSize()); | - | ||||||||||||||||||
| 187 | } executed 2 times by 1 test:  end of blockExecuted by: 
 | 2 | ||||||||||||||||||
| 188 | qreal QQuickPaintedItem::contentsScale() const | - | ||||||||||||||||||
| 189 | { | - | ||||||||||||||||||
| 190 | const QQuickPaintedItemPrivate * const d = d_func(); | - | ||||||||||||||||||
| 191 | return executed 10 times by 1 test: d->contentsScale; return d->contentsScale;Executed by: 
 executed 10 times by 1 test:  return d->contentsScale;Executed by: 
 | 10 | ||||||||||||||||||
| 192 | } | - | ||||||||||||||||||
| 193 | - | |||||||||||||||||||
| 194 | void QQuickPaintedItem::setContentsScale(qreal scale) | - | ||||||||||||||||||
| 195 | { | - | ||||||||||||||||||
| 196 | QQuickPaintedItemPrivate * const d = d_func(); | - | ||||||||||||||||||
| 197 | - | |||||||||||||||||||
| 198 | if (d->contentsScale == scale 
 | 4-8 | ||||||||||||||||||
| 199 | return; executed 4 times by 1 test:  return;Executed by: 
 | 4 | ||||||||||||||||||
| 200 | - | |||||||||||||||||||
| 201 | d->contentsScale = scale; | - | ||||||||||||||||||
| 202 | update(); | - | ||||||||||||||||||
| 203 | - | |||||||||||||||||||
| 204 | contentsScaleChanged(); | - | ||||||||||||||||||
| 205 | } executed 8 times by 1 test:  end of blockExecuted by: 
 | 8 | ||||||||||||||||||
| 206 | - | |||||||||||||||||||
| 207 | - | |||||||||||||||||||
| 208 | - | |||||||||||||||||||
| 209 | - | |||||||||||||||||||
| 210 | - | |||||||||||||||||||
| 211 | - | |||||||||||||||||||
| 212 | - | |||||||||||||||||||
| 213 | QColor QQuickPaintedItem::fillColor() const | - | ||||||||||||||||||
| 214 | { | - | ||||||||||||||||||
| 215 | const QQuickPaintedItemPrivate * const d = d_func(); | - | ||||||||||||||||||
| 216 | return executed 10 times by 1 test: d->fillColor; return d->fillColor;Executed by: 
 executed 10 times by 1 test:  return d->fillColor;Executed by: 
 | 10 | ||||||||||||||||||
| 217 | } | - | ||||||||||||||||||
| 218 | - | |||||||||||||||||||
| 219 | void QQuickPaintedItem::setFillColor(const QColor &c) | - | ||||||||||||||||||
| 220 | { | - | ||||||||||||||||||
| 221 | QQuickPaintedItemPrivate * const d = d_func(); | - | ||||||||||||||||||
| 222 | - | |||||||||||||||||||
| 223 | if (d->fillColor == c 
 | 4 | ||||||||||||||||||
| 224 | return; executed 4 times by 1 test:  return;Executed by: 
 | 4 | ||||||||||||||||||
| 225 | - | |||||||||||||||||||
| 226 | d->fillColor = c; | - | ||||||||||||||||||
| 227 | update(); | - | ||||||||||||||||||
| 228 | - | |||||||||||||||||||
| 229 | fillColorChanged(); | - | ||||||||||||||||||
| 230 | } executed 4 times by 1 test:  end of blockExecuted by: 
 | 4 | ||||||||||||||||||
| 231 | QQuickPaintedItem::RenderTarget QQuickPaintedItem::renderTarget() const | - | ||||||||||||||||||
| 232 | { | - | ||||||||||||||||||
| 233 | const QQuickPaintedItemPrivate * const d = d_func(); | - | ||||||||||||||||||
| 234 | return executed 10 times by 1 test: d->renderTarget; return d->renderTarget;Executed by: 
 executed 10 times by 1 test:  return d->renderTarget;Executed by: 
 | 10 | ||||||||||||||||||
| 235 | } | - | ||||||||||||||||||
| 236 | - | |||||||||||||||||||
| 237 | void QQuickPaintedItem::setRenderTarget(RenderTarget target) | - | ||||||||||||||||||
| 238 | { | - | ||||||||||||||||||
| 239 | QQuickPaintedItemPrivate * const d = d_func(); | - | ||||||||||||||||||
| 240 | - | |||||||||||||||||||
| 241 | if (d->renderTarget == target 
 | 4 | ||||||||||||||||||
| 242 | return; executed 4 times by 1 test:  return;Executed by: 
 | 4 | ||||||||||||||||||
| 243 | - | |||||||||||||||||||
| 244 | d->renderTarget = target; | - | ||||||||||||||||||
| 245 | update(); | - | ||||||||||||||||||
| 246 | - | |||||||||||||||||||
| 247 | renderTargetChanged(); | - | ||||||||||||||||||
| 248 | } executed 4 times by 1 test:  end of blockExecuted by: 
 | 4 | ||||||||||||||||||
| 249 | QSGNode *QQuickPaintedItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) | - | ||||||||||||||||||
| 250 | { | - | ||||||||||||||||||
| 251 | (void)data;; | - | ||||||||||||||||||
| 252 | QQuickPaintedItemPrivate * const d = d_func(); | - | ||||||||||||||||||
| 253 | - | |||||||||||||||||||
| 254 | if (width() <= 0 
 
 | 0-50 | ||||||||||||||||||
| 255 | delete oldNode; | - | ||||||||||||||||||
| 256 | if (d->textureProvider 
 | 0-2 | ||||||||||||||||||
| 257 | d->textureProvider->node = nullptr; | - | ||||||||||||||||||
| 258 | d->textureProvider->fireTextureChanged(); | - | ||||||||||||||||||
| 259 | } never executed:  end of block | 0 | ||||||||||||||||||
| 260 | return executed 2 times by 1 test: nullptr; return nullptr;Executed by: 
 executed 2 times by 1 test:  return nullptr;Executed by: 
 | 2 | ||||||||||||||||||
| 261 | } | - | ||||||||||||||||||
| 262 | - | |||||||||||||||||||
| 263 | QSGPainterNode *node = static_cast<QSGPainterNode *>(oldNode); | - | ||||||||||||||||||
| 264 | if (!node 
 | 16-34 | ||||||||||||||||||
| 265 | node = d->sceneGraphContext()->createPainterNode(this); | - | ||||||||||||||||||
| 266 | d->node = node; | - | ||||||||||||||||||
| 267 | } executed 16 times by 1 test:  end of blockExecuted by: 
 | 16 | ||||||||||||||||||
| 268 | - | |||||||||||||||||||
| 269 | bool hasTextureSize = d->textureSize.width() > 0 
 
 | 0-50 | ||||||||||||||||||
| 270 | - | |||||||||||||||||||
| 271 | - | |||||||||||||||||||
| 272 | - | |||||||||||||||||||
| 273 | if (!hasTextureSize 
 | 0-50 | ||||||||||||||||||
| 274 | && (d->contentsScale != 1 
 | 10-40 | ||||||||||||||||||
| 275 | || (d->contentsSize.width() > 0 
 
 | 0-38 | ||||||||||||||||||
| 276 | QRectF br = contentsBoundingRect(); | - | ||||||||||||||||||
| 277 | node->setContentsScale(d->contentsScale); | - | ||||||||||||||||||
| 278 | QSize size = QSize(qRound(br.width()), qRound(br.height())); | - | ||||||||||||||||||
| 279 | node->setSize(size); | - | ||||||||||||||||||
| 280 | node->setTextureSize(size); | - | ||||||||||||||||||
| 281 | } executed 12 times by 1 test: else { end of blockExecuted by: 
 | 12 | ||||||||||||||||||
| 282 | - | |||||||||||||||||||
| 283 | node->setContentsScale(1); | - | ||||||||||||||||||
| 284 | QSize itemSize(qRound(width()), qRound(height())); | - | ||||||||||||||||||
| 285 | node->setSize(itemSize); | - | ||||||||||||||||||
| 286 | QSize textureSize = (hasTextureSize 
 | 0-38 | ||||||||||||||||||
| 287 | * window()->effectiveDevicePixelRatio(); | - | ||||||||||||||||||
| 288 | node->setTextureSize(textureSize); | - | ||||||||||||||||||
| 289 | } executed 38 times by 1 test:  end of blockExecuted by: 
 | 38 | ||||||||||||||||||
| 290 | - | |||||||||||||||||||
| 291 | node->setPreferredRenderTarget(d->renderTarget); | - | ||||||||||||||||||
| 292 | node->setFastFBOResizing(d->performanceHints & FastFBOResizing); | - | ||||||||||||||||||
| 293 | node->setSmoothPainting(d->antialiasing); | - | ||||||||||||||||||
| 294 | node->setLinearFiltering(d->smooth); | - | ||||||||||||||||||
| 295 | node->setMipmapping(d->mipmap); | - | ||||||||||||||||||
| 296 | node->setOpaquePainting(d->opaquePainting); | - | ||||||||||||||||||
| 297 | node->setFillColor(d->fillColor); | - | ||||||||||||||||||
| 298 | node->setDirty(d->dirtyRect); | - | ||||||||||||||||||
| 299 | node->update(); | - | ||||||||||||||||||
| 300 | - | |||||||||||||||||||
| 301 | d->dirtyRect = QRect(); | - | ||||||||||||||||||
| 302 | - | |||||||||||||||||||
| 303 | if (d->textureProvider 
 | 0-50 | ||||||||||||||||||
| 304 | d->textureProvider->node = node; | - | ||||||||||||||||||
| 305 | d->textureProvider->fireTextureChanged(); | - | ||||||||||||||||||
| 306 | } never executed:  end of block | 0 | ||||||||||||||||||
| 307 | - | |||||||||||||||||||
| 308 | return executed 50 times by 1 test: node; return node;Executed by: 
 executed 50 times by 1 test:  return node;Executed by: 
 | 50 | ||||||||||||||||||
| 309 | } | - | ||||||||||||||||||
| 310 | - | |||||||||||||||||||
| 311 | - | |||||||||||||||||||
| 312 | - | |||||||||||||||||||
| 313 | - | |||||||||||||||||||
| 314 | void QQuickPaintedItem::releaseResources() | - | ||||||||||||||||||
| 315 | { | - | ||||||||||||||||||
| 316 | QQuickPaintedItemPrivate * const d = d_func(); | - | ||||||||||||||||||
| 317 | if (d->textureProvider 
 | 0 | ||||||||||||||||||
| 318 | QQuickWindowQObjectCleanupJob::schedule(window(), d->textureProvider); | - | ||||||||||||||||||
| 319 | d->textureProvider = nullptr; | - | ||||||||||||||||||
| 320 | } never executed:  end of block | 0 | ||||||||||||||||||
| 321 | d->node = nullptr; | - | ||||||||||||||||||
| 322 | } never executed:  end of block | 0 | ||||||||||||||||||
| 323 | - | |||||||||||||||||||
| 324 | void QQuickPaintedItem::invalidateSceneGraph() | - | ||||||||||||||||||
| 325 | { | - | ||||||||||||||||||
| 326 | QQuickPaintedItemPrivate * const d = d_func(); | - | ||||||||||||||||||
| 327 | delete d->textureProvider; | - | ||||||||||||||||||
| 328 | d->textureProvider = nullptr; | - | ||||||||||||||||||
| 329 | d->node = nullptr; | - | ||||||||||||||||||
| 330 | } never executed:  end of block | 0 | ||||||||||||||||||
| 331 | - | |||||||||||||||||||
| 332 | - | |||||||||||||||||||
| 333 | - | |||||||||||||||||||
| 334 | - | |||||||||||||||||||
| 335 | bool QQuickPaintedItem::isTextureProvider() const | - | ||||||||||||||||||
| 336 | { | - | ||||||||||||||||||
| 337 | return never executed: true; return true;never executed:  return true; | 0 | ||||||||||||||||||
| 338 | } | - | ||||||||||||||||||
| 339 | - | |||||||||||||||||||
| 340 | - | |||||||||||||||||||
| 341 | - | |||||||||||||||||||
| 342 | - | |||||||||||||||||||
| 343 | QSGTextureProvider *QQuickPaintedItem::textureProvider() const | - | ||||||||||||||||||
| 344 | { | - | ||||||||||||||||||
| 345 | - | |||||||||||||||||||
| 346 | - | |||||||||||||||||||
| 347 | - | |||||||||||||||||||
| 348 | - | |||||||||||||||||||
| 349 | if (QQuickItem::isTextureProvider() 
 | 0 | ||||||||||||||||||
| 350 | return never executed: QQuickItem::textureProvider(); return QQuickItem::textureProvider();never executed:  return QQuickItem::textureProvider(); | 0 | ||||||||||||||||||
| 351 | - | |||||||||||||||||||
| 352 | const QQuickPaintedItemPrivate * const d = d_func(); | - | ||||||||||||||||||
| 353 | - | |||||||||||||||||||
| 354 | QQuickWindow *w = window(); | - | ||||||||||||||||||
| 355 | if (!w 
 
 
 | 0 | ||||||||||||||||||
| 356 | QMessageLogger(__FILE__, 668, __PRETTY_FUNCTION__).warning("QQuickPaintedItem::textureProvider: can only be queried on the rendering thread of an exposed window"); | - | ||||||||||||||||||
| 357 | return never executed: nullptr; return nullptr;never executed:  return nullptr; | 0 | ||||||||||||||||||
| 358 | } | - | ||||||||||||||||||
| 359 | - | |||||||||||||||||||
| 360 | if (!d->textureProvider 
 | 0 | ||||||||||||||||||
| 361 | d->textureProvider = new QQuickPaintedItemTextureProvider(); never executed:  d->textureProvider = new QQuickPaintedItemTextureProvider(); | 0 | ||||||||||||||||||
| 362 | d->textureProvider->node = d->node; | - | ||||||||||||||||||
| 363 | return never executed: d->textureProvider; return d->textureProvider;never executed:  return d->textureProvider; | 0 | ||||||||||||||||||
| 364 | } | - | ||||||||||||||||||
| 365 | - | |||||||||||||||||||
| 366 | - | |||||||||||||||||||
| 367 | - | |||||||||||||||||||
| 368 | - | |||||||||||||||||||
| 369 | - | |||||||||||||||||||
| 370 | void QQuickPaintedItem::itemChange(ItemChange change, const ItemChangeData &value) | - | ||||||||||||||||||
| 371 | { | - | ||||||||||||||||||
| 372 | if (change == ItemDevicePixelRatioHasChanged 
 | 0-32 | ||||||||||||||||||
| 373 | update(); never executed:  update(); | 0 | ||||||||||||||||||
| 374 | QQuickItem::itemChange(change, value); | - | ||||||||||||||||||
| 375 | } executed 32 times by 1 test:  end of blockExecuted by: 
 | 32 | ||||||||||||||||||
| 376 | - | |||||||||||||||||||
| 377 | - | |||||||||||||||||||
| 378 | - | |||||||||||||||||||
| Switch to Source code | Preprocessed file |