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
This commit is contained in:
Michel Dänzer 2020-11-20 16:54:02 +01:00 committed by Michel Dänzer
parent b0530fe422
commit 11652706b0
1 changed files with 6 additions and 2 deletions

View File

@ -459,10 +459,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
*/
@ -484,6 +487,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;
}