mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-25 22:25:58 +01:00
render/egl: fix swapping with no damage
According to the spec: > If <n_rects> is 0 then <rects> is ignored and the entire > surface is implicitly damaged and the behaviour is equivalent > to calling eglSwapBuffers. When we want to swap with an empty damage region, set the damage to a single empty rectangle.
This commit is contained in:
parent
736632ad4e
commit
d6e250b389
1 changed files with 8 additions and 0 deletions
|
@ -377,6 +377,14 @@ bool wlr_egl_swap_buffers(struct wlr_egl *egl, EGLSurface surface,
|
|||
|
||||
pixman_region32_fini(&flipped_damage);
|
||||
|
||||
if (nrects == 0) {
|
||||
// Swapping with no rects is the same as swapping with the entire
|
||||
// surface damaged. To swap with no damage, we set the damage region
|
||||
// to a single empty rectangle.
|
||||
nrects = 1;
|
||||
memset(egl_damage, 0, sizeof(egl_damage));
|
||||
}
|
||||
|
||||
if (egl->exts.swap_buffers_with_damage_ext) {
|
||||
ret = eglSwapBuffersWithDamageEXT(egl->display, surface, egl_damage,
|
||||
nrects);
|
||||
|
|
Loading…
Reference in a new issue