render: replace wlr_texture_write_pixels with update_from_buffer

This lets the renderer handle the wlr_buffer directly, just like it
does in texture_from_buffer. This also allows the renderer to batch
the rectangle updates, and update more than the damage region if
desirable (e.g. too many rects), so can be more efficient.
This commit is contained in:
Simon Ser 2022-05-29 11:50:47 +02:00
parent 8c3c6987db
commit 98cf38601f
7 changed files with 101 additions and 87 deletions

View file

@ -54,10 +54,8 @@ void wlr_renderer_init(struct wlr_renderer *renderer,
const struct wlr_renderer_impl *impl);
struct wlr_texture_impl {
bool (*write_pixels)(struct wlr_texture *texture,
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 (*update_from_buffer)(struct wlr_texture *texture,
struct wlr_buffer *buffer, pixman_region32_t *damage);
void (*destroy)(struct wlr_texture *texture);
};