wlr_output: Introduce struct wlr_output_commit

This commit is contained in:
Alexander Orzechowski 2023-10-03 05:40:50 -04:00
parent 1b0694b794
commit c299c13d13
12 changed files with 145 additions and 49 deletions

View file

@ -65,7 +65,8 @@ struct wlr_output_impl {
*
* If a buffer has been attached, a frame event is scheduled.
*/
bool (*commit)(struct wlr_output *output, const struct wlr_output_state *state);
struct wlr_output_commit *(*commit)(struct wlr_output *output,
const struct wlr_output_state *state);
/**
* Get the maximum number of gamma LUT elements for each channel.
*

View file

@ -227,6 +227,7 @@ struct wlr_output_event_commit {
uint32_t committed; // bitmask of enum wlr_output_state_field
struct timespec *when;
struct wlr_buffer *buffer; // NULL if no buffer is committed
struct wlr_output_commit *commit;
};
enum wlr_output_present_flag {
@ -270,8 +271,20 @@ struct wlr_output_event_request_state {
const struct wlr_output_state *state;
};
struct wlr_output_commit {
struct wlr_output *output;
struct {
struct wl_signal present; // struct wlr_output_event_present
} events;
};
struct wlr_surface;
void wlr_output_commit_init(struct wlr_output_commit *commit,
struct wlr_output *output);
/**
* Enables or disables the output. A disabled output is turned off and doesn't
* emit `frame` events.