aboutsummaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-02-16 19:41:40 +0100
committerSimon Ser <contact@emersion.fr>2021-02-23 16:09:26 +0100
commit27fba3df4347df65fbb8b0781ae407e410ef458b (patch)
tree8bf0d47cb3370e4a77e331982a616c5c8fa128b4 /render
parentb54ef3372d5c6f01b97b26cf449617122a628e8a (diff)
render: use DRM formats in wlr_texture_from_pixels
Diffstat (limited to 'render')
-rw-r--r--render/gles2/renderer.c1
-rw-r--r--render/gles2/texture.c7
-rw-r--r--render/wlr_texture.c6
3 files changed, 6 insertions, 8 deletions
diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c
index 437a606a..196d0573 100644
--- a/render/gles2/renderer.c
+++ b/render/gles2/renderer.c
@@ -15,7 +15,6 @@
#include <wlr/types/wlr_linux_dmabuf_v1.h>
#include <wlr/util/log.h>
#include "render/gles2.h"
-#include "render/shm_format.h"
static const GLfloat verts[] = {
1, 0, // top right
diff --git a/render/gles2/texture.c b/render/gles2/texture.c
index e2d492f5..a3400eb2 100644
--- a/render/gles2/texture.c
+++ b/render/gles2/texture.c
@@ -12,7 +12,6 @@
#include <wlr/types/wlr_matrix.h>
#include <wlr/util/log.h>
#include "render/gles2.h"
-#include "render/shm_format.h"
#include "util/signal.h"
static const struct wlr_texture_impl texture_impl;
@@ -153,14 +152,14 @@ static const struct wlr_texture_impl texture_impl = {
};
struct wlr_texture *gles2_texture_from_pixels(struct wlr_renderer *wlr_renderer,
- enum wl_shm_format wl_fmt, uint32_t stride, uint32_t width,
+ uint32_t drm_format, uint32_t stride, uint32_t width,
uint32_t height, const void *data) {
struct wlr_gles2_renderer *renderer = gles2_get_renderer(wlr_renderer);
const struct wlr_gles2_pixel_format *fmt =
- get_gles2_format_from_drm(convert_wl_shm_format_to_drm(wl_fmt));
+ get_gles2_format_from_drm(drm_format);
if (fmt == NULL) {
- wlr_log(WLR_ERROR, "Unsupported pixel format %"PRIu32, wl_fmt);
+ wlr_log(WLR_ERROR, "Unsupported pixel format 0x%"PRIX32, drm_format);
return NULL;
}
diff --git a/render/wlr_texture.c b/render/wlr_texture.c
index b0b22565..e9a3e3b4 100644
--- a/render/wlr_texture.c
+++ b/render/wlr_texture.c
@@ -20,9 +20,9 @@ void wlr_texture_destroy(struct wlr_texture *texture) {
}
struct wlr_texture *wlr_texture_from_pixels(struct wlr_renderer *renderer,
- enum wl_shm_format wl_fmt, uint32_t stride, uint32_t width,
- uint32_t height, const void *data) {
- return renderer->impl->texture_from_pixels(renderer, wl_fmt, stride, width,
+ uint32_t fmt, uint32_t stride, uint32_t width, uint32_t height,
+ const void *data) {
+ return renderer->impl->texture_from_pixels(renderer, fmt, stride, width,
height, data);
}