From 3542fc4958918dc855f2e867eccb880daa621069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 26 Aug 2019 16:23:46 +0200 Subject: [PATCH] widgets: Simplify QWidgetRepaintManager::flush Change-Id: Icba88fa068aac2ac5d8bb04e46a3e3f34e279a48 Reviewed-by: Paul Olav Tvete --- src/widgets/kernel/qwidgetrepaintmanager.cpp | 13 ++++--------- src/widgets/kernel/qwidgetrepaintmanager_p.h | 2 +- 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 ®io /*! 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 ®ion = QRegion()); - void flush(QWidget *widget = nullptr); + void flush(); void flush(QWidget *widget, const QRegion ®ion, QPlatformTextureList *widgetTextures); bool isDirty() const;