mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
render: use wlr_dmabuf_buffer in wlr_texture_from_dmabuf
This commit is contained in:
parent
08e5b909f9
commit
7ad44051a2
1 changed files with 11 additions and 2 deletions
|
@ -55,10 +55,19 @@ struct wlr_texture *wlr_texture_from_wl_drm(struct wlr_renderer *renderer,
|
|||
|
||||
struct wlr_texture *wlr_texture_from_dmabuf(struct wlr_renderer *renderer,
|
||||
struct wlr_dmabuf_attributes *attribs) {
|
||||
if (!renderer->impl->texture_from_dmabuf) {
|
||||
struct wlr_dmabuf_buffer *buffer = dmabuf_buffer_create(attribs);
|
||||
if (buffer == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
return renderer->impl->texture_from_dmabuf(renderer, attribs);
|
||||
|
||||
struct wlr_texture *texture =
|
||||
wlr_texture_from_buffer(renderer, &buffer->base);
|
||||
|
||||
// By this point, the renderer should have locked the buffer if it still
|
||||
// needs to access it in the future.
|
||||
dmabuf_buffer_drop(buffer);
|
||||
|
||||
return texture;
|
||||
}
|
||||
|
||||
struct wlr_texture *wlr_texture_from_buffer(struct wlr_renderer *renderer,
|
||||
|
|
Loading…
Reference in a new issue