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>
This commit is contained in:
Matthias Rauter 2023-06-06 09:23:30 +02:00
parent b478224053
commit 2dc17a45fb
1 changed files with 6 additions and 2 deletions

View File

@ -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);
}