aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@theqtcompany.com>2016-06-20 14:45:29 +0200
committerAndy Nichols <andy.nichols@qt.io>2016-06-20 14:23:02 +0000
commitcc4954e9646cd93d9710e4e28942d2a82762771e (patch)
treea34a5c5773c381674b77b8ce4835cd9a7fce1738 /src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp
parentc884f85863d5cbb90d8a1f3972ddb37b3d3f7e14 (diff)
Software Renderer: Call QBackingStore::beginPaint with correct QRegion
When rendering into QBackingStores, it is important to let the backingstore know what region you intended to paint into before you start rendering. Previously we were calling QBackingStore::beginPaint on the whole window area, but then only rendering and flushing for a subset of that area. This causes issues on platforms that depend on QBackingStore::beginPaint to be all area that will be repainted before the next flush, so that they can for example clear those areas. This change required a bit of extra plumbing in the Software Renderer, but now it is possible to calculate the area that will be repainted before painting it, and pass that region to QBackingStore::beginPaint(). Change-Id: I90be1916ebbe8fc182cd13246bb6690cc7e16d27 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp')
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp b/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp
index eb0e26462a..26efba5b13 100644
--- a/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp
+++ b/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp
@@ -149,7 +149,7 @@ void QSGAbstractSoftwareRenderer::buildRenderList()
QSGSoftwareRenderListBuilder(this).visitChildren(rootNode());
}
-void QSGAbstractSoftwareRenderer::optimizeRenderList()
+QRegion QSGAbstractSoftwareRenderer::optimizeRenderList()
{
// Iterate through the renderlist from front to back
// Objective is to update the dirty status and rects.
@@ -212,9 +212,13 @@ void QSGAbstractSoftwareRenderer::optimizeRenderList()
m_dirtyRegion += node->dirtyRegion();
}
+ QRegion updateRegion = m_dirtyRegion;
+
// Empty dirtyRegion
m_dirtyRegion = QRegion();
m_obscuredRegion = QRegion();
+
+ return updateRegion;
}
void QSGAbstractSoftwareRenderer::setBackgroundColor(const QColor &color)