Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/pointer_input.cpp
Show First 20 Lines • Show All 1042 Lines • ▼ Show 20 Line(s) | 983 | { | |||
---|---|---|---|---|---|
1043 | cursorSurface->damage(QRect(0, 0, 10, 10)); | 1043 | cursorSurface->damage(QRect(0, 0, 10, 10)); | ||
1044 | cursorSurface->commit(); | 1044 | cursorSurface->commit(); | ||
1045 | QVERIFY(cursorRenderedSpy.wait()); | 1045 | QVERIFY(cursorRenderedSpy.wait()); | ||
1046 | QTRY_COMPARE(p->cursorImage(), blue); | 1046 | QTRY_COMPARE(p->cursorImage(), blue); | ||
1047 | QCOMPARE(p->cursorHotSpot(), QPoint(6, 6)); | 1047 | QCOMPARE(p->cursorHotSpot(), QPoint(6, 6)); | ||
1048 | 1048 | | |||
1049 | // scaled cursor | 1049 | // scaled cursor | ||
1050 | QImage blueScaled = QImage(QSize(20, 20), QImage::Format_ARGB32_Premultiplied); | 1050 | QImage blueScaled = QImage(QSize(20, 20), QImage::Format_ARGB32_Premultiplied); | ||
1051 | blueScaled.setDevicePixelRatio(2); | ||||
1051 | blueScaled.fill(Qt::blue); | 1052 | blueScaled.fill(Qt::blue); | ||
1052 | auto bs = Test::waylandShmPool()->createBuffer(blueScaled); | 1053 | auto bs = Test::waylandShmPool()->createBuffer(blueScaled); | ||
1053 | cursorSurface->attachBuffer(bs); | 1054 | cursorSurface->attachBuffer(bs); | ||
1054 | cursorSurface->setScale(2); | 1055 | cursorSurface->setScale(2); | ||
1055 | cursorSurface->damage(QRect(0, 0, 20, 20)); | 1056 | cursorSurface->damage(QRect(0, 0, 20, 20)); | ||
1056 | cursorSurface->commit(); | 1057 | cursorSurface->commit(); | ||
1057 | QVERIFY(cursorRenderedSpy.wait()); | 1058 | QVERIFY(cursorRenderedSpy.wait()); | ||
1058 | QTRY_COMPARE(p->cursorImage(), blueScaled); | 1059 | QTRY_COMPARE(p->cursorImage(), blueScaled); | ||
1059 | QCOMPARE(p->cursorImage().devicePixelRatio(), 2.0); | | |||
1060 | QCOMPARE(p->cursorHotSpot(), QPoint(6, 6)); //surface-local (so not changed) | 1060 | QCOMPARE(p->cursorHotSpot(), QPoint(6, 6)); //surface-local (so not changed) | ||
1061 | 1061 | | |||
1062 | // hide the cursor | 1062 | // hide the cursor | ||
1063 | pointer->setCursor(nullptr); | 1063 | pointer->setCursor(nullptr); | ||
1064 | Test::flushWaylandConnection(); | 1064 | Test::flushWaylandConnection(); | ||
1065 | QTRY_VERIFY(p->cursorImage().isNull()); | 1065 | QTRY_VERIFY(p->cursorImage().isNull()); | ||
1066 | 1066 | | |||
1067 | // move cursor somewhere else, should reset to fallback cursor | 1067 | // move cursor somewhere else, should reset to fallback cursor | ||
▲ Show 20 Lines • Show All 566 Lines • Show Last 20 Lines |