mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
wlr_scene: Add support for custom swapchains
This commit is contained in:
parent
239354d644
commit
8da93e5936
2 changed files with 15 additions and 3 deletions
|
@ -468,6 +468,13 @@ void wlr_scene_output_set_position(struct wlr_scene_output *scene_output,
|
||||||
|
|
||||||
struct wlr_scene_output_state_options {
|
struct wlr_scene_output_state_options {
|
||||||
struct wlr_scene_timer *timer;
|
struct wlr_scene_timer *timer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows use of a custom swapchain. This can be useful when trying out an
|
||||||
|
* output configuration. The swapchain dimensions must match the respective
|
||||||
|
* wlr_output_state or output size if not specified.
|
||||||
|
*/
|
||||||
|
struct wlr_swapchain *swapchain;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1803,11 +1803,16 @@ bool wlr_scene_output_build_state(struct wlr_scene_output *scene_output,
|
||||||
wlr_damage_ring_set_bounds(&scene_output->damage_ring,
|
wlr_damage_ring_set_bounds(&scene_output->damage_ring,
|
||||||
render_data.trans_width, render_data.trans_height);
|
render_data.trans_width, render_data.trans_height);
|
||||||
|
|
||||||
if (!wlr_output_configure_primary_swapchain(output, state, &output->swapchain)) {
|
struct wlr_swapchain *swapchain = options->swapchain;
|
||||||
return false;
|
if (!swapchain) {
|
||||||
|
if (!wlr_output_configure_primary_swapchain(output, state, &output->swapchain)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
swapchain = output->swapchain;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wlr_buffer *buffer = wlr_swapchain_acquire(output->swapchain, NULL);
|
struct wlr_buffer *buffer = wlr_swapchain_acquire(swapchain, NULL);
|
||||||
if (buffer == NULL) {
|
if (buffer == NULL) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue