summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/qwaylandshmbackingstore.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/client/qwaylandshmbackingstore.cpp b/src/client/qwaylandshmbackingstore.cpp
index 64e93d947..8eab510bf 100644
--- a/src/client/qwaylandshmbackingstore.cpp
+++ b/src/client/qwaylandshmbackingstore.cpp
@@ -49,6 +49,9 @@
#include <QMutexLocker>
#include <wayland-client.h>
+#include <wayland-client-protocol.h>
+#include "qwaylandshmformathelper.h"
+
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
@@ -89,12 +92,13 @@ QWaylandShmBuffer::QWaylandShmBuffer(QWaylandDisplay *display,
return;
}
+ wl_shm_format wl_format = QWaylandShmFormatHelper::fromQImageFormat(format);
mImage = QImage(data, size.width(), size.height(), stride, format);
mImage.setDevicePixelRatio(qreal(scale));
mShmPool = wl_shm_create_pool(display->shm(), fd, alloc);
mBuffer = wl_shm_pool_create_buffer(mShmPool,0, size.width(), size.height(),
- stride, WL_SHM_FORMAT_ARGB8888);
+ stride, wl_format);
close(fd);
}