From e04115898892129977a44e76aa39103a2bdd2144 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 2 Apr 2020 12:41:19 +0200 Subject: output: introduce wlr_output_test --- include/wlr/interfaces/wlr_output.h | 1 + include/wlr/types/wlr_output.h | 8 ++++++++ 2 files changed, 9 insertions(+) (limited to 'include/wlr') diff --git a/include/wlr/interfaces/wlr_output.h b/include/wlr/interfaces/wlr_output.h index 12980ee5..c99d0c93 100644 --- a/include/wlr/interfaces/wlr_output.h +++ b/include/wlr/interfaces/wlr_output.h @@ -21,6 +21,7 @@ struct wlr_output_impl { bool (*move_cursor)(struct wlr_output *output, int x, int y); void (*destroy)(struct wlr_output *output); bool (*attach_render)(struct wlr_output *output, int *buffer_age); + bool (*test)(struct wlr_output *output); bool (*commit)(struct wlr_output *output); bool (*set_gamma)(struct wlr_output *output, size_t size, const uint16_t *r, const uint16_t *g, const uint16_t *b); diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h index 3b7f7ee3..0e2954b9 100644 --- a/include/wlr/types/wlr_output.h +++ b/include/wlr/types/wlr_output.h @@ -337,6 +337,14 @@ bool wlr_output_preferred_read_format(struct wlr_output *output, */ void wlr_output_set_damage(struct wlr_output *output, pixman_region32_t *damage); +/** + * Test whether the pending output state would be accepted by the backend. If + * this function returns true, `wlr_output_commit` can only fail due to a + * runtime error. + * + * This function doesn't mutate the pending state. + */ +bool wlr_output_test(struct wlr_output *output); /** * Commit the pending output state. If `wlr_output_attach_render` has been * called, the pending frame will be submitted for display and a `frame` event -- cgit v1.2.3