diff --git a/hw/xgl/xgl.h b/hw/xgl/xgl.h index 8b33ac846..8014c034c 100644 --- a/hw/xgl/xgl.h +++ b/hw/xgl/xgl.h @@ -698,7 +698,6 @@ Bool xglSetPixels (DrawablePtr pDrawable, char *src, int stride, - Bool upsideDown, int x, int y, int width, diff --git a/hw/xgl/xglgc.c b/hw/xgl/xglgc.c index 6677f68ce..c10b52d69 100644 --- a/hw/xgl/xglgc.c +++ b/hw/xgl/xglgc.c @@ -159,7 +159,6 @@ xglPutImage (DrawablePtr pDrawable, if (xglSetPixels (pDrawable, bits, PixmapBytePad (w, pDrawable->depth), - FALSE, x + pDrawable->x, y + pDrawable->y, w, h, REGION_RECTS (pGC->pCompositeClip), diff --git a/hw/xgl/xglpixel.c b/hw/xgl/xglpixel.c index f7a762891..22ed05c50 100644 --- a/hw/xgl/xglpixel.c +++ b/hw/xgl/xglpixel.c @@ -30,7 +30,6 @@ Bool xglSetPixels (DrawablePtr pDrawable, char *src, int stride, - Bool upsideDown, int x, int y, int width, @@ -45,7 +44,6 @@ xglSetPixels (DrawablePtr pDrawable, BoxPtr pDstBox; int nDstBox; int dstXoff, dstYoff, dstBpp; - int dstY, srcY; int x1, y1, x2, y2; XGL_DRAWABLE_PIXMAP (pDrawable); @@ -94,21 +92,11 @@ xglSetPixels (DrawablePtr pDrawable, if (x1 < x2 && y1 < y2) { - if (XGL_INTERNAL_SCANLINE_ORDER_UPSIDE_DOWN) - dstY = pDrawable->height - (y2 + dstYoff); - else - dstY = y1 + dstYoff; - - if (upsideDown) - srcY = height - (y2 - y); - else - srcY = y1 - y; - - fbBlt (srcBits + srcY * srcStride, + fbBlt (srcBits + (y1 - y) * srcStride, srcStride, (x1 - x) * dstBpp, - dstBits + dstY * dstStride, + dstBits + (y1 + dstYoff) * dstStride, dstStride, (x1 + dstXoff) * dstBpp, @@ -119,7 +107,7 @@ xglSetPixels (DrawablePtr pDrawable, FB_ALLONES, dstBpp, FALSE, - upsideDown != XGL_INTERNAL_SCANLINE_ORDER_UPSIDE_DOWN); + FALSE); pDstBox[nDstBox].x1 = x1; pDstBox[nDstBox].y1 = y1; diff --git a/hw/xgl/xglpixmap.c b/hw/xgl/xglpixmap.c index 201288f40..f00c1d873 100644 --- a/hw/xgl/xglpixmap.c +++ b/hw/xgl/xglpixmap.c @@ -423,18 +423,30 @@ xglMapPixmapBits (PixmapPtr pPixmap) { if (!pPixmap->devPrivate.ptr) { + CARD8 *bits; + XGL_PIXMAP_PRIV (pPixmap); if (!pPixmapPriv->buffer) if (!xglAllocatePixmapBits (pPixmap)) return FALSE; - pPixmap->devKind = pPixmapPriv->stride; - pPixmap->devPrivate.ptr = - glitz_buffer_map (pPixmapPriv->buffer, - GLITZ_BUFFER_ACCESS_READ_WRITE); - if (!pPixmap->devPrivate.ptr) + bits = glitz_buffer_map (pPixmapPriv->buffer, + GLITZ_BUFFER_ACCESS_READ_WRITE); + if (!bits) return FALSE; + + if (XGL_INTERNAL_SCANLINE_ORDER_UPSIDE_DOWN && pPixmapPriv->format) + { + pPixmap->devKind = -pPixmapPriv->stride; + pPixmap->devPrivate.ptr = + bits + (pPixmap->drawable.height - 1) * pPixmapPriv->stride; + } + else + { + pPixmap->devKind = pPixmapPriv->stride; + pPixmap->devPrivate.ptr = bits; + } } return TRUE;