aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Rauter <matthias.rauter@qt.io>2023-06-06 09:23:30 +0200
committerMatthias Rauter <matthias.rauter@qt.io>2023-06-12 18:06:36 +0200
commitb53b28380291dd7a6a358a415a9ad6fd4fb7803d (patch)
tree23c195f1f9b6bff1e3c90ff875e8f1cb03407af8
parent6aa623168e5ef833dc21808f17fa6326ce71e717 (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 <andy.nichols@qt.io> (cherry picked from commit 2dc17a45fb586ef81fca43d60f079d053b66ac12)
-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);
}