wlr_texture: Drop wlr_texture_from_dmabuf

Compositors should first create a valid dmabuf first, then use normal
apis to use that buffer where needed.
This commit is contained in:
Alexander Orzechowski 2022-06-20 11:11:23 -04:00
parent e594a59036
commit dae7bd1413
2 changed files with 0 additions and 24 deletions

View file

@ -12,7 +12,6 @@
#include <pixman.h>
#include <stdint.h>
#include <wayland-server-core.h>
#include <wlr/render/dmabuf.h>
#include <wlr/types/wlr_raster.h>
struct wlr_buffer;
@ -35,12 +34,6 @@ struct wlr_texture *wlr_texture_from_pixels(struct wlr_renderer *renderer,
uint32_t fmt, uint32_t stride, uint32_t width, uint32_t height,
const void *data);
/**
* Create a new texture from a DMA-BUF. The returned texture is immutable.
*/
struct wlr_texture *wlr_texture_from_dmabuf(struct wlr_renderer *renderer,
struct wlr_dmabuf_attributes *attribs);
/**
* Update a texture with a struct wlr_buffer's contents.
*

View file

@ -56,23 +56,6 @@ struct wlr_texture *wlr_texture_from_pixels(struct wlr_renderer *renderer,
return texture;
}
struct wlr_texture *wlr_texture_from_dmabuf(struct wlr_renderer *renderer,
struct wlr_dmabuf_attributes *attribs) {
struct wlr_dmabuf_buffer *buffer = dmabuf_buffer_create(attribs);
if (buffer == NULL) {
return NULL;
}
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,
struct wlr_buffer *buffer) {
if (!renderer->impl->texture_from_buffer) {