summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGiulio Camuffo <giulio.camuffo@jollamobile.com>2015-02-13 14:37:58 +0200
committerGiulio Camuffo <giulio.camuffo@jollamobile.com>2015-03-19 09:22:04 +0000
commitf7aa5e201338606ecb3a7e4cb09c276e9fe53df6 (patch)
tree60fb1899131114cfc423f3f98e266d99d6260a76 /tests
parent8176dc7e292737adfd9d5f39607a84193ad9f819 (diff)
Fix the compositor test
Output handling in the compositor changed, so update the test accordingly. As a side effect we now send an additional wl_output.scale event, so have the client handle it. Also the mapping between wayland's and QImage's format changed so make it succeed again. Change-Id: I66d32725c54d93ca1512a6a0ddaf466f58984afc Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/compositor/mockclient.cpp10
-rw-r--r--tests/auto/compositor/mockclient.h1
-rw-r--r--tests/auto/compositor/testcompositor.cpp1
3 files changed, 10 insertions, 2 deletions
diff --git a/tests/auto/compositor/mockclient.cpp b/tests/auto/compositor/mockclient.cpp
index 8f7d1e825..33847da7d 100644
--- a/tests/auto/compositor/mockclient.cpp
+++ b/tests/auto/compositor/mockclient.cpp
@@ -83,7 +83,8 @@ MockClient::MockClient()
const wl_output_listener MockClient::outputListener = {
MockClient::outputGeometryEvent,
MockClient::outputModeEvent,
- MockClient::outputDone
+ MockClient::outputDone,
+ MockClient::outputScale
};
MockClient::~MockClient()
@@ -111,6 +112,11 @@ void MockClient::outputDone(void *, wl_output *)
}
+void MockClient::outputScale(void *, wl_output *, int)
+{
+
+}
+
void MockClient::readEvents()
{
wl_display_dispatch(display);
@@ -185,7 +191,7 @@ ShmBuffer::ShmBuffer(const QSize &size, wl_shm *shm)
return;
}
- image = QImage(static_cast<uchar *>(data), size.width(), size.height(), stride, QImage::Format_ARGB32_Premultiplied);
+ image = QImage(static_cast<uchar *>(data), size.width(), size.height(), stride, QImage::Format_ARGB32);
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);
diff --git a/tests/auto/compositor/mockclient.h b/tests/auto/compositor/mockclient.h
index 7b6b2b1f4..8647205f2 100644
--- a/tests/auto/compositor/mockclient.h
+++ b/tests/auto/compositor/mockclient.h
@@ -101,6 +101,7 @@ private:
int height,
int refresh);
static void outputDone(void *data, wl_output *output);
+ static void outputScale(void *data, wl_output *output, int factor);
void handleGlobal(uint32_t id, const QByteArray &interface);
diff --git a/tests/auto/compositor/testcompositor.cpp b/tests/auto/compositor/testcompositor.cpp
index b2e8b0eea..95dd87e3c 100644
--- a/tests/auto/compositor/testcompositor.cpp
+++ b/tests/auto/compositor/testcompositor.cpp
@@ -35,6 +35,7 @@
TestCompositor::TestCompositor(QWaylandCompositor::ExtensionFlag flags) : QWaylandCompositor(0, flags)
{
+ createOutput(0, "", "");
addDefaultShell();
}