[PATCH 3/7] mi: Remove miPutImage
Adam Jackson
ajax at redhat.com
Wed Oct 8 05:17:15 PDT 2014
Signed-off-by: Adam Jackson <ajax at redhat.com>
---
mi/mi.h | 12 -------
mi/mibitblt.c | 105 ----------------------------------------------------------
2 files changed, 117 deletions(-)
diff --git a/mi/mi.h b/mi/mi.h
index d5a5ba3..1d9f76a 100644
--- a/mi/mi.h
+++ b/mi/mi.h
@@ -113,18 +113,6 @@ extern _X_EXPORT void miGetImage(DrawablePtr /*pDraw */ ,
char * /*pdstLine */
);
-extern _X_EXPORT void miPutImage(DrawablePtr /*pDraw */ ,
- GCPtr /*pGC */ ,
- int /*depth */ ,
- int /*x */ ,
- int /*y */ ,
- int /*w */ ,
- int /*h */ ,
- int /*leftPad */ ,
- int /*format */ ,
- char * /*pImage */
- );
-
/* micopy.c */
#define miGetCompositeClip(pGC) ((pGC)->pCompositeClip)
diff --git a/mi/mibitblt.c b/mi/mibitblt.c
index 3ed4ed1..c2e4d56 100644
--- a/mi/mibitblt.c
+++ b/mi/mibitblt.c
@@ -669,108 +669,3 @@ miGetImage(DrawablePtr pDraw, int sx, int sy, int w, int h,
(MiBits *) pDst);
}
}
-
-/* MIPUTIMAGE -- public entry for the PutImage request
- * Here we benefit from knowing the format of the bits pointed to by pImage,
- * even if we don't know how pDraw represents them.
- * Three different strategies are used depending on the format
- * XYBitmap Format:
- * we just use the Opaque Stipple helper function to cover the destination
- * Note that this covers all the planes of the drawable with the
- * foreground color (masked with the GC planemask) where there are 1 bits
- * and the background color (masked with the GC planemask) where there are
- * 0 bits
- * XYPixmap format:
- * what we're called with is a series of XYBitmaps, but we only want
- * each XYPixmap to update 1 plane, instead of updating all of them.
- * we set the foreground color to be all 1s and the background to all 0s
- * then for each plane, we set the plane mask to only effect that one
- * plane and recursive call ourself with the format set to XYBitmap
- * (This clever idea courtesy of RGD.)
- * ZPixmap format:
- * This part is simple, just call SetSpans
- */
-void
-miPutImage(DrawablePtr pDraw, GCPtr pGC, int depth,
- int x, int y, int w, int h, int leftPad, int format, char *pImage)
-{
- DDXPointPtr pptFirst, ppt;
- int *pwidthFirst, *pwidth;
- RegionPtr prgnSrc;
- BoxRec box;
- unsigned long oldFg, oldBg;
- ChangeGCVal gcv[3];
- unsigned long oldPlanemask;
- unsigned long i;
- long bytesPer;
-
- if (!w || !h)
- return;
- switch (format) {
- case XYBitmap:
-
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = w;
- box.y2 = h;
- prgnSrc = RegionCreate(&box, 1);
-
- miOpqStipDrawable(pDraw, pGC, prgnSrc, (MiBits *) pImage,
- leftPad, w, h, x, y);
- RegionDestroy(prgnSrc);
- break;
-
- case XYPixmap:
- depth = pGC->depth;
- oldPlanemask = pGC->planemask;
- oldFg = pGC->fgPixel;
- oldBg = pGC->bgPixel;
- gcv[0].val = (XID) ~0;
- gcv[1].val = (XID) 0;
- ChangeGC(NullClient, pGC, GCForeground | GCBackground, gcv);
- bytesPer = (long) h *BitmapBytePad(w + leftPad);
-
- for (i = (unsigned long) 1 << (depth - 1); i != 0; i >>= 1, pImage += bytesPer) {
- if (i & oldPlanemask) {
- gcv[0].val = (XID) i;
- ChangeGC(NullClient, pGC, GCPlaneMask, gcv);
- ValidateGC(pDraw, pGC);
- (*pGC->ops->PutImage) (pDraw, pGC, 1, x, y, w, h, leftPad,
- XYBitmap, (char *) pImage);
- }
- }
- gcv[0].val = (XID) oldPlanemask;
- gcv[1].val = (XID) oldFg;
- gcv[2].val = (XID) oldBg;
- ChangeGC(NullClient, pGC, GCPlaneMask | GCForeground | GCBackground,
- gcv);
- ValidateGC(pDraw, pGC);
- break;
-
- case ZPixmap:
- ppt = pptFirst = malloc(h * sizeof(DDXPointRec));
- pwidth = pwidthFirst = malloc(h * sizeof(int));
- if (!pptFirst || !pwidthFirst) {
- free(pwidthFirst);
- free(pptFirst);
- return;
- }
- if (pGC->miTranslate) {
- x += pDraw->x;
- y += pDraw->y;
- }
-
- for (i = 0; i < h; i++) {
- ppt->x = x;
- ppt->y = y + i;
- ppt++;
- *pwidth++ = w;
- }
-
- (*pGC->ops->SetSpans) (pDraw, pGC, (char *) pImage, pptFirst,
- pwidthFirst, h, TRUE);
- free(pwidthFirst);
- free(pptFirst);
- break;
- }
-}
--
1.9.3
More information about the xorg-devel
mailing list