widgets: Clarify top level flush region in QWidgetRepaintManager
Change-Id: I9a8d11569d33bf580bd50b710cf072952ea3626b Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
This commit is contained in:
parent
dbab68a127
commit
787314c230
@ -964,7 +964,7 @@ void QWidgetRepaintManager::paintAndFlush()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Always flush repainted areas
|
// Always flush repainted areas
|
||||||
needsFlush += toClean;
|
topLevelNeedsFlush += toClean;
|
||||||
|
|
||||||
store->beginPaint(toClean);
|
store->beginPaint(toClean);
|
||||||
|
|
||||||
@ -1021,13 +1021,13 @@ void QWidgetRepaintManager::markNeedsFlush(QWidget *widget, const QRegion ®io
|
|||||||
if (widget == tlw) {
|
if (widget == tlw) {
|
||||||
// Top-level (native)
|
// Top-level (native)
|
||||||
if (!widget->testAttribute(Qt::WA_WState_InPaintEvent))
|
if (!widget->testAttribute(Qt::WA_WState_InPaintEvent))
|
||||||
needsFlush += region;
|
topLevelNeedsFlush += region;
|
||||||
} else if (!hasPlatformWindow(widget) && !widget->isWindow()) {
|
} else if (!hasPlatformWindow(widget) && !widget->isWindow()) {
|
||||||
QWidget *nativeParent = widget->nativeParentWidget();
|
QWidget *nativeParent = widget->nativeParentWidget();
|
||||||
if (nativeParent == tlw) {
|
if (nativeParent == tlw) {
|
||||||
// Alien widgets with the top-level as the native parent (common case)
|
// Alien widgets with the top-level as the native parent (common case)
|
||||||
if (!widget->testAttribute(Qt::WA_WState_InPaintEvent))
|
if (!widget->testAttribute(Qt::WA_WState_InPaintEvent))
|
||||||
needsFlush += region.translated(topLevelOffset);
|
topLevelNeedsFlush += region.translated(topLevelOffset);
|
||||||
} else {
|
} else {
|
||||||
// Alien widgets with native parent != tlw
|
// Alien widgets with native parent != tlw
|
||||||
const QPoint nativeParentOffset = widget->mapTo(nativeParent, QPoint());
|
const QPoint nativeParentOffset = widget->mapTo(nativeParent, QPoint());
|
||||||
@ -1063,11 +1063,11 @@ void QWidgetRepaintManager::flush(QWidget *widget)
|
|||||||
const bool hasDirtyOnScreenWidgets = !dirtyOnScreenWidgets.isEmpty();
|
const bool hasDirtyOnScreenWidgets = !dirtyOnScreenWidgets.isEmpty();
|
||||||
bool flushed = false;
|
bool flushed = false;
|
||||||
|
|
||||||
// Flush the region in needsFlush
|
// Flush the top level widget
|
||||||
if (!needsFlush.isEmpty()) {
|
if (!topLevelNeedsFlush.isEmpty()) {
|
||||||
QWidget *target = widget ? widget : tlw;
|
QWidget *target = widget ? widget : tlw;
|
||||||
flush(target, needsFlush, widgetTexturesFor(tlw, tlw));
|
flush(target, topLevelNeedsFlush, widgetTexturesFor(tlw, tlw));
|
||||||
needsFlush = QRegion();
|
topLevelNeedsFlush = QRegion();
|
||||||
flushed = true;
|
flushed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1321,7 +1321,7 @@ QRegion QWidgetRepaintManager::dirtyRegion(QWidget *widget) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Append the region that needs flush.
|
// Append the region that needs flush.
|
||||||
r += needsFlush;
|
r += topLevelNeedsFlush;
|
||||||
|
|
||||||
for (QWidget *w : dirtyOnScreenWidgets) {
|
for (QWidget *w : dirtyOnScreenWidgets) {
|
||||||
if (widgetDirty && w != widget && !widget->isAncestorOf(w))
|
if (widgetDirty && w != widget && !widget->isAncestorOf(w))
|
||||||
|
@ -133,7 +133,7 @@ private:
|
|||||||
QVector<QWidget *> dirtyWidgets;
|
QVector<QWidget *> dirtyWidgets;
|
||||||
QVector<QWidget *> dirtyRenderToTextureWidgets;
|
QVector<QWidget *> dirtyRenderToTextureWidgets;
|
||||||
|
|
||||||
QRegion needsFlush;
|
QRegion topLevelNeedsFlush;
|
||||||
QVector<QWidget *> dirtyOnScreenWidgets;
|
QVector<QWidget *> dirtyOnScreenWidgets;
|
||||||
|
|
||||||
QList<QWidget *> staticWidgets;
|
QList<QWidget *> staticWidgets;
|
||||||
|
Loading…
Reference in New Issue
Block a user