summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylandshmbackingstore.cpp
diff options
context:
space:
mode:
authorJorgen Lind <jorgen.lind@theqtcompany.com>2014-12-25 20:42:56 +0100
committerJørgen Lind <jorgen.lind@theqtcompany.com>2015-02-05 07:12:15 +0000
commit2322ef51948ef20afb3a93d1fea7830dfee4f7d6 (patch)
treea48e95e243954fb14fe782318efeacbd08aea918 /src/client/qwaylandshmbackingstore.cpp
parent18c16b7caeafe3fbd745a18e54af0dd0b40e54b3 (diff)
Add a SHM format converter class
This class helps keeing one lookuptable for server and client It relies on that wayland-(client|server)-protocol.h being included before the qwaylandshmformathelper.h Change-Id: I12158126a80c8fef5c52427d35792f33716020f1 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
Diffstat (limited to 'src/client/qwaylandshmbackingstore.cpp')
-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);
}