diff options
author | Erik Larsson <erik@ortogonal.com> | 2016-01-30 16:50:41 +0100 |
---|---|---|
committer | Erik Larsson <erik@ortogonal.com> | 2016-03-21 12:53:45 +0000 |
commit | 178dc4df9c3f625b95413b597eaaad2216aec729 (patch) | |
tree | 720d2fbd2591c19416fc1fc4e5a90e10911cc274 /tests/auto/compositor/mockclient.cpp | |
parent | 35792cab1a4a6c414127867f86f4b19cfec20385 (diff) |
Test: Make compositor tests runnable with new API
Fix compilation errors and make all compositor tests runnable with the
new compositor API. Some input handling tests are reworked so they are
able to function with the new compositor API.
Also make sure client and cmake tests are built even if not compiled
with a wayland-compositor.
Change-Id: I0f03e2c04f2736860f770b6100ccfa3300ff8da4
Reviewed-by: Johan Helsing <johan.helsing@theqtcompany.com>
Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Diffstat (limited to 'tests/auto/compositor/mockclient.cpp')
-rw-r--r-- | tests/auto/compositor/mockclient.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/auto/compositor/mockclient.cpp b/tests/auto/compositor/mockclient.cpp index fd7fedfe1..d4765b894 100644 --- a/tests/auto/compositor/mockclient.cpp +++ b/tests/auto/compositor/mockclient.cpp @@ -45,7 +45,7 @@ const struct wl_registry_listener MockClient::registryListener = { }; MockClient::MockClient() - : display(wl_display_connect(0)) + : display(wl_display_connect("wayland-qt-test-0")) , compositor(0) , output(0) , registry(0) @@ -93,6 +93,8 @@ void MockClient::outputGeometryEvent(void *data, wl_output *, int, const char *, const char *, int32_t ) { + Q_UNUSED(width); + Q_UNUSED(height); resolve(data)->geometry.moveTopLeft(QPoint(x, y)); } @@ -125,6 +127,8 @@ void MockClient::flushDisplay() void MockClient::handleGlobal(void *data, wl_registry *registry, uint32_t id, const char *interface, uint32_t version) { + Q_UNUSED(registry); + Q_UNUSED(version); resolve(data)->handleGlobal(id, QByteArray(interface)); } @@ -186,7 +190,7 @@ ShmBuffer::ShmBuffer(const QSize &size, wl_shm *shm) return; } - image = QImage(static_cast<uchar *>(data), size.width(), size.height(), stride, QImage::Format_ARGB32); + image = QImage(static_cast<uchar *>(data), size.width(), size.height(), stride, QImage::Format_ARGB32_Premultiplied); shm_pool = wl_shm_create_pool(shm,fd,alloc); handle = wl_shm_pool_create_buffer(shm_pool,0, size.width(), size.height(), stride, WL_SHM_FORMAT_ARGB8888); |