diff options
author | Andy Nichols <[email protected]> | 2024-12-16 14:45:11 +0100 |
---|---|---|
committer | Andy Nichols <[email protected]> | 2024-12-17 09:28:55 +0100 |
commit | 6f653fff7f6865a35c89f4163713134ff7a2b26e (patch) | |
tree | 499097327d28a9c49ca938815aa2c31ef2df35a9 /src/quick/scenegraph/adaptations/software | |
parent | 3b13d2033e35ac4e546264c5d86bb8362dcae81e (diff) |
Software Renderer: Ensure flushing of previously dirty regions
Previously, if an opaque item was moved completely behind another opaque
item between frames, the previous region occupied by the item might not
be flushed. This occurred because, when subtracting the obscured region
from the node’s dirty region, the dirty region could become empty. In
such cases, the node would mark itself as no longer dirty, resulting in
no flushing for the next frame. This could cause the old position of the
item not to be cleared properly.
To address this issue, additional logic has been added to ensure that
the previous dirty region is still flushed, even in this edge case.
Fixes: QTBUG-132192
Pick-to: 6.9 6.8 6.5
Change-Id: Iad45ddeeb65e70090e8368d94245b13692017fd1
Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>
Diffstat (limited to 'src/quick/scenegraph/adaptations/software')
-rw-r--r-- | src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp b/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp index 50caeff85d..4f420cf945 100644 --- a/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp @@ -125,6 +125,10 @@ QRegion QSGAbstractSoftwareRenderer::optimizeRenderList() // Objective is to update the dirty status and rects. for (auto i = m_renderableNodes.rbegin(); i != m_renderableNodes.rend(); ++i) { auto node = *i; + // Track the original version of isDirty() as it can change if + // when we subtract dirty regions but still need to mark the previously + // dirty region as dirty. + const bool wasDirty = node->isDirty(); if (!m_dirtyRegion.isEmpty()) { // See if the current dirty regions apply to the current node node->addDirtyRegion(m_dirtyRegion, true); @@ -158,7 +162,11 @@ QRegion QSGAbstractSoftwareRenderer::optimizeRenderList() // if isAlpha, add node's dirty rect to m_dirtyRegion m_dirtyRegion += node->dirtyRegion(); } - // if previousDirtyRegion has content outside of boundingRect add to m_dirtyRegion + } + + if (wasDirty) { + // If this node started out dirty, make sure its previous region is + // added to the dirty region so that it gets cleared properly. QRegion prevDirty = node->previousDirtyRegion(); if (!prevDirty.isNull()) m_dirtyRegion += prevDirty; |