Xephyr: Paint with subimage for non-Glamor & non-XSHM case

This improves the case for when we paint an area without SHM.
xcb_image_subimage() is used to create a subimage for the damaged area, which
is converted to native format if necessary.

Signed-off-by: Ian Scott <ian.scott@arteris.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Ian Scott 2015-05-21 16:13:12 -07:00 committed by Adam Jackson
parent a6c0564f7f
commit a579e6ba77
1 changed files with 6 additions and 4 deletions

View File

@ -1047,11 +1047,13 @@ hostx_paint_rect(KdScreenInfo *screen,
sx, sy, dx, dy, width, height, FALSE);
}
else {
/* This is slow and could be done better */
xcb_image_t *img = xcb_image_native (HostX.conn, scrpriv->ximg, 1);
xcb_image_put(HostX.conn, scrpriv->win, HostX.gc, img, 0, 0, 0);
if (scrpriv->ximg != img)
xcb_image_t *subimg = xcb_image_subimage(scrpriv->ximg, sx, sy,
width, height, 0, 0, 0);
xcb_image_t *img = xcb_image_native(HostX.conn, subimg, 1);
xcb_image_put(HostX.conn, scrpriv->win, HostX.gc, img, dx, dy, 0);
if (subimg != img)
xcb_image_destroy(img);
xcb_image_destroy(subimg);
}
xcb_aux_sync(HostX.conn);