aboutsummaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
Diffstat (limited to 'render')
-rw-r--r--render/wlr_texture.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/render/wlr_texture.c b/render/wlr_texture.c
index db430d82..e9bda215 100644
--- a/render/wlr_texture.c
+++ b/render/wlr_texture.c
@@ -3,6 +3,7 @@
#include <stdlib.h>
#include <wlr/render/interface.h>
#include <wlr/render/wlr_texture.h>
+#include "render/wlr_texture.h"
void wlr_texture_init(struct wlr_texture *texture,
const struct wlr_texture_impl *impl, uint32_t width, uint32_t height) {
@@ -46,6 +47,15 @@ struct wlr_texture *wlr_texture_from_dmabuf(struct wlr_renderer *renderer,
return renderer->impl->texture_from_dmabuf(renderer, attribs);
}
+struct wlr_texture *wlr_texture_from_buffer(struct wlr_renderer *renderer,
+ struct wlr_buffer *buffer) {
+ assert(!renderer->rendering);
+ if (!renderer->impl->texture_from_buffer) {
+ return NULL;
+ }
+ return renderer->impl->texture_from_buffer(renderer, buffer);
+}
+
bool wlr_texture_is_opaque(struct wlr_texture *texture) {
if (!texture->impl->is_opaque) {
return false;