Don't render widget to backing store if its parent has graphics effect

If widget parent has graphics effect, it can't render directly to the
backing store, because the backing store needs to be updated from the
parents effect drawing instead of the widget drawing.

Pick-to: 6.2 5.15
Fixes: QTBUG-96240
Change-Id: Ib9b55547f9e5538f32837ec9df45d29fa68d7c1b
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
bb10
Antti Määttä 2021-10-12 12:28:32 +03:00
parent 8662fbdd7e
commit 378ff29b29
1 changed files with 14 additions and 1 deletions

View File

@ -801,6 +801,18 @@ bool QWidgetRepaintManager::syncAllowed()
return true;
}
static bool isDrawnInEffect(const QWidget *w)
{
#if QT_CONFIG(graphicseffect)
do {
if (w->graphicsEffect())
return true;
w = w->parentWidget();
} while (w);
#endif
return false;
}
void QWidgetRepaintManager::paintAndFlush()
{
qCInfo(lcWidgetPainting) << "Painting and flushing dirty"
@ -888,7 +900,8 @@ void QWidgetRepaintManager::paintAndFlush()
}
#endif
if (!hasDirtySiblingsAbove && wd->isOpaque && !dirty.intersects(widgetDirty.boundingRect())) {
if (!isDrawnInEffect(w) && !hasDirtySiblingsAbove && wd->isOpaque
&& !dirty.intersects(widgetDirty.boundingRect())) {
opaqueNonOverlappedWidgets.append(w);
} else {
resetWidget(w);