aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@qt.io>2017-11-23 12:19:08 +0100
committerAndy Nichols <andy.nichols@qt.io>2017-11-23 13:17:30 +0000
commit9e77d75a6286951783bab3f9c5fb98fd52f315b8 (patch)
treea386e15c13007d14a5f879d3105e788dad40e17e /src
parenta79feeee451bcf28673292555795677a789e8513 (diff)
Software Adaptation: Fix cliping logic error with empty clip regions
The previous fix for nested clip regions introduced a regression which broke nested clipping cases that involved one of the clip nodes being null regions because they were offscreen. The clip region stack can either have an null QRegion or be empty as an initial state (depends on what is being rendered). We made a special check for these two states, but it is not enough to check if the top item is null for the null region case beacuse at any point in time a null clip region node could have been added. So to fix this the null initial state also requires a count of 1. Task-number: QTBUG-63743 Change-Id: Ib0d17026f1d5a663e819412e11d25d9ad8b445ff Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater.cpp
index 666f1d0616..fabecfcbb8 100644
--- a/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater.cpp
+++ b/src/quick/scenegraph/adaptations/software/qsgsoftwarerenderablenodeupdater.cpp
@@ -83,7 +83,7 @@ void QSGSoftwareRenderableNodeUpdater::endVisit(QSGTransformNode *)
bool QSGSoftwareRenderableNodeUpdater::visit(QSGClipNode *node)
{
// Make sure to translate the clip rect into world coordinates
- if (m_clipState.count() == 0 || m_clipState.top().isNull()) {
+ if (m_clipState.count() == 0 || (m_clipState.count() == 1 && m_clipState.top().isNull())) {
m_clipState.push(m_transformState.top().map(QRegion(node->clipRect().toRect())));
m_hasClip = true;
} else {
@@ -97,7 +97,7 @@ bool QSGSoftwareRenderableNodeUpdater::visit(QSGClipNode *node)
void QSGSoftwareRenderableNodeUpdater::endVisit(QSGClipNode *)
{
m_clipState.pop();
- if (m_clipState.count() == 0 || m_clipState.top().isNull())
+ if (m_clipState.count() == 0 || (m_clipState.count() == 1 && m_clipState.top().isNull()))
m_hasClip = false;
}