summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-10-31 09:26:35 +0100
committerLiang Qi <liang.qi@qt.io>2016-10-31 09:26:35 +0100
commit8e20daae9fee5f3b999daffce0d7156015ee974b (patch)
tree7adcc397fd378cbb97c186ddb78c226b61906583 /src/widgets/kernel
parent5545e5aa6e265469d278e1fb576a737535784422 (diff)
parent694702e09d9b17d91db282784f009178cfb1059b (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: src/plugins/platforms/minimalegl/qminimaleglintegration.cpp Change-Id: Ia6ab42a6daadbf8abc085c971545904d49ea4b56
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qwidget_p.h3
-rw-r--r--src/widgets/kernel/qwidgetbackingstore.cpp10
2 files changed, 8 insertions, 5 deletions
diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h
index 19b7238a70..4426a6d415 100644
--- a/src/widgets/kernel/qwidget_p.h
+++ b/src/widgets/kernel/qwidget_p.h
@@ -401,9 +401,6 @@ public:
const QRegion &rgn, const QPoint &offset, int flags,
QPainter *sharedPainter, QWidgetBackingStore *backingStore);
-
- QPainter *beginSharedPainter();
- bool endSharedPainter();
#ifndef QT_NO_GRAPHICSVIEW
static QGraphicsProxyWidget * nearestGraphicsProxyWidget(const QWidget *origin);
#endif
diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp
index ac8902c9e6..185a66731b 100644
--- a/src/widgets/kernel/qwidgetbackingstore.cpp
+++ b/src/widgets/kernel/qwidgetbackingstore.cpp
@@ -112,6 +112,7 @@ void QWidgetBackingStore::qt_flush(QWidget *widget, const QRegion &region, QBack
if (widget != tlw)
offset += widget->mapTo(tlw, QPoint());
+ QRegion effectiveRegion = region;
#ifndef QT_NO_OPENGL
const bool compositionWasActive = widget->d_func()->renderToTextureComposeActive;
if (!widgetTextures) {
@@ -125,6 +126,11 @@ void QWidgetBackingStore::qt_flush(QWidget *widget, const QRegion &region, QBack
} else {
widget->d_func()->renderToTextureComposeActive = true;
}
+ // When changing the composition status, make sure the dirty region covers
+ // the entire widget. Just having e.g. the shown/hidden render-to-texture
+ // widget's area marked as dirty is incorrect when changing flush paths.
+ if (compositionWasActive != widget->d_func()->renderToTextureComposeActive)
+ effectiveRegion = widget->rect();
// re-test since we may have been forced to this path via the dummy texture list above
if (widgetTextures) {
@@ -136,12 +142,12 @@ void QWidgetBackingStore::qt_flush(QWidget *widget, const QRegion &region, QBack
const bool translucentBackground = widget->testAttribute(Qt::WA_TranslucentBackground);
// Use the tlw's context, not widget's. The difference is important with native child
// widgets where tlw != widget.
- backingStore->handle()->composeAndFlush(widget->windowHandle(), region, offset, widgetTextures,
+ backingStore->handle()->composeAndFlush(widget->windowHandle(), effectiveRegion, offset, widgetTextures,
tlw->d_func()->shareContext(), translucentBackground);
widget->window()->d_func()->sendComposeStatus(widget->window(), true);
} else
#endif
- backingStore->flush(region, widget->windowHandle(), offset);
+ backingStore->flush(effectiveRegion, widget->windowHandle(), offset);
}
#ifndef QT_NO_PAINT_DEBUG