diff options
author | Simon Ser <contact@emersion.fr> | 2021-02-23 17:32:26 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-02-23 17:33:08 +0100 |
commit | c2815fd44de5d74e379c118b4ccded5a9419e32c (patch) | |
tree | b4b03c0e806ea0406d1ab4459fa1059c4b81d4ce | |
parent | 3695ae97b4518e72694d5c015552515e7b4dfaee (diff) |
buffer: add missing convert_wl_shm_format_to_drm call
Fixes: 27fba3df4347 ("render: use DRM formats in wlr_texture_from_pixels")
Closes: https://github.com/swaywm/wlroots/issues/2757
-rw-r--r-- | types/wlr_buffer.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/types/wlr_buffer.c b/types/wlr_buffer.c index 0ead9e09..b631fa99 100644 --- a/types/wlr_buffer.c +++ b/types/wlr_buffer.c @@ -4,6 +4,7 @@ #include <wlr/types/wlr_buffer.h> #include <wlr/types/wlr_linux_dmabuf_v1.h> #include <wlr/util/log.h> +#include "render/shm_format.h" #include "util/signal.h" void wlr_buffer_init(struct wlr_buffer *buffer, @@ -182,14 +183,15 @@ struct wlr_client_buffer *wlr_client_buffer_import( struct wl_shm_buffer *shm_buf = wl_shm_buffer_get(resource); if (shm_buf != NULL) { - enum wl_shm_format fmt = wl_shm_buffer_get_format(shm_buf); + enum wl_shm_format wl_shm_format = wl_shm_buffer_get_format(shm_buf); + uint32_t drm_format = convert_wl_shm_format_to_drm(wl_shm_format); int32_t stride = wl_shm_buffer_get_stride(shm_buf); int32_t width = wl_shm_buffer_get_width(shm_buf); int32_t height = wl_shm_buffer_get_height(shm_buf); wl_shm_buffer_begin_access(shm_buf); void *data = wl_shm_buffer_get_data(shm_buf); - texture = wlr_texture_from_pixels(renderer, fmt, stride, + texture = wlr_texture_from_pixels(renderer, drm_format, stride, width, height, data); wl_shm_buffer_end_access(shm_buf); |