widgets: Simplify QWidgetRepaintManager::flush
Change-Id: Icba88fa068aac2ac5d8bb04e46a3e3f34e279a48 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
This commit is contained in:
parent
4cc3615b4e
commit
3542fc4958
@ -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
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user