render/texture: introduce wlr_texture_invalidate

This commit is contained in:
Simon Ser 2021-04-12 11:56:20 +02:00
parent 5c699f09cb
commit a3a85a9aed
3 changed files with 30 additions and 0 deletions

View file

@ -0,0 +1,21 @@
#ifndef RENDER_WLR_TEXTURE_H
#define RENDER_WLR_TEXTURE_H
#include <wlr/render/wlr_texture.h>
/**
* Refresh the texture contents from the underlying buffer storage.
*
* If the texture refers to external memory (i.e. memory owned by another
* process), the renderer may need a wlr_texture_invalidate call to make
* external changes visible to the texture.
*
* This operation must not perform any copy.
*
* If the texture cannot be invalidated, false is returned. If the texture
* doesn't need to be invalidated for external changes to be visible, true is
* immediately returned.
*/
bool wlr_texture_invalidate(struct wlr_texture *texture);
#endif

View file

@ -67,6 +67,7 @@ struct wlr_texture_impl {
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,
const void *data);
bool (*invalidate)(struct wlr_texture *texture);
void (*destroy)(struct wlr_texture *texture);
};