widgets: Rename markDirtyOnScreen to markNeedsFlush

Including renaming the member touched by this function. This leaves the
logic for appendDirtyOnScreenWidget, which still needs investigating.

Change-Id: I405a5e3757f0a79992f88d9f70867aeb7b9764d8
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
bb10
Tor Arne Vestbø 2019-08-22 17:27:29 +02:00
parent ca3b48539d
commit 36d734b3f8
3 changed files with 20 additions and 20 deletions

View File

@ -5312,7 +5312,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
// Native widgets need to be marked dirty on screen so painting will be done in correct context
// Same check as in the no effects case below.
if (repaintManager && !onScreen && !asRoot && (q->internalWinId() || !q->nativeParentWidget()->isWindow()))
repaintManager->markDirtyOnScreen(rgn, q, offset);
repaintManager->markNeedsFlush(q, rgn, offset);
return;
}
@ -5420,7 +5420,7 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
// Native widgets need to be marked dirty on screen so painting will be done in correct context
if (repaintManager && !onScreen && !asRoot && (q->internalWinId() || (q->nativeParentWidget() && !q->nativeParentWidget()->isWindow())))
repaintManager->markDirtyOnScreen(toBePainted, q, offset);
repaintManager->markNeedsFlush(q, toBePainted, offset);
//restore
if (paintEngine) {

View File

@ -524,7 +524,7 @@ void QWidgetPrivate::moveRect(const QRect &rect, int dx, int dy)
if (childUpdatesEnabled) {
QRegion needsFlush(sourceRect);
needsFlush += destRect;
repaintManager->markDirtyOnScreen(needsFlush, pw, toplevelOffset);
repaintManager->markNeedsFlush(pw, needsFlush, toplevelOffset);
}
}
}
@ -604,7 +604,7 @@ void QWidgetPrivate::scrollRect(const QRect &rect, int dx, int dy)
// Instead of using native scroll-on-screen, we copy from
// backingstore, giving only one screen update for each
// scroll, and a solid appearance
repaintManager->markDirtyOnScreen(destRect, q, toplevelOffset);
repaintManager->markNeedsFlush(q, destRect, toplevelOffset);
}
}
@ -730,9 +730,9 @@ void QWidgetRepaintManager::sync(QWidget *exposedWidget, const QRegion &exposedR
}
if (exposedWidget != tlw)
markDirtyOnScreen(exposedRegion, exposedWidget, exposedWidget->mapTo(tlw, QPoint()));
markNeedsFlush(exposedWidget, exposedRegion, exposedWidget->mapTo(tlw, QPoint()));
else
markDirtyOnScreen(exposedRegion, exposedWidget, QPoint());
markNeedsFlush(exposedWidget, exposedRegion, QPoint());
if (syncAllowed())
paintAndFlush();
@ -966,7 +966,7 @@ void QWidgetRepaintManager::paintAndFlush()
#endif
// Always flush repainted areas
dirtyOnScreen += toClean;
needsFlush += toClean;
store->beginPaint(toClean);
@ -1010,12 +1010,12 @@ void QWidgetRepaintManager::paintAndFlush()
}
/*!
Marks the \a region of the \a widget as dirty on screen. The \a region will be copied from
Marks the \a region of the \a widget as needing a flush. The \a region will be copied from
the backing store to the \a widget's native parent next time flush() is called.
Paint on screen widgets are ignored.
*/
void QWidgetRepaintManager::markDirtyOnScreen(const QRegion &region, QWidget *widget, const QPoint &topLevelOffset)
void QWidgetRepaintManager::markNeedsFlush(QWidget *widget, const QRegion &region, const QPoint &topLevelOffset)
{
if (!widget || widget->d_func()->paintOnScreen() || region.isEmpty())
return;
@ -1023,7 +1023,7 @@ void QWidgetRepaintManager::markDirtyOnScreen(const QRegion &region, QWidget *wi
// Top-level.
if (widget == tlw) {
if (!widget->testAttribute(Qt::WA_WState_InPaintEvent))
dirtyOnScreen += region;
needsFlush += region;
return;
}
@ -1032,7 +1032,7 @@ void QWidgetRepaintManager::markDirtyOnScreen(const QRegion &region, QWidget *wi
QWidget *nativeParent = widget->nativeParentWidget(); // Alien widgets with the top-level as the native parent (common case).
if (nativeParent == tlw) {
if (!widget->testAttribute(Qt::WA_WState_InPaintEvent))
dirtyOnScreen += region.translated(topLevelOffset);
needsFlush += region.translated(topLevelOffset);
return;
}
@ -1070,15 +1070,15 @@ void QWidgetRepaintManager::flush(QWidget *widget)
const bool hasDirtyOnScreenWidgets = !dirtyOnScreenWidgets.isEmpty();
bool flushed = false;
// Flush the region in dirtyOnScreen.
if (!dirtyOnScreen.isEmpty()) {
// Flush the region in needsFlush
if (!needsFlush.isEmpty()) {
QWidget *target = widget ? widget : tlw;
flush(target, dirtyOnScreen, widgetTexturesFor(tlw, tlw));
dirtyOnScreen = QRegion();
flush(target, needsFlush, widgetTexturesFor(tlw, tlw));
needsFlush = QRegion();
flushed = true;
}
// Render-to-texture widgets are not in dirtyOnScreen so flush if we have not done it above.
// Render-to-texture widgets are not in needsFlush so flush if we have not done it above.
if (!flushed && !hasDirtyOnScreenWidgets) {
#ifndef QT_NO_OPENGL
if (!tlw->d_func()->topData()->widgetTextures.empty()) {
@ -1328,7 +1328,7 @@ QRegion QWidgetRepaintManager::dirtyRegion(QWidget *widget) const
}
// Append the region that needs flush.
r += dirtyOnScreen;
r += needsFlush;
for (QWidget *w : dirtyOnScreenWidgets) {
if (widgetDirty && w != widget && !widget->isAncestorOf(w))

View File

@ -91,7 +91,7 @@ public:
void sync(QWidget *exposedWidget, const QRegion &exposedRegion);
void sync();
void markDirtyOnScreen(const QRegion &dirtyOnScreen, QWidget *widget, const QPoint &topLevelOffset);
void markNeedsFlush(QWidget *widget, const QRegion &region, const QPoint &topLevelOffset);
void addStaticWidget(QWidget *widget);
void moveStaticWidgets(QWidget *reparented);
@ -130,10 +130,10 @@ private:
QBackingStore *store = nullptr;
QRegion dirty; // needsRepaint
QRegion dirtyOnScreen; // needsFlush
QVector<QWidget *> dirtyWidgets;
QVector<QWidget *> dirtyRenderToTextureWidgets;
QRegion needsFlush;
QVector<QWidget *> dirtyOnScreenWidgets;
QList<QWidget *> staticWidgets;