Mark DirtySubtreeBlocked correctly from OpacityNode
authorGunnar Sletta <gunnar.sletta@digia.com>
Tue, 1 Oct 2013 07:11:54 +0000 (09:11 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 3 Oct 2013 06:52:11 +0000 (08:52 +0200)
In the edgecase where the opacity was exactly the OPACITY_THRESHOLD
we would fail to mark the tree as dirty. This led to a crash
in the renderer.

Change-Id: I618910d0c792a215133598b6a87217be1f8729bc
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
src/quick/scenegraph/coreapi/qsgnode.cpp

index d4241b7..b0c869c 100644 (file)
@@ -1323,8 +1323,8 @@ void QSGOpacityNode::setOpacity(qreal opacity)
         return;
     DirtyState dirtyState = DirtyOpacity;
 
-    if ((m_opacity < OPACITY_THRESHOLD && opacity > OPACITY_THRESHOLD)
-        || (m_opacity > OPACITY_THRESHOLD && opacity < OPACITY_THRESHOLD))
+    if ((m_opacity < OPACITY_THRESHOLD && opacity >= OPACITY_THRESHOLD)     // blocked to unblocked
+        || (m_opacity >= OPACITY_THRESHOLD && opacity < OPACITY_THRESHOLD)) // unblocked to blocked
         dirtyState |= DirtySubtreeBlocked;
 
     m_opacity = opacity;