mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-09 23:22:22 +00:00
DRI: Clip cliprects obtained from DRIGetDrawableInfo to screen dimensions.
This is to avoid issues with redirected windows which are located partly or fully outside of a screen edge, resulting in unusual cliprects which the 3D drivers generally can't handle. The symptoms in such cases would be incorrect rendering or even crashes or hangs.
This commit is contained in:
parent
5d896e43fd
commit
1aceec61ff
3 changed files with 69 additions and 12 deletions
|
|
@ -1518,13 +1518,18 @@ DRIGetDrawableInfo(ScreenPtr pScreen,
|
|||
if (x1 > pScreen->width) x1 = pScreen->width;
|
||||
if (y1 > pScreen->height) y1 = pScreen->height;
|
||||
|
||||
pDRIPriv->private_buffer_rect.x1 = x0;
|
||||
pDRIPriv->private_buffer_rect.y1 = y0;
|
||||
pDRIPriv->private_buffer_rect.x2 = x1;
|
||||
pDRIPriv->private_buffer_rect.y2 = y1;
|
||||
if (y0 >= y1 || x0 >= x1) {
|
||||
*numBackClipRects = 0;
|
||||
*pBackClipRects = NULL;
|
||||
} else {
|
||||
pDRIPriv->private_buffer_rect.x1 = x0;
|
||||
pDRIPriv->private_buffer_rect.y1 = y0;
|
||||
pDRIPriv->private_buffer_rect.x2 = x1;
|
||||
pDRIPriv->private_buffer_rect.y2 = y1;
|
||||
|
||||
*numBackClipRects = 1;
|
||||
*pBackClipRects = &(pDRIPriv->private_buffer_rect);
|
||||
*numBackClipRects = 1;
|
||||
*pBackClipRects = &(pDRIPriv->private_buffer_rect);
|
||||
}
|
||||
} else {
|
||||
/* Use the frontbuffer cliprects for back buffers. */
|
||||
*numBackClipRects = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue