From 2322ef51948ef20afb3a93d1fea7830dfee4f7d6 Mon Sep 17 00:00:00 2001 From: Jorgen Lind Date: Thu, 25 Dec 2014 20:42:56 +0100 Subject: 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 --- src/client/qwaylandshmbackingstore.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/client') 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 #include +#include +#include "qwaylandshmformathelper.h" + #include #include #include @@ -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); } -- cgit v1.2.3