mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-08 13:29:45 -05:00
output-damage: refactor API
wlr_output_damage_make_current has been renamed to wlr_output_damage_attach_render, since it's just a wrapper for wlr_output_attach_render. wlr_output_damage_swap_buffers has been removed completely. Instead, wlr_output_damage now listens to successful wlr_output commits and updates its internal state accordingly.
This commit is contained in:
parent
31dcecbfa9
commit
5e6766a165
5 changed files with 46 additions and 42 deletions
|
|
@ -223,7 +223,7 @@ void output_render(struct roots_output *output) {
|
|||
bool needs_swap;
|
||||
pixman_region32_t damage;
|
||||
pixman_region32_init(&damage);
|
||||
if (!wlr_output_damage_make_current(output->damage, &needs_swap, &damage)) {
|
||||
if (!wlr_output_damage_attach_render(output->damage, &needs_swap, &damage)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -310,7 +310,8 @@ renderer_end:
|
|||
wlr_output_transform_invert(wlr_output->transform);
|
||||
wlr_region_transform(&damage, &damage, transform, width, height);
|
||||
|
||||
if (!wlr_output_damage_swap_buffers(output->damage, &now, &damage)) {
|
||||
wlr_output_set_damage(wlr_output, &damage);
|
||||
if (!wlr_output_commit(wlr_output)) {
|
||||
goto damage_finish;
|
||||
}
|
||||
output->last_frame = desktop->last_frame = now;
|
||||
|
|
@ -319,6 +320,5 @@ damage_finish:
|
|||
pixman_region32_fini(&damage);
|
||||
|
||||
// Send frame done events to all surfaces
|
||||
output_for_each_surface(output, surface_send_frame_done_iterator,
|
||||
&now);
|
||||
output_for_each_surface(output, surface_send_frame_done_iterator, &now);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue