aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/render/wlr_renderer.h6
-rw-r--r--include/wlr/render/interface.h1
-rw-r--r--render/gles2/renderer.c6
-rw-r--r--render/pixman/renderer.c5
-rw-r--r--render/wlr_renderer.c5
5 files changed, 23 insertions, 0 deletions
diff --git a/include/render/wlr_renderer.h b/include/render/wlr_renderer.h
index 8298bab7..d09c20b3 100644
--- a/include/render/wlr_renderer.h
+++ b/include/render/wlr_renderer.h
@@ -21,5 +21,11 @@ bool wlr_renderer_bind_buffer(struct wlr_renderer *r, struct wlr_buffer *buffer)
*/
const struct wlr_drm_format_set *wlr_renderer_get_render_formats(
struct wlr_renderer *renderer);
+/**
+ * Get the supported buffer capabilities.
+ *
+ * This functions returns a bitfield of supported wlr_buffer_cap.
+ */
+uint32_t renderer_get_render_buffer_caps(struct wlr_renderer *renderer);
#endif
diff --git a/include/wlr/render/interface.h b/include/wlr/render/interface.h
index f11e0118..f280852c 100644
--- a/include/wlr/render/interface.h
+++ b/include/wlr/render/interface.h
@@ -56,6 +56,7 @@ struct wlr_renderer_impl {
bool (*init_wl_display)(struct wlr_renderer *renderer,
struct wl_display *wl_display);
int (*get_drm_fd)(struct wlr_renderer *renderer);
+ uint32_t (*get_render_buffer_caps)(void);
};
void wlr_renderer_init(struct wlr_renderer *renderer,
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,