diff options
author | Simon Ser <contact@emersion.fr> | 2020-04-02 12:41:19 +0200 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-04-08 16:31:21 +0200 |
commit | e04115898892129977a44e76aa39103a2bdd2144 (patch) | |
tree | 3b2616fabb0ac3e8f94587df034e8637661a6f2e /include/wlr | |
parent | 1fa9e0203b4192659a36ddd259c174569bc227d5 (diff) |
output: introduce wlr_output_test
Diffstat (limited to 'include/wlr')
-rw-r--r-- | include/wlr/interfaces/wlr_output.h | 1 | ||||
-rw-r--r-- | include/wlr/types/wlr_output.h | 8 |
2 files changed, 9 insertions, 0 deletions
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 @@ -338,6 +338,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 * will be scheduled. |