Commit f7aa5e20 authored by Giulio Camuffo's avatar Giulio Camuffo
Browse files

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: default avatarRobin Burchell <robin.burchell@viroteck.net>
parent 8176dc7e
No related merge requests found
Showing with 10 additions and 2 deletions
...@@ -83,7 +83,8 @@ MockClient::MockClient() ...@@ -83,7 +83,8 @@ MockClient::MockClient()
const wl_output_listener MockClient::outputListener = { const wl_output_listener MockClient::outputListener = {
MockClient::outputGeometryEvent, MockClient::outputGeometryEvent,
MockClient::outputModeEvent, MockClient::outputModeEvent,
MockClient::outputDone MockClient::outputDone,
MockClient::outputScale
}; };
MockClient::~MockClient() MockClient::~MockClient()
...@@ -111,6 +112,11 @@ void MockClient::outputDone(void *, wl_output *) ...@@ -111,6 +112,11 @@ void MockClient::outputDone(void *, wl_output *)
} }
void MockClient::outputScale(void *, wl_output *, int)
{
}
void MockClient::readEvents() void MockClient::readEvents()
{ {
wl_display_dispatch(display); wl_display_dispatch(display);
...@@ -185,7 +191,7 @@ ShmBuffer::ShmBuffer(const QSize &size, wl_shm *shm) ...@@ -185,7 +191,7 @@ ShmBuffer::ShmBuffer(const QSize &size, wl_shm *shm)
return; 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); shm_pool = wl_shm_create_pool(shm,fd,alloc);
handle = wl_shm_pool_create_buffer(shm_pool,0, size.width(), size.height(), handle = wl_shm_pool_create_buffer(shm_pool,0, size.width(), size.height(),
stride, WL_SHM_FORMAT_ARGB8888); stride, WL_SHM_FORMAT_ARGB8888);
......
...@@ -101,6 +101,7 @@ private: ...@@ -101,6 +101,7 @@ private:
int height, int height,
int refresh); int refresh);
static void outputDone(void *data, wl_output *output); 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); void handleGlobal(uint32_t id, const QByteArray &interface);
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
TestCompositor::TestCompositor(QWaylandCompositor::ExtensionFlag flags) : QWaylandCompositor(0, flags) TestCompositor::TestCompositor(QWaylandCompositor::ExtensionFlag flags) : QWaylandCompositor(0, flags)
{ {
createOutput(0, "", "");
addDefaultShell(); addDefaultShell();
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment