QWindowsBackingStore: Implement scroll.

Similar to XCB.

Task-number: QTBUG-24299
Task-number: QTBUG-24296 (partially fixed)

Change-Id: I4c9d813d9645f957f2caad0c4e395ce0d3d222cc
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
This commit is contained in:
Friedemann Kleint 2012-05-18 16:08:20 +02:00 committed by Qt by Nokia
parent 09c90c9fc3
commit 061968d082
4 changed files with 15 additions and 7 deletions

View File

@ -121,6 +121,20 @@ void QWindowsBackingStore::resize(const QSize &size, const QRegion &region)
}
}
Q_GUI_EXPORT void qt_scrollRectInImage(QImage &img, const QRect &rect, const QPoint &offset);
bool QWindowsBackingStore::scroll(const QRegion &area, int dx, int dy)
{
if (m_image.isNull() || m_image->image().isNull())
return false;
const QVector<QRect> rects = area.rects();
for (int i = 0; i < rects.size(); ++i)
qt_scrollRectInImage(m_image->image(), rects.at(i), QPoint(dx, dy));
return true;
}
void QWindowsBackingStore::beginPaint(const QRegion &region)
{
Q_UNUSED(region);

View File

@ -62,6 +62,7 @@ public:
virtual QPaintDevice *paintDevice();
virtual void flush(QWindow *window, const QRegion &region, const QPoint &offset);
virtual void resize(const QSize &size, const QRegion &r);
virtual bool scroll(const QRegion &area, int dx, int dy);
virtual void beginPaint(const QRegion &);
HDC getDC() const;

View File

@ -3423,9 +3423,6 @@ void tst_QGraphicsView::moveItemWhileScrolling()
int a = adjustForAntialiasing ? 2 : 1;
expectedRegion += QRect(40, 50, 10, 10).adjusted(-a, -a, a, a);
expectedRegion += QRect(40, 60, 10, 10).adjusted(-a, -a, a, a);
#ifdef Q_OS_WIN
QEXPECT_FAIL("", "QTBUG-24296", Abort);
#endif
COMPARE_REGIONS(view.lastPaintedRegion, expectedRegion);
}
@ -4389,9 +4386,7 @@ void tst_QGraphicsView::task259503_scrollingArtifacts()
if (itSTimeToTest)
{
#ifndef Q_OS_WIN
QEXPECT_FAIL("", "QTBUG-24296", Continue);
#endif
QCOMPARE(event->region(), updateRegion);
}
}

View File

@ -5,5 +5,3 @@ QT += core-private gui-private
SOURCES += tst_qlistwidget.cpp
contains(QT_CONFIG,xcb):CONFIG+=insignificant_test # QTBUG-21098, fails unstably
win32:CONFIG += insignificant_test # QTBUG-24299