diff options
author | Simon Ser <contact@emersion.fr> | 2020-04-27 12:49:24 +0200 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-04-28 21:45:14 +0200 |
commit | 05803511db6e786cbb25caf3f1818718f5c0ab2e (patch) | |
tree | f1699468f34a1763b9c534843598b65fb7e35eb9 /render/wlr_texture.c | |
parent | 06f4c3945dfcdb108e480961d9d76cdb75c9912c (diff) |
render/texture: make write_pixels optional
Diffstat (limited to 'render/wlr_texture.c')
-rw-r--r-- | render/wlr_texture.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/render/wlr_texture.c b/render/wlr_texture.c index f6b6db89..b0b22565 100644 --- a/render/wlr_texture.c +++ b/render/wlr_texture.c @@ -6,7 +6,6 @@ void wlr_texture_init(struct wlr_texture *texture, const struct wlr_texture_impl *impl, uint32_t width, uint32_t height) { - assert(impl->write_pixels); texture->impl = impl; texture->width = width; 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 src_x, uint32_t src_y, uint32_t dst_x, uint32_t dst_y, const void *data) { + if (!texture->impl->write_pixels) { + return false; + } return texture->impl->write_pixels(texture, stride, width, height, src_x, src_y, dst_x, dst_y, data); } |