widgets: Remove unused member QTLWExtra::inTopLevelResize

It was introduced in Qt 4.4 (e150f6a6e619) to work around slow resizes
on Windows and X11 due to excessive painting, but has since been removed
when old dead code never ported to QPA was removed in a2337f79ffd229.

Change-Id: Ic14e714a02edb4194a445a6bb0759b601799fdc6
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
This commit is contained in:
Tor Arne Vestbø 2020-03-17 14:49:06 +01:00
parent cfbe481838
commit 5f3c071ee3
4 changed files with 7 additions and 16 deletions

View File

@ -1592,7 +1592,6 @@ void QWidgetPrivate::createTLExtra()
x->opacity = 255; x->opacity = 255;
x->posIncludesFrame = 0; x->posIncludesFrame = 0;
x->sizeAdjusted = false; x->sizeAdjusted = false;
x->inTopLevelResize = false;
x->embedded = 0; x->embedded = 0;
x->window = nullptr; x->window = nullptr;
x->initialScreenIndex = -1; x->initialScreenIndex = -1;
@ -10790,7 +10789,7 @@ void QWidgetPrivate::repaint(T r)
return; return;
QTLWExtra *tlwExtra = q->window()->d_func()->maybeTopData(); QTLWExtra *tlwExtra = q->window()->d_func()->maybeTopData();
if (tlwExtra && !tlwExtra->inTopLevelResize && tlwExtra->backingStore) if (tlwExtra && tlwExtra->backingStore)
tlwExtra->repaintManager->markDirty(r, q, QWidgetRepaintManager::UpdateNow); tlwExtra->repaintManager->markDirty(r, q, QWidgetRepaintManager::UpdateNow);
} }
@ -10865,7 +10864,7 @@ void QWidgetPrivate::update(T r)
} }
QTLWExtra *tlwExtra = q->window()->d_func()->maybeTopData(); QTLWExtra *tlwExtra = q->window()->d_func()->maybeTopData();
if (tlwExtra && !tlwExtra->inTopLevelResize && tlwExtra->backingStore) if (tlwExtra && tlwExtra->backingStore)
tlwExtra->repaintManager->markDirty(clipped, q); tlwExtra->repaintManager->markDirty(clipped, q);
} }

View File

@ -155,7 +155,6 @@ struct QTLWExtra {
uint opacity : 8; uint opacity : 8;
uint posIncludesFrame : 1; uint posIncludesFrame : 1;
uint sizeAdjusted : 1; uint sizeAdjusted : 1;
uint inTopLevelResize : 1;
uint embedded : 1; uint embedded : 1;
}; };

View File

@ -166,7 +166,7 @@ void QWidgetPrivate::invalidateBackingStore(const T &r)
return; return;
QTLWExtra *tlwExtra = q->window()->d_func()->maybeTopData(); QTLWExtra *tlwExtra = q->window()->d_func()->maybeTopData();
if (!tlwExtra || tlwExtra->inTopLevelResize || !tlwExtra->backingStore) if (!tlwExtra || !tlwExtra->backingStore)
return; return;
T clipped(r); T clipped(r);
@ -213,7 +213,6 @@ void QWidgetRepaintManager::markDirty(const T &r, QWidget *widget, UpdateTime up
Q_ASSERT(tlw->d_func()->extra); Q_ASSERT(tlw->d_func()->extra);
Q_ASSERT(tlw->d_func()->extra->topextra); Q_ASSERT(tlw->d_func()->extra->topextra);
Q_ASSERT(!tlw->d_func()->extra->topextra->inTopLevelResize);
Q_ASSERT(widget->isVisible() && widget->updatesEnabled()); Q_ASSERT(widget->isVisible() && widget->updatesEnabled());
Q_ASSERT(widget->window() == tlw); Q_ASSERT(widget->window() == tlw);
Q_ASSERT(!r.isEmpty()); Q_ASSERT(!r.isEmpty());
@ -446,8 +445,6 @@ void QWidgetPrivate::moveRect(const QRect &rect, int dx, int dy)
QWidget *tlw = q->window(); QWidget *tlw = q->window();
QTLWExtra* x = tlw->d_func()->topData(); QTLWExtra* x = tlw->d_func()->topData();
if (x->inTopLevelResize)
return;
static const bool accelEnv = qEnvironmentVariableIntValue("QT_NO_FAST_MOVE") == 0; static const bool accelEnv = qEnvironmentVariableIntValue("QT_NO_FAST_MOVE") == 0;
@ -543,8 +540,6 @@ void QWidgetPrivate::scrollRect(const QRect &rect, int dx, int dy)
Q_Q(QWidget); Q_Q(QWidget);
QWidget *tlw = q->window(); QWidget *tlw = q->window();
QTLWExtra* x = tlw->d_func()->topData(); QTLWExtra* x = tlw->d_func()->topData();
if (x->inTopLevelResize)
return;
QWidgetRepaintManager *repaintManager = x->repaintManager.get(); QWidgetRepaintManager *repaintManager = x->repaintManager.get();
if (!repaintManager) if (!repaintManager)
@ -722,8 +717,7 @@ void QWidgetRepaintManager::sync(QWidget *exposedWidget, const QRegion &exposedR
{ {
qCInfo(lcWidgetPainting) << "Syncing" << exposedRegion << "of" << exposedWidget; qCInfo(lcWidgetPainting) << "Syncing" << exposedRegion << "of" << exposedWidget;
QTLWExtra *tlwExtra = tlw->d_func()->maybeTopData(); if (!tlw->isVisible())
if (!tlw->isVisible() || !tlwExtra || tlwExtra->inTopLevelResize)
return; return;
if (!exposedWidget || !hasPlatformWindow(exposedWidget) if (!exposedWidget || !hasPlatformWindow(exposedWidget)
@ -815,10 +809,9 @@ void QWidgetRepaintManager::paintAndFlush()
const bool updatesDisabled = !tlw->updatesEnabled(); const bool updatesDisabled = !tlw->updatesEnabled();
bool repaintAllWidgets = false; bool repaintAllWidgets = false;
const bool inTopLevelResize = tlw->d_func()->maybeTopData()->inTopLevelResize;
const QRect tlwRect = tlw->data->crect; const QRect tlwRect = tlw->data->crect;
const QRect surfaceGeometry(tlwRect.topLeft(), store->size()); const QRect surfaceGeometry(tlwRect.topLeft(), store->size());
if ((inTopLevelResize || surfaceGeometry.size() != tlwRect.size()) && !updatesDisabled) { if ((surfaceGeometry.size() != tlwRect.size()) && !updatesDisabled) {
if (hasStaticContents() && !store->size().isEmpty() ) { if (hasStaticContents() && !store->size().isEmpty() ) {
// Repaint existing dirty area and newly visible area. // Repaint existing dirty area and newly visible area.
const QRect clipRect(0, 0, surfaceGeometry.width(), surfaceGeometry.height()); const QRect clipRect(0, 0, surfaceGeometry.width(), surfaceGeometry.height());
@ -837,7 +830,7 @@ void QWidgetRepaintManager::paintAndFlush()
} }
} }
if (inTopLevelResize || surfaceGeometry.size() != tlwRect.size()) if (surfaceGeometry.size() != tlwRect.size())
store->resize(tlwRect.size()); store->resize(tlwRect.size());
if (updatesDisabled) if (updatesDisabled)

View File

@ -764,7 +764,7 @@ void QWidgetWindow::repaintWindow()
return; return;
QTLWExtra *tlwExtra = m_widget->window()->d_func()->maybeTopData(); QTLWExtra *tlwExtra = m_widget->window()->d_func()->maybeTopData();
if (tlwExtra && !tlwExtra->inTopLevelResize && tlwExtra->backingStore) if (tlwExtra && tlwExtra->backingStore)
tlwExtra->repaintManager->markDirty(m_widget->rect(), m_widget, tlwExtra->repaintManager->markDirty(m_widget->rect(), m_widget,
QWidgetRepaintManager::UpdateNow, QWidgetRepaintManager::BufferInvalid); QWidgetRepaintManager::UpdateNow, QWidgetRepaintManager::BufferInvalid);
} }