Changeset View
Changeset View
Standalone View
Standalone View
autotests/client/test_wayland_surface.cpp
Show First 20 Lines • Show All 283 Lines • ▼ Show 20 Line(s) | 263 | { | |||
---|---|---|---|---|---|
284 | QCoreApplication::processEvents(); | 284 | QCoreApplication::processEvents(); | ||
285 | QVERIFY(damageSpy.isEmpty()); | 285 | QVERIFY(damageSpy.isEmpty()); | ||
286 | QVERIFY(!serverSurface->isMapped()); | 286 | QVERIFY(!serverSurface->isMapped()); | ||
287 | QCOMPARE(committedSpy.count(), 1); | 287 | QCOMPARE(committedSpy.count(), 1); | ||
288 | 288 | | |||
289 | QImage img(QSize(10, 10), QImage::Format_ARGB32_Premultiplied); | 289 | QImage img(QSize(10, 10), QImage::Format_ARGB32_Premultiplied); | ||
290 | img.fill(Qt::black); | 290 | img.fill(Qt::black); | ||
291 | auto b = m_shm->createBuffer(img); | 291 | auto b = m_shm->createBuffer(img); | ||
292 | s->attachBuffer(b); | 292 | s->attachBuffer(b, QPoint(55, 55)); | ||
293 | s->damage(QRect(0, 0, 10, 10)); | 293 | s->damage(QRect(0, 0, 10, 10)); | ||
294 | s->commit(KWayland::Client::Surface::CommitFlag::None); | 294 | s->commit(KWayland::Client::Surface::CommitFlag::None); | ||
295 | QVERIFY(damageSpy.wait()); | 295 | QVERIFY(damageSpy.wait()); | ||
296 | QCOMPARE(serverSurface->offset(), QPoint(55, 55)); // offset is surface local so scale doesn't change this | ||||
296 | QCOMPARE(serverSurface->damage(), QRegion(0, 0, 5, 5)); // scale is 2 | 297 | QCOMPARE(serverSurface->damage(), QRegion(0, 0, 5, 5)); // scale is 2 | ||
297 | QCOMPARE(damageSpy.first().first().value<QRegion>(), QRegion(0, 0, 5, 5)); | 298 | QCOMPARE(damageSpy.first().first().value<QRegion>(), QRegion(0, 0, 5, 5)); | ||
298 | QVERIFY(serverSurface->isMapped()); | 299 | QVERIFY(serverSurface->isMapped()); | ||
299 | QCOMPARE(committedSpy.count(), 2); | 300 | QCOMPARE(committedSpy.count(), 2); | ||
300 | 301 | | |||
301 | // damage multiple times | 302 | // damage multiple times | ||
302 | QRegion testRegion(5, 8, 3, 6); | 303 | QRegion testRegion(5, 8, 3, 6); | ||
303 | testRegion = testRegion.united(QRect(10, 11, 6, 1)); | 304 | testRegion = testRegion.united(QRect(10, 11, 6, 1)); | ||
▲ Show 20 Lines • Show All 913 Lines • Show Last 20 Lines |