From 2dc17a45fb586ef81fca43d60f079d053b66ac12 Mon Sep 17 00:00:00 2001 From: Matthias Rauter Date: Tue, 6 Jun 2023 09:23:30 +0200 Subject: 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 --- .../adaptations/software/qsgabstractsoftwarerenderer.cpp | 8 ++++++-- 1 file 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); } -- cgit v1.2.3