present/wnmd: Translate update region to screen space

The region as passed in is in the source pixmap's coordinate space, so
intersecting it with the clipList (which is in screen space) resulted in
disappointment.

Fixes Firefox popups such as the hamburger menu when using the EGL
backend.

v2:
* Drop vblank->x/y_off from RegionTranslate call, since they're always
  0 here (present_wnmd_check_flip rejects flips for x/y_off != 0).

Reported-by: Robert Mader <robert.mader@posteo.de>
Tested-by: Robert Mader <robert.mader@posteo.de>
Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
Tested-by: Joakim Tjernlund <joakim.tjernlund@infinera.com> # v1
(cherry picked from commit 466b8b43fb355c6040cee45406860b8b8c04e948)
This commit is contained in:
Michel Dänzer 2020-12-01 11:25:31 +01:00
parent 54f9af1c61
commit 440ed5948b
1 changed files with 6 additions and 2 deletions

View File

@ -473,10 +473,13 @@ present_wnmd_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
/* Set update region as damaged */
if (vblank->update) {
damage = vblank->update;
damage = RegionDuplicate(vblank->update);
/* Translate update region to screen space */
assert(vblank->x_off == 0 && vblank->y_off == 0);
RegionTranslate(damage, window->drawable.x, window->drawable.y);
RegionIntersect(damage, damage, &window->clipList);
} else
damage = &window->clipList;
damage = RegionDuplicate(&window->clipList);
/* Try to flip - the vblank is now pending
*/
@ -498,6 +501,7 @@ present_wnmd_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
/* Report damage */
DamageDamageRegion(&vblank->window->drawable, damage);
RegionDestroy(damage);
return;
}