OpenCoverage

qsgdefaultpainternode.cpp

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/scenegraph/util/qsgdefaultpainternode.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8QSGPainterTexture::QSGPainterTexture()-
9 : QSGPlainTexture()-
10{-
11 m_retain_image = true;-
12}
executed 22 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
22
13-
14void QSGPainterTexture::bind()-
15{-
16 if (m_dirty_rect.isNull()
m_dirty_rect.isNull()Description
TRUEnever evaluated
FALSEevaluated 50 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
) {
0-50
17 QSGPlainTexture::bind();-
18 return;
never executed: return;
0
19 }-
20-
21 setImage(m_image);-
22 QSGPlainTexture::bind();-
23-
24 m_dirty_rect = QRect();-
25}
executed 50 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
50
26-
27QSGDefaultPainterNode::QSGDefaultPainterNode(QQuickPaintedItem *item)-
28 : QSGPainterNode()-
29 , m_preferredRenderTarget(QQuickPaintedItem::Image)-
30 , m_actualRenderTarget(QQuickPaintedItem::Image)-
31 , m_item(item)-
32 , m_fbo(nullptr)-
33 , m_multisampledFbo(nullptr)-
34 , m_geometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4)-
35 , m_texture(nullptr)-
36 , m_gl_device(nullptr)-
37 , m_fillColor(Qt::transparent)-
38 , m_contentsScale(1.0)-
39 , m_dirtyContents(false)-
40 , m_opaquePainting(false)-
41 , m_linear_filtering(false)-
42 , m_mipmapping(false)-
43 , m_smoothPainting(false)-
44 , m_extensionsChecked(false)-
45 , m_multisamplingSupported(false)-
46 , m_fastFBOResizing(false)-
47 , m_dirtyGeometry(false)-
48 , m_dirtyRenderTarget(false)-
49 , m_dirtyTexture(false)-
50{-
51 m_context = static_cast<QSGDefaultRenderContext *>(static_cast<QQuickPaintedItemPrivate *>(QObjectPrivate::get(item))->sceneGraphRenderContext());-
52-
53 setMaterial(&m_materialO);-
54 setOpaqueMaterial(&m_material);-
55 setGeometry(&m_geometry);-
56-
57-
58 qsgnode_set_description(this, QString::fromLatin1("QQuickPaintedItem(%1):%2").arg(QString::fromLatin1(item->metaObject()->className())).arg(item->objectName()));-
59-
60}
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
16
61-
62QSGDefaultPainterNode::~QSGDefaultPainterNode()-
63{-
64 delete m_texture;-
65 delete m_fbo;-
66 delete m_multisampledFbo;-
67 delete m_gl_device;-
68}
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
16
69-
70void QSGDefaultPainterNode::paint()-
71{-
72 QRect dirtyRect = m_dirtyRect.isNull()
m_dirtyRect.isNull()Description
TRUEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
? QRect(0, 0, m_size.width(), m_size.height()) : m_dirtyRect;
4-46
73-
74 QPainter painter;-
75 if (m_actualRenderTarget == QQuickPaintedItem::Image
m_actualRender...tedItem::ImageDescription
TRUEevaluated 50 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEnever evaluated
) {
0-50
76 if (m_image.isNull()
m_image.isNull()Description
TRUEnever evaluated
FALSEevaluated 50 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
)
0-50
77 return;
never executed: return;
0
78 painter.begin(&m_image);-
79 }
executed 50 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
else {
50
80 if (!m_gl_device
!m_gl_deviceDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
81 m_gl_device = new QOpenGLPaintDevice(m_fboSize);-
82 m_gl_device->setPaintFlipped(true);-
83 }
never executed: end of block
0
84-
85 if (m_multisampledFbo
m_multisampledFboDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
86 m_multisampledFbo->bind();
never executed: m_multisampledFbo->bind();
0
87 else-
88 m_fbo->bind();
never executed: m_fbo->bind();
0
89-
90 painter.begin(m_gl_device);-
91 }
never executed: end of block
0
92-
93 if (m_smoothPainting
m_smoothPaintingDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
) {
2-48
94 painter.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform);-
95 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
2
96-
97 QRect clipRect;-
98 QRect dirtyTextureRect;-
99-
100 if (m_contentsScale == 1
m_contentsScale == 1Description
TRUEevaluated 40 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
) {
10-40
101 qreal scaleX = m_textureSize.width() / (qreal) m_size.width();-
102 qreal scaleY = m_textureSize.height() / (qreal) m_size.height();-
103 painter.scale(scaleX, scaleY);-
104 clipRect = dirtyRect;-
105 dirtyTextureRect = QRectF(dirtyRect.x() * scaleX,-
106 dirtyRect.y() * scaleY,-
107 dirtyRect.width() * scaleX,-
108 dirtyRect.height() * scaleY).toAlignedRect();-
109 }
executed 40 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
else {
40
110 painter.scale(m_contentsScale, m_contentsScale);-
111 QRect sclip(qFloor(dirtyRect.x()/m_contentsScale),-
112 qFloor(dirtyRect.y()/m_contentsScale),-
113 qCeil(dirtyRect.width()/m_contentsScale+dirtyRect.x()/m_contentsScale-qFloor(dirtyRect.x()/m_contentsScale)),-
114 qCeil(dirtyRect.height()/m_contentsScale+dirtyRect.y()/m_contentsScale-qFloor(dirtyRect.y()/m_contentsScale)));-
115 clipRect = sclip;-
116 dirtyTextureRect = dirtyRect;-
117 }
executed 10 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
10
118-
119-
120 if (!m_dirtyRect.isNull()
!m_dirtyRect.isNull()Description
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
) {
4-46
121 painter.setClipRect(clipRect);-
122 }
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
4
123-
124 painter.setCompositionMode(QPainter::CompositionMode_Source);-
125 painter.fillRect(clipRect, m_fillColor);-
126 painter.setCompositionMode(QPainter::CompositionMode_SourceOver);-
127-
128 m_item->paint(&painter);-
129 painter.end();-
130-
131 if (m_actualRenderTarget == QQuickPaintedItem::Image
m_actualRender...tedItem::ImageDescription
TRUEevaluated 50 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEnever evaluated
) {
0-50
132 m_texture->setImage(m_image);-
133 m_texture->setDirtyRect(dirtyTextureRect);-
134 }
executed 50 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
else if (m_multisampledFbo
m_multisampledFboDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0-50
135 QOpenGLFramebufferObject::blitFramebuffer(m_fbo, dirtyTextureRect, m_multisampledFbo, dirtyTextureRect);-
136 }
never executed: end of block
0
137-
138 if (m_multisampledFbo
m_multisampledFboDescription
TRUEnever evaluated
FALSEevaluated 50 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
)
0-50
139 m_multisampledFbo->release();
never executed: m_multisampledFbo->release();
0
140 else if (m_fbo
m_fboDescription
TRUEnever evaluated
FALSEevaluated 50 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
)
0-50
141 m_fbo->release();
never executed: m_fbo->release();
0
142-
143 m_dirtyRect = QRect();-
144}
executed 50 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
50
145-
146void QSGDefaultPainterNode::update()-
147{-
148 if (m_dirtyRenderTarget
m_dirtyRenderTargetDescription
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
)
24-26
149 updateRenderTarget();
executed 26 times by 1 test: updateRenderTarget();
Executed by:
  • tst_qquickpainteditem
26
150 if (m_dirtyGeometry
m_dirtyGeometryDescription
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
)
22-28
151 updateGeometry();
executed 22 times by 1 test: updateGeometry();
Executed by:
  • tst_qquickpainteditem
22
152 if (m_dirtyTexture
m_dirtyTextureDescription
TRUEevaluated 30 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEevaluated 20 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
)
20-30
153 updateTexture();
executed 30 times by 1 test: updateTexture();
Executed by:
  • tst_qquickpainteditem
30
154-
155 if (m_dirtyContents
m_dirtyContentsDescription
TRUEevaluated 50 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEnever evaluated
)
0-50
156 paint();
executed 50 times by 1 test: paint();
Executed by:
  • tst_qquickpainteditem
50
157-
158 m_dirtyGeometry = false;-
159 m_dirtyRenderTarget = false;-
160 m_dirtyTexture = false;-
161 m_dirtyContents = false;-
162}
executed 50 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
50
163-
164void QSGDefaultPainterNode::updateTexture()-
165{-
166 m_texture->setHasAlphaChannel(!m_opaquePainting);-
167 m_material.setTexture(m_texture);-
168 m_materialO.setTexture(m_texture);-
169-
170 markDirty(DirtyMaterial);-
171}
executed 30 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
30
172-
173void QSGDefaultPainterNode::updateGeometry()-
174{-
175 QRectF source;-
176 if (m_actualRenderTarget == QQuickPaintedItem::Image
m_actualRender...tedItem::ImageDescription
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEnever evaluated
)
0-22
177 source = QRectF(0, 0, 1, 1);
executed 22 times by 1 test: source = QRectF(0, 0, 1, 1);
Executed by:
  • tst_qquickpainteditem
22
178 else-
179 source = QRectF(0, 0, qreal(m_textureSize.width()) / m_fboSize.width(), qreal(m_textureSize.height()) / m_fboSize.height());
never executed: source = QRectF(0, 0, qreal(m_textureSize.width()) / m_fboSize.width(), qreal(m_textureSize.height()) / m_fboSize.height());
0
180 QRectF dest(0, 0, m_size.width(), m_size.height());-
181 if (m_actualRenderTarget == QQuickPaintedItem::InvertedYFramebufferObject
m_actualRender...mebufferObjectDescription
TRUEnever evaluated
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
)
0-22
182 dest = QRectF(QPointF(0, m_size.height()), QPointF(m_size.width(), 0));
never executed: dest = QRectF(QPointF(0, m_size.height()), QPointF(m_size.width(), 0));
0
183 QSGGeometry::updateTexturedRectGeometry(&m_geometry,-
184 dest,-
185 source);-
186 markDirty(DirtyGeometry);-
187}
executed 22 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
22
188-
189void QSGDefaultPainterNode::updateRenderTarget()-
190{-
191 if (!m_extensionsChecked
!m_extensionsCheckedDescription
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
) {
10-16
192 QOpenGLExtensions *e = static_cast<QOpenGLExtensions *>(QOpenGLContext::currentContext()->functions());-
193 m_multisamplingSupported = e->hasOpenGLExtension(QOpenGLExtensions::FramebufferMultisample)
e->hasOpenGLEx...erMultisample)Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEnever evaluated
0-16
194 && e->hasOpenGLExtension(QOpenGLExtensions::FramebufferBlit)
e->hasOpenGLEx...amebufferBlit)Description
TRUEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEnever evaluated
;
0-16
195 m_extensionsChecked = true;-
196 }
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
16
197-
198 m_dirtyContents = true;-
199-
200 QQuickPaintedItem::RenderTarget oldTarget = m_actualRenderTarget;-
201 if (m_preferredRenderTarget == QQuickPaintedItem::Image
m_preferredRen...tedItem::ImageDescription
TRUEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEnever evaluated
) {
0-26
202 m_actualRenderTarget = QQuickPaintedItem::Image;-
203 }
executed 26 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
else {
26
204 if (!m_multisamplingSupported
!m_multisamplingSupportedDescription
TRUEnever evaluated
FALSEnever evaluated
&& m_smoothPainting
m_smoothPaintingDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
205 m_actualRenderTarget = QQuickPaintedItem::Image;
never executed: m_actualRenderTarget = QQuickPaintedItem::Image;
0
206 else-
207 m_actualRenderTarget = m_preferredRenderTarget;
never executed: m_actualRenderTarget = m_preferredRenderTarget;
0
208 }-
209 if (oldTarget != m_actualRenderTarget
oldTarget != m...alRenderTargetDescription
TRUEnever evaluated
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
) {
0-26
210 m_image = QImage();-
211 delete m_fbo;-
212 delete m_multisampledFbo;-
213 delete m_gl_device;-
214 m_fbo = m_multisampledFbo = nullptr;-
215 m_gl_device = nullptr;-
216 }
never executed: end of block
0
217-
218 if (m_actualRenderTarget == QQuickPaintedItem::FramebufferObject
m_actualRender...mebufferObjectDescription
TRUEnever evaluated
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
||
0-26
219 m_actualRenderTarget == QQuickPaintedItem::InvertedYFramebufferObject
m_actualRender...mebufferObjectDescription
TRUEnever evaluated
FALSEevaluated 26 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
) {
0-26
220 const QOpenGLContext *ctx = m_context->openglContext();-
221 if (m_fbo
m_fboDescription
TRUEnever evaluated
FALSEnever evaluated
&& !m_dirtyGeometry
!m_dirtyGeometryDescription
TRUEnever evaluated
FALSEnever evaluated
&& (!ctx->format().samples()
!ctx->format().samples()Description
TRUEnever evaluated
FALSEnever evaluated
|| !m_multisamplingSupported
!m_multisamplingSupportedDescription
TRUEnever evaluated
FALSEnever evaluated
))
0
222 return;
never executed: return;
0
223-
224 if (m_fboSize.isEmpty()
m_fboSize.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
225 updateFBOSize();
never executed: updateFBOSize();
0
226-
227 delete m_fbo;-
228 delete m_multisampledFbo;-
229 m_fbo = m_multisampledFbo = nullptr;-
230 if (m_gl_device
m_gl_deviceDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
231 m_gl_device->setSize(m_fboSize);
never executed: m_gl_device->setSize(m_fboSize);
0
232-
233 if (m_smoothPainting
m_smoothPaintingDescription
TRUEnever evaluated
FALSEnever evaluated
&& ctx->format().samples()
ctx->format().samples()Description
TRUEnever evaluated
FALSEnever evaluated
&& m_multisamplingSupported
m_multisamplingSupportedDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
234 {-
235 QOpenGLFramebufferObjectFormat format;-
236 format.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);-
237 format.setSamples(8);-
238 m_multisampledFbo = new QOpenGLFramebufferObject(m_fboSize, format);-
239 }-
240 {-
241 QOpenGLFramebufferObjectFormat format;-
242 format.setAttachment(QOpenGLFramebufferObject::NoAttachment);-
243 m_fbo = new QOpenGLFramebufferObject(m_fboSize, format);-
244 }-
245 }
never executed: end of block
else {
0
246 QOpenGLFramebufferObjectFormat format;-
247 format.setAttachment(QOpenGLFramebufferObject::CombinedDepthStencil);-
248 m_fbo = new QOpenGLFramebufferObject(m_fboSize, format);-
249 }
never executed: end of block
0
250 } else {-
251 if (!m_image.isNull()
!m_image.isNull()Description
TRUEevaluated 10 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
&& !m_dirtyGeometry
!m_dirtyGeometryDescription
TRUEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
)
4-16
252 return;
executed 4 times by 1 test: return;
Executed by:
  • tst_qquickpainteditem
4
253-
254 m_image = QImage(m_textureSize, QImage::Format_ARGB32_Premultiplied);-
255 m_image.fill(Qt::transparent);-
256 }
executed 22 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
22
257-
258 QSGPainterTexture *texture = new QSGPainterTexture;-
259 if (m_actualRenderTarget == QQuickPaintedItem::Image
m_actualRender...tedItem::ImageDescription
TRUEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEnever evaluated
) {
0-22
260 texture->setOwnsTexture(true);-
261 texture->setTextureSize(m_textureSize);-
262 }
executed 22 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
else {
22
263 texture->setTextureId(m_fbo->texture());-
264 texture->setOwnsTexture(false);-
265 texture->setTextureSize(m_fboSize);-
266 }
never executed: end of block
0
267-
268 if (m_texture
m_textureDescription
TRUEevaluated 6 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
)
6-16
269 delete m_texture;
executed 6 times by 1 test: delete m_texture;
Executed by:
  • tst_qquickpainteditem
6
270-
271 m_texture = texture;-
272}
executed 22 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
22
273-
274void QSGDefaultPainterNode::updateFBOSize()-
275{-
276 int fboWidth;-
277 int fboHeight;-
278 if (m_fastFBOResizing
m_fastFBOResizingDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEevaluated 24 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
) {
2-24
279 fboWidth = qMax(64U, qNextPowerOfTwo(m_textureSize.width() - 1));-
280 fboHeight = qMax(64U, qNextPowerOfTwo(m_textureSize.height() - 1));-
281 }
executed 2 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
else {
2
282 QSize minimumFBOSize = m_context->sceneGraphContext()->minimumFBOSize();-
283 fboWidth = qMax(minimumFBOSize.width(), m_textureSize.width());-
284 fboHeight = qMax(minimumFBOSize.height(), m_textureSize.height());-
285 }
executed 24 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
24
286-
287 m_fboSize = QSize(fboWidth, fboHeight);-
288}
executed 26 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
26
289-
290void QSGDefaultPainterNode::setPreferredRenderTarget(QQuickPaintedItem::RenderTarget target)-
291{-
292 if (m_preferredRenderTarget == target
m_preferredRen...rget == targetDescription
TRUEevaluated 50 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEnever evaluated
)
0-50
293 return;
executed 50 times by 1 test: return;
Executed by:
  • tst_qquickpainteditem
50
294-
295 m_preferredRenderTarget = target;-
296-
297 m_dirtyRenderTarget = true;-
298 m_dirtyGeometry = true;-
299 m_dirtyTexture = true;-
300}
never executed: end of block
0
301-
302void QSGDefaultPainterNode::setSize(const QSize &size)-
303{-
304 if (size == m_size
size == m_sizeDescription
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
)
22-28
305 return;
executed 28 times by 1 test: return;
Executed by:
  • tst_qquickpainteditem
28
306-
307 m_size = size;-
308 m_dirtyGeometry = true;-
309}
executed 22 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
22
310-
311void QSGDefaultPainterNode::setTextureSize(const QSize &size)-
312{-
313 if (size == m_textureSize
size == m_textureSizeDescription
TRUEevaluated 28 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
)
22-28
314 return;
executed 28 times by 1 test: return;
Executed by:
  • tst_qquickpainteditem
28
315-
316 m_textureSize = size;-
317 updateFBOSize();-
318-
319 if (m_fbo
m_fboDescription
TRUEnever evaluated
FALSEevaluated 22 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
)
0-22
320 m_dirtyRenderTarget = m_fbo->size() != m_fboSize
m_fbo->size() != m_fboSizeDescription
TRUEnever evaluated
FALSEnever evaluated
|| m_dirtyRenderTarget
m_dirtyRenderTargetDescription
TRUEnever evaluated
FALSEnever evaluated
;
never executed: m_dirtyRenderTarget = m_fbo->size() != m_fboSize || m_dirtyRenderTarget;
0
321 else-
322 m_dirtyRenderTarget = true;
executed 22 times by 1 test: m_dirtyRenderTarget = true;
Executed by:
  • tst_qquickpainteditem
22
323 m_dirtyGeometry = true;-
324 m_dirtyTexture = true;-
325}
executed 22 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
22
326-
327void QSGDefaultPainterNode::setDirty(const QRect &dirtyRect)-
328{-
329 m_dirtyContents = true;-
330 m_dirtyRect = dirtyRect;-
331-
332 if (m_mipmapping
m_mipmappingDescription
TRUEevaluated 2 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEevaluated 48 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
)
2-48
333 m_dirtyTexture = true;
executed 2 times by 1 test: m_dirtyTexture = true;
Executed by:
  • tst_qquickpainteditem
2
334-
335 markDirty(DirtyMaterial);-
336}
executed 50 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
50
337-
338void QSGDefaultPainterNode::setOpaquePainting(bool opaque)-
339{-
340 if (opaque == m_opaquePainting
opaque == m_opaquePaintingDescription
TRUEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
)
4-46
341 return;
executed 46 times by 1 test: return;
Executed by:
  • tst_qquickpainteditem
46
342-
343 m_opaquePainting = opaque;-
344 m_dirtyTexture = true;-
345}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
4
346-
347void QSGDefaultPainterNode::setLinearFiltering(bool linearFiltering)-
348{-
349 if (linearFiltering == m_linear_filtering
linearFilterin...near_filteringDescription
TRUEevaluated 34 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEevaluated 16 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
)
16-34
350 return;
executed 34 times by 1 test: return;
Executed by:
  • tst_qquickpainteditem
34
351-
352 m_linear_filtering = linearFiltering;-
353-
354 m_material.setFiltering(linearFiltering ? QSGTexture::Linear : QSGTexture::Nearest);-
355 m_materialO.setFiltering(linearFiltering ? QSGTexture::Linear : QSGTexture::Nearest);-
356 markDirty(DirtyMaterial);-
357}
executed 16 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
16
358-
359void QSGDefaultPainterNode::setMipmapping(bool mipmapping)-
360{-
361 if (mipmapping == m_mipmapping
mipmapping == m_mipmappingDescription
TRUEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
)
4-46
362 return;
executed 46 times by 1 test: return;
Executed by:
  • tst_qquickpainteditem
46
363-
364 m_mipmapping = mipmapping;-
365 m_material.setMipmapFiltering(mipmapping ? QSGTexture::Linear : QSGTexture::None);-
366 m_materialO.setMipmapFiltering(mipmapping ? QSGTexture::Linear : QSGTexture::None);-
367 m_dirtyTexture = true;-
368}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
4
369-
370void QSGDefaultPainterNode::setSmoothPainting(bool s)-
371{-
372 if (s == m_smoothPainting
s == m_smoothPaintingDescription
TRUEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
)
4-46
373 return;
executed 46 times by 1 test: return;
Executed by:
  • tst_qquickpainteditem
46
374-
375 m_smoothPainting = s;-
376 m_dirtyRenderTarget = true;-
377}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
4
378-
379void QSGDefaultPainterNode::setFillColor(const QColor &c)-
380{-
381 if (c == m_fillColor
c == m_fillColorDescription
TRUEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
)
4-46
382 return;
executed 46 times by 1 test: return;
Executed by:
  • tst_qquickpainteditem
46
383-
384 m_fillColor = c;-
385 markDirty(DirtyMaterial);-
386}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
4
387-
388void QSGDefaultPainterNode::setContentsScale(qreal s)-
389{-
390 if (s == m_contentsScale
s == m_contentsScaleDescription
TRUEevaluated 42 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEevaluated 8 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
)
8-42
391 return;
executed 42 times by 1 test: return;
Executed by:
  • tst_qquickpainteditem
42
392-
393 m_contentsScale = s;-
394 markDirty(DirtyMaterial);-
395}
executed 8 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
8
396-
397void QSGDefaultPainterNode::setFastFBOResizing(bool fastResizing)-
398{-
399 if (m_fastFBOResizing == fastResizing
m_fastFBOResiz...= fastResizingDescription
TRUEevaluated 46 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
)
4-46
400 return;
executed 46 times by 1 test: return;
Executed by:
  • tst_qquickpainteditem
46
401-
402 m_fastFBOResizing = fastResizing;-
403 updateFBOSize();-
404-
405 if ((m_preferredRenderTarget == QQuickPaintedItem::FramebufferObject
m_preferredRen...mebufferObjectDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
0-4
406 || m_preferredRenderTarget == QQuickPaintedItem::InvertedYFramebufferObject
m_preferredRen...mebufferObjectDescription
TRUEnever evaluated
FALSEevaluated 4 times by 1 test
Evaluated by:
  • tst_qquickpainteditem
)
0-4
407 && (!m_fbo
!m_fboDescription
TRUEnever evaluated
FALSEnever evaluated
|| (m_fbo
m_fboDescription
TRUEnever evaluated
FALSEnever evaluated
&& m_fbo->size() != m_fboSize
m_fbo->size() != m_fboSizeDescription
TRUEnever evaluated
FALSEnever evaluated
))) {
0
408 m_dirtyRenderTarget = true;-
409 m_dirtyGeometry = true;-
410 m_dirtyTexture = true;-
411 }
never executed: end of block
0
412}
executed 4 times by 1 test: end of block
Executed by:
  • tst_qquickpainteditem
4
413-
414QImage QSGDefaultPainterNode::toImage() const-
415{-
416 if (m_actualRenderTarget == QQuickPaintedItem::Image
m_actualRender...tedItem::ImageDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
417 return
never executed: return m_image;
m_image;
never executed: return m_image;
0
418 else-
419 return
never executed: return m_fbo->toImage();
m_fbo->toImage();
never executed: return m_fbo->toImage();
0
420}-
421-
422-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0