diff options
-rw-r--r-- | include/wlr/render/interface.h | 1 | ||||
-rw-r--r-- | render/pass.c | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/include/wlr/render/interface.h b/include/wlr/render/interface.h index bdb5bbb8..63fd3cf5 100644 --- a/include/wlr/render/interface.h +++ b/include/wlr/render/interface.h @@ -76,6 +76,7 @@ struct wlr_render_pass_impl { bool (*submit)(struct wlr_render_pass *pass); void (*add_texture)(struct wlr_render_pass *pass, const struct wlr_render_texture_options *options); + /* Implementers are also guaranteed that options->box is nonempty */ void (*add_rect)(struct wlr_render_pass *pass, const struct wlr_render_rect_options *options); }; diff --git a/render/pass.c b/render/pass.c index 444f964e..6545bbfd 100644 --- a/render/pass.c +++ b/render/pass.c @@ -40,6 +40,9 @@ void wlr_render_pass_add_texture(struct wlr_render_pass *render_pass, void wlr_render_pass_add_rect(struct wlr_render_pass *render_pass, const struct wlr_render_rect_options *options) { + if (wlr_box_empty(&options->box)) { + return; + } render_pass->impl->add_rect(render_pass, options); } |