* else return number of pixels to skip in the destination array.
*/
static int
-clip_for_xgetimage(GLcontext *ctx, GLuint *n, GLint *x, GLint *y)
+clip_for_xgetimage(GLcontext *ctx, XMesaPixmap pixmap, GLuint *n, GLint *x, GLint *y)
{
XMesaContext xmesa = XMESA_CONTEXT(ctx);
XMesaBuffer source = XMESA_BUFFER(ctx->DrawBuffer);
GLint dx, dy;
if (source->type == PBUFFER || source->type == PIXMAP)
return 0;
- XTranslateCoordinates(xmesa->display, source->frontxrb->pixmap, rootWin,
+ XTranslateCoordinates(xmesa->display, pixmap, rootWin,
*x, *y, &dx, &dy, &child);
if (dx >= screenWidth) {
/* totally clipped on right */
#ifndef XFree86Server
XMesaImage *span = NULL;
int error;
- int k = clip_for_xgetimage(ctx, &n, &x, &y);
+ int k = clip_for_xgetimage(ctx, xrb->pixmap, &n, &x, &y);
if (k < 0)
return;
index += k;
#else
int k;
y = YFLIP(xrb, y);
- k = clip_for_xgetimage(ctx, &n, &x, &y);
+ k = clip_for_xgetimage(ctx, xrb->pixmap, &n, &x, &y);
if (k < 0)
return;
rgba += k;