QWidgetBackingStore::markDirty(): Clamp dirty region to window size.

Graphics effects may exceed the window size, causing platform
backing store operations to fail (see QWidgetPrivate::effectiveRectFor()).

Task-number: QTBUG-49785
Change-Id: Iff16da599397d19acb86010fe7023f3ce15b6d6f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
This commit is contained in:
Friedemann Kleint 2015-12-09 10:50:40 +01:00
parent cf6d671a11
commit b6503d1795

View File

@ -641,7 +641,11 @@ void QWidgetBackingStore::markDirty(const QRect &rect, QWidget *widget,
const QRect widgetRect = widget->d_func()->effectiveRectFor(rect);
const QRect translatedRect(widgetRect.translated(widget->mapTo(tlw, QPoint())));
QRect translatedRect = widgetRect;
if (widget != tlw)
translatedRect.translate(widget->mapTo(tlw, QPoint()));
// Graphics effects may exceed window size, clamp.
translatedRect = translatedRect.intersected(QRect(QPoint(), tlw->size()));
if (qt_region_strictContains(dirty, translatedRect)) {
if (updateTime == UpdateNow)
sendUpdateRequest(tlw, updateTime);