aboutsummaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-04-08 11:00:56 -0400
committeremersion <contact@emersion.fr>2018-04-08 11:00:56 -0400
commitd2ebbd103cda11b36fa44aa801128b2e477d465b (patch)
tree7219ae49eceb828e832119a5f0293fbea6164765 /render
parentf4125220a58f508d54f5103d4b0580f1d047f6b9 (diff)
backend: remove wlr_backend_get_egl
Diffstat (limited to 'render')
-rw-r--r--render/gles2/renderer.c21
-rw-r--r--render/wlr_renderer.c24
2 files changed, 45 insertions, 0 deletions
diff --git a/render/gles2/renderer.c b/render/gles2/renderer.c
index b8bce98d..297ac886 100644
--- a/render/gles2/renderer.c
+++ b/render/gles2/renderer.c
@@ -222,6 +222,24 @@ static void gles2_wl_drm_buffer_get_size(struct wlr_renderer *wlr_renderer,
eglQueryWaylandBufferWL(renderer->egl->display, buffer, EGL_HEIGHT, height);
}
+static int gles2_get_dmabuf_formats(struct wlr_renderer *wlr_renderer,
+ int **formats) {
+ struct wlr_gles2_renderer *renderer = gles2_get_renderer(wlr_renderer);
+ return wlr_egl_get_dmabuf_formats(renderer->egl, formats);
+}
+
+static int gles2_get_dmabuf_modifiers(struct wlr_renderer *wlr_renderer,
+ int format, uint64_t **modifiers) {
+ struct wlr_gles2_renderer *renderer = gles2_get_renderer(wlr_renderer);
+ return wlr_egl_get_dmabuf_modifiers(renderer->egl, format, modifiers);
+}
+
+static bool gles2_check_import_dmabuf(struct wlr_renderer *wlr_renderer,
+ struct wlr_dmabuf_buffer *dmabuf) {
+ struct wlr_gles2_renderer *renderer = gles2_get_renderer(wlr_renderer);
+ return wlr_egl_check_import_dmabuf(renderer->egl, dmabuf);
+}
+
static bool gles2_read_pixels(struct wlr_renderer *wlr_renderer,
enum wl_shm_format wl_fmt, uint32_t stride, uint32_t width,
uint32_t height, uint32_t src_x, uint32_t src_y, uint32_t dst_x,
@@ -311,6 +329,9 @@ static const struct wlr_renderer_impl renderer_impl = {
.formats = gles2_renderer_formats,
.resource_is_wl_drm_buffer = gles2_resource_is_wl_drm_buffer,
.wl_drm_buffer_get_size = gles2_wl_drm_buffer_get_size,
+ .get_dmabuf_formats = gles2_get_dmabuf_formats,
+ .get_dmabuf_modifiers = gles2_get_dmabuf_modifiers,
+ .check_import_dmabuf = gles2_check_import_dmabuf,
.read_pixels = gles2_read_pixels,
.format_supported = gles2_format_supported,
.texture_from_pixels = gles2_texture_from_pixels,
diff --git a/render/wlr_renderer.c b/render/wlr_renderer.c
index e33c2bed..80649b8c 100644
--- a/render/wlr_renderer.c
+++ b/render/wlr_renderer.c
@@ -112,6 +112,30 @@ void wlr_renderer_wl_drm_buffer_get_size(struct wlr_renderer *r,
return r->impl->wl_drm_buffer_get_size(r, buffer, width, height);
}
+int wlr_renderer_get_dmabuf_formats(struct wlr_renderer *r,
+ int **formats) {
+ if (!r->impl->get_dmabuf_formats) {
+ return -1;
+ }
+ return r->impl->get_dmabuf_formats(r, formats);
+}
+
+int wlr_renderer_get_dmabuf_modifiers(struct wlr_renderer *r, int format,
+ uint64_t **modifiers) {
+ if (!r->impl->get_dmabuf_modifiers) {
+ return -1;
+ }
+ return r->impl->get_dmabuf_modifiers(r, format, modifiers);
+}
+
+bool wlr_renderer_check_import_dmabuf(struct wlr_renderer *r,
+ struct wlr_dmabuf_buffer *dmabuf) {
+ if (!r->impl->check_import_dmabuf) {
+ return false;
+ }
+ return r->impl->check_import_dmabuf(r, dmabuf);
+}
+
bool wlr_renderer_read_pixels(struct wlr_renderer *r, enum wl_shm_format fmt,
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,