aboutsummaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorSimon Zeni <simon@bl4ckb0ne.ca>2021-04-23 13:51:05 -0400
committerSimon Ser <contact@emersion.fr>2021-04-28 20:55:57 +0200
commit982498fab3c4d0aee9b29312559cbdd317c563a1 (patch)
tree096ca681801764a47296a32712e17576d530beb1 /render
parent144189674edbf908d72467cd497a0250b3d80b8b (diff)
render: introduce renderer_get_render_buffer_caps
Diffstat (limited to 'render')
-rw-r--r--render/gles2/renderer.c6
-rw-r--r--render/pixman/renderer.c5
-rw-r--r--render/wlr_renderer.c5
3 files changed, 16 insertions, 0 deletions
diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c
index 79861e8f..d81aed5a 100644
--- a/render/gles2/renderer.c
+++ b/render/gles2/renderer.c
@@ -17,6 +17,7 @@
#include <wlr/util/log.h>
#include "render/gles2.h"
#include "render/pixel_format.h"
+#include "types/wlr_buffer.h"
static const GLfloat verts[] = {
1, 0, // top right
@@ -526,6 +527,10 @@ static int gles2_get_drm_fd(struct wlr_renderer *wlr_renderer) {
return renderer->drm_fd;
}
+static uint32_t gles2_get_render_buffer_caps(void) {
+ return WLR_BUFFER_CAP_DMABUF;
+}
+
struct wlr_egl *wlr_gles2_renderer_get_egl(struct wlr_renderer *wlr_renderer) {
struct wlr_gles2_renderer *renderer =
gles2_get_renderer(wlr_renderer);
@@ -590,6 +595,7 @@ static const struct wlr_renderer_impl renderer_impl = {
.texture_from_dmabuf = gles2_texture_from_dmabuf,
.init_wl_display = gles2_init_wl_display,
.get_drm_fd = gles2_get_drm_fd,
+ .get_render_buffer_caps = gles2_get_render_buffer_caps,
};
void push_gles2_debug_(struct wlr_gles2_renderer *renderer,
diff --git a/render/pixman/renderer.c b/render/pixman/renderer.c
index d85c11a1..7680e171 100644
--- a/render/pixman/renderer.c
+++ b/render/pixman/renderer.c
@@ -403,6 +403,10 @@ static bool pixman_read_pixels(struct wlr_renderer *wlr_renderer,
return true;
}
+static uint32_t pixman_get_render_buffer_caps(void) {
+ return WLR_BUFFER_CAP_DATA_PTR;
+}
+
static const struct wlr_renderer_impl renderer_impl = {
.begin = pixman_begin,
.clear = pixman_clear,
@@ -416,6 +420,7 @@ static const struct wlr_renderer_impl renderer_impl = {
.destroy = pixman_destroy,
.preferred_read_format = pixman_preferred_read_format,
.read_pixels = pixman_read_pixels,
+ .get_render_buffer_caps = pixman_get_render_buffer_caps,
};
struct wlr_renderer *wlr_pixman_renderer_create(void) {
diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c
index 34530e4d..a14cb4e4 100644
--- a/render/wlr_renderer.c
+++ b/render/wlr_renderer.c
@@ -27,6 +27,7 @@ void wlr_renderer_init(struct wlr_renderer *renderer,
assert(impl->render_quad_with_matrix);
assert(impl->get_shm_texture_formats);
assert(impl->texture_from_pixels);
+ assert(impl->get_render_buffer_caps);
renderer->impl = impl;
wl_signal_init(&renderer->events.destroy);
@@ -174,6 +175,10 @@ const struct wlr_drm_format_set *wlr_renderer_get_render_formats(
return r->impl->get_render_formats(r);
}
+uint32_t renderer_get_render_buffer_caps(struct wlr_renderer *r) {
+ return r->impl->get_render_buffer_caps();
+}
+
bool wlr_renderer_read_pixels(struct wlr_renderer *r, uint32_t fmt,
uint32_t *flags, uint32_t stride, uint32_t width, uint32_t height,
uint32_t src_x, uint32_t src_y, uint32_t dst_x, uint32_t dst_y,