diff options
Diffstat (limited to 'src/widgets/kernel/qwidgetrepaintmanager.cpp')
-rw-r--r-- | src/widgets/kernel/qwidgetrepaintmanager.cpp | 41 |
1 files changed, 16 insertions, 25 deletions
diff --git a/src/widgets/kernel/qwidgetrepaintmanager.cpp b/src/widgets/kernel/qwidgetrepaintmanager.cpp index c3211e275f..e7e85c39e7 100644 --- a/src/widgets/kernel/qwidgetrepaintmanager.cpp +++ b/src/widgets/kernel/qwidgetrepaintmanager.cpp @@ -166,7 +166,7 @@ void QWidgetPrivate::invalidateBackingStore(const T &r) return; QTLWExtra *tlwExtra = q->window()->d_func()->maybeTopData(); - if (!tlwExtra || tlwExtra->inTopLevelResize || !tlwExtra->backingStore) + if (!tlwExtra || !tlwExtra->backingStore) return; 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->topextra); - Q_ASSERT(!tlw->d_func()->extra->topextra->inTopLevelResize); Q_ASSERT(widget->isVisible() && widget->updatesEnabled()); Q_ASSERT(widget->window() == tlw); Q_ASSERT(!r.isEmpty()); @@ -446,8 +445,6 @@ void QWidgetPrivate::moveRect(const QRect &rect, int dx, int dy) QWidget *tlw = q->window(); QTLWExtra* x = tlw->d_func()->topData(); - if (x->inTopLevelResize) - return; 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); QWidget *tlw = q->window(); QTLWExtra* x = tlw->d_func()->topData(); - if (x->inTopLevelResize) - return; QWidgetRepaintManager *repaintManager = x->repaintManager.get(); if (!repaintManager) @@ -695,7 +690,7 @@ static QPlatformTextureList *widgetTexturesFor(QWidget *tlw, QWidget *widget) return qt_dummy_platformTextureList(); } - return 0; + return nullptr; } #else @@ -722,8 +717,7 @@ void QWidgetRepaintManager::sync(QWidget *exposedWidget, const QRegion &exposedR { qCInfo(lcWidgetPainting) << "Syncing" << exposedRegion << "of" << exposedWidget; - QTLWExtra *tlwExtra = tlw->d_func()->maybeTopData(); - if (!tlw->isVisible() || !tlwExtra || tlwExtra->inTopLevelResize) + if (!tlw->isVisible()) return; if (!exposedWidget || !hasPlatformWindow(exposedWidget) @@ -788,7 +782,7 @@ bool QWidgetRepaintManager::syncAllowed() QTLWExtra *tlwExtra = tlw->d_func()->maybeTopData(); if (textureListWatcher && !textureListWatcher->isLocked()) { textureListWatcher->deleteLater(); - textureListWatcher = 0; + textureListWatcher = nullptr; } else if (!tlwExtra->widgetTextures.empty()) { bool skipSync = false; for (const auto &tl : tlwExtra->widgetTextures) { @@ -815,14 +809,12 @@ void QWidgetRepaintManager::paintAndFlush() const bool updatesDisabled = !tlw->updatesEnabled(); bool repaintAllWidgets = false; - const bool inTopLevelResize = tlw->d_func()->maybeTopData()->inTopLevelResize; const QRect tlwRect = tlw->data->crect; - const QRect surfaceGeometry(tlwRect.topLeft(), store->size()); - if ((inTopLevelResize || surfaceGeometry.size() != tlwRect.size()) && !updatesDisabled) { + if (!updatesDisabled && store->size() != tlwRect.size()) { if (hasStaticContents() && !store->size().isEmpty() ) { // Repaint existing dirty area and newly visible area. - const QRect clipRect(0, 0, surfaceGeometry.width(), surfaceGeometry.height()); - const QRegion staticRegion(staticContents(0, clipRect)); + const QRect clipRect(QPoint(0, 0), store->size()); + const QRegion staticRegion(staticContents(nullptr, clipRect)); QRegion newVisible(0, 0, tlwRect.width(), tlwRect.height()); newVisible -= staticRegion; dirty += newVisible; @@ -837,7 +829,7 @@ void QWidgetRepaintManager::paintAndFlush() } } - if (inTopLevelResize || surfaceGeometry.size() != tlwRect.size()) + if (store->size() != tlwRect.size()) store->resize(tlwRect.size()); if (updatesDisabled) @@ -1008,13 +1000,13 @@ void QWidgetRepaintManager::paintAndFlush() QPoint offset; if (w != tlw) offset += w->mapTo(tlw, QPoint()); - wd->drawWidget(store->paintDevice(), toBePainted, offset, flags, 0, this); + wd->drawWidget(store->paintDevice(), toBePainted, offset, flags, nullptr, this); } // Paint the rest with composition. if (repaintAllWidgets || !dirtyCopy.isEmpty()) { QWidgetPrivate::DrawWidgetFlags flags = QWidgetPrivate::DrawAsRoot | QWidgetPrivate::DrawRecursive; - tlw->d_func()->drawWidget(store->paintDevice(), dirtyCopy, QPoint(), flags, 0, this); + tlw->d_func()->drawWidget(store->paintDevice(), dirtyCopy, QPoint(), flags, nullptr, this); } store->endPaint(); @@ -1108,7 +1100,7 @@ void QWidgetRepaintManager::flush() for (QWidget *w : qExchange(needsFlushWidgets, {})) { QWidgetPrivate *wd = w->d_func(); Q_ASSERT(wd->needsFlush); - QPlatformTextureList *widgetTexturesForNative = wd->textureChildSeen ? widgetTexturesFor(tlw, w) : 0; + QPlatformTextureList *widgetTexturesForNative = wd->textureChildSeen ? widgetTexturesFor(tlw, w) : nullptr; flush(w, *wd->needsFlush, widgetTexturesForNative); *wd->needsFlush = QRegion(); } @@ -1248,11 +1240,10 @@ bool QWidgetRepaintManager::hasStaticContents() const QRegion QWidgetRepaintManager::staticContents(QWidget *parent, const QRect &withinClipRect) const { if (!parent && tlw->testAttribute(Qt::WA_StaticContents)) { - const QSize surfaceGeometry(store->size()); - QRect surfaceRect(0, 0, surfaceGeometry.width(), surfaceGeometry.height()); + QRect backingstoreRect(QPoint(0, 0), store->size()); if (!withinClipRect.isEmpty()) - surfaceRect &= withinClipRect; - return QRegion(surfaceRect); + backingstoreRect &= withinClipRect; + return QRegion(backingstoreRect); } QRegion region; @@ -1284,7 +1275,7 @@ QRegion QWidgetRepaintManager::staticContents(QWidget *parent, const QRect &with wd->clipToEffectiveMask(visible); if (visible.isEmpty()) continue; - wd->subtractOpaqueSiblings(visible, 0, /*alsoNonOpaque=*/true); + wd->subtractOpaqueSiblings(visible, nullptr, /*alsoNonOpaque=*/true); visible.translate(offset); region += visible; @@ -1331,7 +1322,7 @@ void QWidgetPrivate::invalidateBackingStore_resizeHelper(const QPoint &oldPos, c if (!staticContents || graphicsEffect) { QRegion staticChildren; - QWidgetRepaintManager *bs = 0; + QWidgetRepaintManager *bs = nullptr; if (offset.isNull() && (bs = maybeRepaintManager())) staticChildren = bs->staticContents(q, oldWidgetRect); const bool hasStaticChildren = !staticChildren.isEmpty(); |