render: guard rendering operations between begin() and end()

Add a wlr_renderer.rendering bool, set it to true between
wlr_renderer_begin() and wlr_renderer_end(). Assert we're rendering when
calling functions that render.
This commit is contained in:
Simon Ser 2019-12-28 11:53:11 +01:00 committed by Drew DeVault
parent a9b1d9e838
commit 346b43e937
2 changed files with 15 additions and 0 deletions

View file

@ -25,6 +25,8 @@ struct wlr_drm_format_set;
struct wlr_renderer {
const struct wlr_renderer_impl *impl;
bool rendering;
struct {
struct wl_signal destroy;
} events;