aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgdefaultrectanglenode.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@jollamobile.com>2014-04-25 15:34:55 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-30 10:13:35 +0200
commitcedd581762db0f100b167c5ec1865541aa743cae (patch)
treef651f2cfeea557578539b5dc8cd0c3dff9237e60 /src/quick/scenegraph/qsgdefaultrectanglenode.cpp
parentce5835e6f0d1ed64ace6732d8881ea97a3cb7f33 (diff)
Mark material as dirty after changing color's opacity in Rectangle.
Change-Id: I8037908bb2ba494001c516e2c7606c3bb54a14d8 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/quick/scenegraph/qsgdefaultrectanglenode.cpp')
-rw-r--r--src/quick/scenegraph/qsgdefaultrectanglenode.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/quick/scenegraph/qsgdefaultrectanglenode.cpp b/src/quick/scenegraph/qsgdefaultrectanglenode.cpp
index 810a503cee..467f454d0f 100644
--- a/src/quick/scenegraph/qsgdefaultrectanglenode.cpp
+++ b/src/quick/scenegraph/qsgdefaultrectanglenode.cpp
@@ -289,10 +289,22 @@ void QSGDefaultRectangleNode::update()
if (m_dirty_geometry) {
updateGeometry();
m_dirty_geometry = false;
+
+ QSGNode::DirtyState state = QSGNode::DirtyGeometry;
+ // smoothed material is always blended, so no change in material state
+ if (material() == &m_material) {
+ bool wasBlending = (m_material.flags() & QSGMaterial::Blending);
+ bool isBlending = (m_gradient_stops.size() > 0 && !m_gradient_is_opaque)
+ || (m_color.alpha() < 255 && m_color.alpha() != 0)
+ || (m_pen_width > 0 && m_border_color.alpha() < 255);
+ if (wasBlending != isBlending) {
+ m_material.setFlag(QSGMaterial::Blending, isBlending);
+ state |= QSGNode::DirtyMaterial;
+ }
+ }
+
+ markDirty(state);
}
- m_material.setFlag(QSGMaterial::Blending, (m_gradient_stops.size() > 0 && !m_gradient_is_opaque)
- || (m_color.alpha() < 255 && m_color.alpha() != 0)
- || (m_pen_width > 0 && m_border_color.alpha() < 255));
}
void QSGDefaultRectangleNode::updateGeometry()
@@ -770,8 +782,6 @@ void QSGDefaultRectangleNode::updateGeometry()
Q_ASSERT(outerAATail == indexCount);
}
}
-
- markDirty(DirtyGeometry);
}