aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/adaptations/software
diff options
context:
space:
mode:
authorMatthias Rauter <[email protected]>2023-06-06 09:23:30 +0200
committerMatthias Rauter <[email protected]>2023-06-07 14:14:47 +0200
commit2dc17a45fb586ef81fca43d60f079d053b66ac12 (patch)
tree891e68edf706316572497883f929103b6a07a81b /src/quick/scenegraph/adaptations/software
parentb478224053e59957f66b5636a291cb6478ca2ccd (diff)
Software renderer: Add floating point nodes to dirty list
m_obscuredRegion avoids overpainting of nodes that are not updated. However, due to the integer precision of QRegion, this mechanism does not work for nodes with a bounding rectangle with floats. Currently we add boundingRectMin to m_obscuredRegion, however, which is not sufficient. Nodes where the boundingRectMin is different from the real boundingRect (and boundingRectMax) can not be added correctly to m_obscuredRegion. Therefore these nodes are now also set to dirty and updated. Fixes: QTBUG-113745 Change-Id: I5cc5540ed45593b09b312a1704459e95bebab521 Reviewed-by: Andy Nichols <[email protected]>
Diffstat (limited to 'src/quick/scenegraph/adaptations/software')
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp b/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp
index d33919f344..c9385630d9 100644
--- a/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp
+++ b/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp
@@ -178,8 +178,12 @@ QRegion QSGAbstractSoftwareRenderer::optimizeRenderList()
for (auto j = m_renderableNodes.begin(); j != m_renderableNodes.end(); ++j) {
auto node = *j;
- if (!node->isOpaque() && !m_dirtyRegion.isEmpty()) {
- // Only blended nodes need to be updated
+ if ((!node->isOpaque() || node->boundingRectMax() != node->boundingRectMin()) && !m_dirtyRegion.isEmpty()) {
+ // Blended nodes need to be updated
+ // QTBUG-113745: Also nodes with floating point boundary rectangles need to
+ // be updated. The reason is that m_obscuredRegion contains only the rounded
+ // down bounding rectangle (node->boundingRectMin()) and thus not the whole
+ // node. As a result up to 1 pixel would be overpainted when it should not.
node->addDirtyRegion(m_dirtyRegion, true);
}