diff options
author | Antti Määttä <antti.maatta@qt.io> | 2021-10-12 12:28:32 +0300 |
---|---|---|
committer | Antti Määttä <antti.maatta@qt.io> | 2021-10-19 07:28:47 +0300 |
commit | 378ff29b29d597fb9d4316be1da35402fefd33de (patch) | |
tree | 1f78989982472ea8c9c34e21852efa8788c44096 /src | |
parent | 8662fbdd7e0c8c5b089a3c9871ae0cd71790858e (diff) |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/kernel/qwidgetrepaintmanager.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/widgets/kernel/qwidgetrepaintmanager.cpp b/src/widgets/kernel/qwidgetrepaintmanager.cpp index 1997f76b1d..977a746c5a 100644 --- a/src/widgets/kernel/qwidgetrepaintmanager.cpp +++ b/src/widgets/kernel/qwidgetrepaintmanager.cpp @@ -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); |