render/texture: make write_pixels optional
This commit is contained in:
parent
06f4c3945d
commit
05803511db
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
void wlr_texture_init(struct wlr_texture *texture,
|
void wlr_texture_init(struct wlr_texture *texture,
|
||||||
const struct wlr_texture_impl *impl, uint32_t width, uint32_t height) {
|
const struct wlr_texture_impl *impl, uint32_t width, uint32_t height) {
|
||||||
assert(impl->write_pixels);
|
|
||||||
texture->impl = impl;
|
texture->impl = impl;
|
||||||
texture->width = width;
|
texture->width = width;
|
||||||
texture->height = height;
|
texture->height = height;
|
||||||
|
@ -60,6 +59,9 @@ bool wlr_texture_write_pixels(struct wlr_texture *texture,
|
||||||
uint32_t stride, uint32_t width, uint32_t height,
|
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,
|
uint32_t src_x, uint32_t src_y, uint32_t dst_x, uint32_t dst_y,
|
||||||
const void *data) {
|
const void *data) {
|
||||||
|
if (!texture->impl->write_pixels) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return texture->impl->write_pixels(texture, stride, width, height,
|
return texture->impl->write_pixels(texture, stride, width, height,
|
||||||
src_x, src_y, dst_x, dst_y, data);
|
src_x, src_y, dst_x, dst_y, data);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue