Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/test_helpers.cpp
Show First 20 Lines • Show All 289 Lines • ▼ Show 20 Line(s) | 283 | { | |||
---|---|---|---|---|---|
290 | } | 290 | } | ||
291 | return hasKeyboardSpy.wait(); | 291 | return hasKeyboardSpy.wait(); | ||
292 | } | 292 | } | ||
293 | 293 | | |||
294 | void render(Surface *surface, const QSize &size, const QColor &color, const QImage::Format &format) | 294 | void render(Surface *surface, const QSize &size, const QColor &color, const QImage::Format &format) | ||
295 | { | 295 | { | ||
296 | QImage img(size, format); | 296 | QImage img(size, format); | ||
297 | img.fill(color); | 297 | img.fill(color); | ||
298 | render(surface, img); | ||||
299 | } | ||||
300 | | ||||
301 | void render(Surface *surface, const QImage &img) | ||||
302 | { | ||||
298 | surface->attachBuffer(s_waylandConnection.shm->createBuffer(img)); | 303 | surface->attachBuffer(s_waylandConnection.shm->createBuffer(img)); | ||
299 | surface->damage(QRect(QPoint(0, 0), size)); | 304 | surface->damage(QRect(QPoint(0, 0), img.size())); | ||
300 | surface->commit(Surface::CommitFlag::None); | 305 | surface->commit(Surface::CommitFlag::None); | ||
301 | } | 306 | } | ||
302 | 307 | | |||
303 | ShellClient *waitForWaylandWindowShown(int timeout) | 308 | ShellClient *waitForWaylandWindowShown(int timeout) | ||
304 | { | 309 | { | ||
305 | QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded); | 310 | QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded); | ||
306 | if (!clientAddedSpy.isValid()) { | 311 | if (!clientAddedSpy.isValid()) { | ||
307 | return nullptr; | 312 | return nullptr; | ||
▲ Show 20 Lines • Show All 158 Lines • Show Last 20 Lines |