summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-08-26 16:23:46 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-08-28 10:41:29 +0200
commit3542fc4958918dc855f2e867eccb880daa621069 (patch)
treed6245fb7daef0f99455ea50de1c6b9e478570cf9 /src/widgets/kernel
parent4cc3615b4e3b48f8fda19f0165ad542da9b39768 (diff)
widgets: Simplify QWidgetRepaintManager::flush
Change-Id: Icba88fa068aac2ac5d8bb04e46a3e3f34e279a48 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qwidgetrepaintmanager.cpp13
-rw-r--r--src/widgets/kernel/qwidgetrepaintmanager_p.h2
2 files changed, 5 insertions, 10 deletions
diff --git a/src/widgets/kernel/qwidgetrepaintmanager.cpp b/src/widgets/kernel/qwidgetrepaintmanager.cpp
index 11647ae05e..6b5ca4b594 100644
--- a/src/widgets/kernel/qwidgetrepaintmanager.cpp
+++ b/src/widgets/kernel/qwidgetrepaintmanager.cpp
@@ -1063,17 +1063,15 @@ void QWidgetRepaintManager::markNeedsFlush(QWidget *widget, const QRegion &regio
/*!
Flushes the contents of the backing store into the top-level widget.
- If the \a widget is non-zero, the content is flushed to the \a widget.
*/
-void QWidgetRepaintManager::flush(QWidget *widget)
+void QWidgetRepaintManager::flush()
{
const bool hasNeedsFlushWidgets = !needsFlushWidgets.isEmpty();
bool flushed = false;
// Flush the top level widget
if (!topLevelNeedsFlush.isEmpty()) {
- QWidget *target = widget ? widget : tlw;
- flush(target, topLevelNeedsFlush, widgetTexturesFor(tlw, tlw));
+ flush(tlw, topLevelNeedsFlush, widgetTexturesFor(tlw, tlw));
topLevelNeedsFlush = QRegion();
flushed = true;
}
@@ -1082,11 +1080,8 @@ void QWidgetRepaintManager::flush(QWidget *widget)
if (!flushed && !hasNeedsFlushWidgets) {
#ifndef QT_NO_OPENGL
if (!tlw->d_func()->topData()->widgetTextures.empty()) {
- QPlatformTextureList *widgetTextures = widgetTexturesFor(tlw, tlw);
- if (widgetTextures) {
- QWidget *target = widget ? widget : tlw;
- flush(target, QRegion(), widgetTextures);
- }
+ if (QPlatformTextureList *widgetTextures = widgetTexturesFor(tlw, tlw))
+ flush(tlw, QRegion(), widgetTextures);
}
#endif
}
diff --git a/src/widgets/kernel/qwidgetrepaintmanager_p.h b/src/widgets/kernel/qwidgetrepaintmanager_p.h
index e81eee0816..d7e38a9d69 100644
--- a/src/widgets/kernel/qwidgetrepaintmanager_p.h
+++ b/src/widgets/kernel/qwidgetrepaintmanager_p.h
@@ -115,7 +115,7 @@ private:
void markNeedsFlush(QWidget *widget, const QRegion &region = QRegion());
- void flush(QWidget *widget = nullptr);
+ void flush();
void flush(QWidget *widget, const QRegion &region, QPlatformTextureList *widgetTextures);
bool isDirty() const;