From d2ebbd103cda11b36fa44aa801128b2e477d465b Mon Sep 17 00:00:00 2001 From: emersion Date: Sun, 8 Apr 2018 11:00:56 -0400 Subject: backend: remove wlr_backend_get_egl --- include/wlr/backend.h | 4 ---- include/wlr/backend/interface.h | 1 - include/wlr/render/egl.h | 2 +- include/wlr/render/interface.h | 5 +++++ include/wlr/render/wlr_renderer.h | 16 ++++++++++++++++ include/wlr/types/wlr_linux_dmabuf.h | 6 +++--- 6 files changed, 25 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/wlr/backend.h b/include/wlr/backend.h index f5482e04..2059e3b7 100644 --- a/include/wlr/backend.h +++ b/include/wlr/backend.h @@ -37,10 +37,6 @@ bool wlr_backend_start(struct wlr_backend *backend); * automatically when the wl_display is destroyed. */ void wlr_backend_destroy(struct wlr_backend *backend); -/** - * Obtains the wlr_egl reference this backend is using. - */ -struct wlr_egl *wlr_backend_get_egl(struct wlr_backend *backend); /** * Obtains the wlr_renderer reference this backend is using. */ diff --git a/include/wlr/backend/interface.h b/include/wlr/backend/interface.h index f03e95d9..42b39a16 100644 --- a/include/wlr/backend/interface.h +++ b/include/wlr/backend/interface.h @@ -8,7 +8,6 @@ struct wlr_backend_impl { bool (*start)(struct wlr_backend *backend); void (*destroy)(struct wlr_backend *backend); - struct wlr_egl *(*get_egl)(struct wlr_backend *backend); struct wlr_renderer *(*get_renderer)(struct wlr_backend *backend); }; diff --git a/include/wlr/render/egl.h b/include/wlr/render/egl.h index 51f63b20..0b7f1dde 100644 --- a/include/wlr/render/egl.h +++ b/include/wlr/render/egl.h @@ -83,7 +83,7 @@ int wlr_egl_get_dmabuf_formats(struct wlr_egl *egl, int **formats); * Get the available dmabuf modifiers for a given format */ int wlr_egl_get_dmabuf_modifiers(struct wlr_egl *egl, int format, - uint64_t **modifiers); + uint64_t **modifiers); /** * Destroys an EGL image created with the given wlr_egl. diff --git a/include/wlr/render/interface.h b/include/wlr/render/interface.h index 597e4b39..9dbe7247 100644 --- a/include/wlr/render/interface.h +++ b/include/wlr/render/interface.h @@ -36,6 +36,11 @@ struct wlr_renderer_impl { struct wl_resource *resource); void (*wl_drm_buffer_get_size)(struct wlr_renderer *renderer, struct wl_resource *buffer, int *width, int *height); + bool (*check_import_dmabuf)(struct wlr_renderer *renderer, + struct wlr_dmabuf_buffer *dmabuf); + int (*get_dmabuf_formats)(struct wlr_renderer *renderer, int **formats); + int (*get_dmabuf_modifiers)(struct wlr_renderer *renderer, int format, + uint64_t **modifiers); bool (*read_pixels)(struct wlr_renderer *renderer, 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, diff --git a/include/wlr/render/wlr_renderer.h b/include/wlr/render/wlr_renderer.h index 65fc7b19..9ead7d81 100644 --- a/include/wlr/render/wlr_renderer.h +++ b/include/wlr/render/wlr_renderer.h @@ -64,6 +64,22 @@ bool wlr_renderer_resource_is_wl_drm_buffer(struct wlr_renderer *renderer, */ void wlr_renderer_wl_drm_buffer_get_size(struct wlr_renderer *renderer, struct wl_resource *buffer, int *width, int *height); +/** + * Get the available dmabuf formats + */ +int wlr_renderer_get_dmabuf_formats(struct wlr_renderer *renderer, + int **formats); +/** + * Get the available dmabuf modifiers for a given format + */ +int wlr_renderer_get_dmabuf_modifiers(struct wlr_renderer *renderer, int format, + uint64_t **modifiers); +/** + * Try to import the given dmabuf. On success return true false otherwise. + * If this succeeds the dmabuf can be used for rendering on a texture + */ +bool wlr_renderer_check_import_dmabuf(struct wlr_renderer *renderer, + struct wlr_dmabuf_buffer *dmabuf); /** * Reads out of pixels of the currently bound surface into data. `stride` is in * bytes. diff --git a/include/wlr/types/wlr_linux_dmabuf.h b/include/wlr/types/wlr_linux_dmabuf.h index c06d8a87..3fe8e1fc 100644 --- a/include/wlr/types/wlr_linux_dmabuf.h +++ b/include/wlr/types/wlr_linux_dmabuf.h @@ -32,7 +32,7 @@ struct wlr_dmabuf_buffer_attribs { }; struct wlr_dmabuf_buffer { - struct wlr_egl *egl; + struct wlr_renderer *renderer; struct wl_resource *buffer_resource; struct wl_resource *params_resource; struct wlr_dmabuf_buffer_attribs attributes; @@ -62,14 +62,14 @@ struct wlr_dmabuf_buffer *wlr_dmabuf_buffer_from_params_resource( struct wlr_linux_dmabuf { struct wl_global *wl_global; struct wl_listener display_destroy; - struct wlr_egl *egl; + struct wlr_renderer *renderer; }; /** * Create linux-dmabuf interface */ struct wlr_linux_dmabuf *wlr_linux_dmabuf_create(struct wl_display *display, - struct wlr_egl *egl); + struct wlr_renderer *renderer); /** * Destroy the linux-dmabuf interface */ -- cgit v1.2.3