summaryrefslogtreecommitdiffstats
path: root/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp')
-rw-r--r--src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp
index 1ed1fefd8..8f12590dd 100644
--- a/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp
+++ b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp
@@ -50,6 +50,9 @@
#include <QtCore/QDebug>
+#include <wayland-server-protocol.h>
+#include "qwaylandshmformathelper.h"
+
QT_BEGIN_NAMESPACE
namespace QtWayland {
@@ -235,7 +238,8 @@ QImage SurfaceBuffer::image()
int stride = wl_shm_buffer_get_stride(m_shmBuffer);
int width = wl_shm_buffer_get_width(m_shmBuffer);
int height = wl_shm_buffer_get_height(m_shmBuffer);
- m_image = QImage(data, width, height, stride, QImage::Format_ARGB32_Premultiplied);
+ QImage::Format format = QWaylandShmFormatHelper::fromWaylandShmFormat(wl_shm_format(wl_shm_buffer_get_format(m_shmBuffer)));
+ m_image = QImage(data, width, height, stride, format);
}
return m_image;