output: add wlr_output_init_render

Co-authored-by: Simon Zeni <simon@bl4ckb0ne.ca>
This commit is contained in:
Simon Ser 2021-11-05 12:26:38 +01:00 committed by Simon Zeni
parent b5d4bc3c62
commit 142d10e591
3 changed files with 55 additions and 29 deletions

View file

@ -182,6 +182,8 @@ struct wlr_output {
struct wlr_buffer *cursor_front_buffer;
int software_cursor_locks; // number of locks forcing software cursors
struct wlr_allocator *allocator;
struct wlr_renderer *renderer;
struct wlr_swapchain *swapchain;
struct wlr_buffer *back_buffer, *front_buffer;
@ -256,6 +258,18 @@ struct wlr_surface;
void wlr_output_enable(struct wlr_output *output, bool enable);
void wlr_output_create_global(struct wlr_output *output);
void wlr_output_destroy_global(struct wlr_output *output);
/**
* Initialize the output's rendering subsystem with the provided allocator and
* renderer. Can only be called once.
*
* Call this function prior to any call to wlr_output_attach_render,
* wlr_output_commit or wlr_output_cursor_create.
*
* The buffer capabilities of the provided must match the capabilities of the
* output's backend. Returns false otherwise.
*/
bool wlr_output_init_render(struct wlr_output *output,
struct wlr_allocator *allocator, struct wlr_renderer *renderer);
/**
* Returns the preferred mode for this output. If the output doesn't support
* modes, returns NULL.