static void
swrastXPutImage(__DRIdrawable * draw, int op,
- int x, int y, int w, int h, int stride,
+ int srcx, int srcy, int x, int y,
+ int w, int h, int stride,
int shmid, char *data, void *loaderPrivate)
{
struct drisw_drawable *pdp = loaderPrivate;
if (pdp->shminfo.shmid >= 0) {
ximage->width = ximage->bytes_per_line / ((ximage->bits_per_pixel + 7)/ 8);
ximage->height = h;
- XShmPutImage(dpy, drawable, gc, ximage, 0, 0, x, y, w, h, False);
+ XShmPutImage(dpy, drawable, gc, ximage, srcx, srcy, x, y, w, h, False);
XSync(dpy, False);
} else {
ximage->width = w;
ximage->height = h;
- XPutImage(dpy, drawable, gc, ximage, 0, 0, x, y, w, h);
+ XPutImage(dpy, drawable, gc, ximage, srcx, srcy, x, y, w, h);
}
ximage->data = NULL;
}
struct drisw_drawable *pdp = loaderPrivate;
pdp->shminfo.shmaddr = shmaddr;
- swrastXPutImage(draw, op, x, y, w, h, stride, shmid,
+ swrastXPutImage(draw, op, 0, 0, x, y, w, h, stride, shmid,
+ shmaddr + offset, loaderPrivate);
+}
+
+static void
+swrastPutImageShm2(__DRIdrawable * draw, int op,
+ int x, int y,
+ int w, int h, int stride,
+ int shmid, char *shmaddr, unsigned offset,
+ void *loaderPrivate)
+{
+ struct drisw_drawable *pdp = loaderPrivate;
+
+ pdp->shminfo.shmaddr = shmaddr;
+ swrastXPutImage(draw, op, x, 0, x, y, w, h, stride, shmid,
shmaddr + offset, loaderPrivate);
}
int x, int y, int w, int h, int stride,
char *data, void *loaderPrivate)
{
- swrastXPutImage(draw, op, x, y, w, h, stride, -1,
+ swrastXPutImage(draw, op, 0, 0, x, y, w, h, stride, -1,
data, loaderPrivate);
}
int x, int y, int w, int h,
char *data, void *loaderPrivate)
{
- swrastXPutImage(draw, op, x, y, w, h, 0, -1,
+ swrastXPutImage(draw, op, 0, 0, x, y, w, h, 0, -1,
data, loaderPrivate);
}
}
static const __DRIswrastLoaderExtension swrastLoaderExtension_shm = {
- .base = {__DRI_SWRAST_LOADER, 4 },
+ .base = {__DRI_SWRAST_LOADER, 5 },
.getDrawableInfo = swrastGetDrawableInfo,
.putImage = swrastPutImage,
.getImage2 = swrastGetImage2,
.putImageShm = swrastPutImageShm,
.getImageShm = swrastGetImageShm,
+ .putImageShm2 = swrastPutImageShm2,
};
static const __DRIextension *loader_extensions_shm[] = {