summaryrefslogtreecommitdiff
path: root/xc/programs/Xserver/hw/xwin/winsetsp.c
diff options
context:
space:
mode:
Diffstat (limited to 'xc/programs/Xserver/hw/xwin/winsetsp.c')
-rw-r--r--xc/programs/Xserver/hw/xwin/winsetsp.c77
1 files changed, 45 insertions, 32 deletions
diff --git a/xc/programs/Xserver/hw/xwin/winsetsp.c b/xc/programs/Xserver/hw/xwin/winsetsp.c
index 3cc69e994..8af551ca3 100644
--- a/xc/programs/Xserver/hw/xwin/winsetsp.c
+++ b/xc/programs/Xserver/hw/xwin/winsetsp.c
@@ -27,7 +27,7 @@
*
* Authors: Harold L Hunt II
*/
-/* $XFree86: xc/programs/Xserver/hw/xwin/winsetsp.c,v 1.1 2001/04/05 20:13:50 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xwin/winsetsp.c,v 1.4 2001/07/31 09:46:57 alanh Exp $ */
#include "win.h"
@@ -41,7 +41,10 @@ winSetSpansNativeGDI (DrawablePtr pDrawable,
int nSpans,
int fSorted)
{
-#if 0
+#if WIN_NATIVE_GDI_SUPPORT
+ winGCPriv(pGC);
+ winPrivPixmapPtr pPixmapPriv = NULL;
+ PixmapPtr pPixmap = NULL;
int iIdx = 0;
static int iCount = 0;
HBITMAP hBitmap = NULL;
@@ -64,23 +67,29 @@ winSetSpansNativeGDI (DrawablePtr pDrawable,
bmih.biClrUsed = 0;
bmih.biClrImportant = 0;
- fprintf (stderr, "\nwinSetSpans () - pDrawable: %08x\n",
- pDrawable);
+ ErrorF ("\nwinSetSpans () - pDrawable: %08x\n",
+ pDrawable);
/* What kind of raster op have we got here? */
switch (pGC->alu)
{
case GXclear:
- fprintf (stderr, "winSetSpans () - GXclear\n");
+ ErrorF ("winSetSpans () - GXclear\n");
break;
case GXand:
- fprintf (stderr, "winSetSpans () - GXand:\n");
+ ErrorF ("winSetSpans () - GXand:\n");
break;
case GXandReverse:
- fprintf (stderr, "winSetSpans () - GXandReverse\n");
+ ErrorF ("winSetSpans () - GXandReverse\n");
break;
case GXcopy:
- fprintf (stderr, "winSetSpans () - GXcopy\n");
+ ErrorF ("winSetSpans () - GXcopy\n");
+
+ /*
+ * FIXME: Assuming that the drawable is a pixmap.
+ */
+ pPixmap = (PixmapPtr) pDrawable;
+ pPixmapPriv = winGetPixmapPriv (pPixmap);
/* Loop through spans */
for (iIdx = 0; iIdx < nSpans; ++iIdx)
@@ -89,40 +98,43 @@ winSetSpansNativeGDI (DrawablePtr pDrawable,
pPoint = pPoints + iIdx;
/* Blast the bits to the drawable */
- SetDIBits (g_hdcMem, ((PixmapPtr)pDrawable)->devPrivate.ptr,
- pPoint->y, 1, pSrc, &bmih, 0);
+ SetDIBits (pGCPriv->hdcMem,
+ pPixmapPriv->hBitmap,
+ pPoint->y, 1,
+ pSrc,
+ pPixmapPriv->pbmih, 0);
/* Display some useful information */
- fprintf (stderr, "(%dx%dx%d) (%d,%d) w: %d ps: %08x\n",
- pDrawable->width, pDrawable->height, pDrawable->depth,
- pPoint->x, pPoint->y, *pWidth, pSrc);
+ ErrorF ("(%dx%dx%d) (%d,%d) w: %d ps: %08x\n",
+ pDrawable->width, pDrawable->height, pDrawable->depth,
+ pPoint->x, pPoint->y, *pWidth, pSrc);
/* Calculate offset of next bit source */
pSrc += 4 * ((*pWidth + 31) / 32);
}
break;
case GXandInverted:
- fprintf (stderr, "winSetSpans () - GXandInverted\n");
+ ErrorF ("winSetSpans () - GXandInverted\n");
break;
case GXnoop:
- fprintf (stderr, "winSetSpans () - GXnoop\n");
+ ErrorF ("winSetSpans () - GXnoop\n");
break;
case GXxor:
- fprintf (stderr, "winSetSpans () - GXxor\n");
+ ErrorF ("winSetSpans () - GXxor\n");
break;
case GXor:
- fprintf (stderr, "winSetSpans () - GXor\n");
+ ErrorF ("winSetSpans () - GXor\n");
break;
case GXnor:
- fprintf (stderr, "winSetSpans () - GXnor\n");
+ ErrorF ("winSetSpans () - GXnor\n");
break;
case GXequiv:
- fprintf (stderr, "winSetSpans () - GXequiv\n");
+ ErrorF ("winSetSpans () - GXequiv\n");
break;
case GXinvert:
- fprintf (stderr, "winSetSpans () - GXinvert\n");
+ ErrorF ("winSetSpans () - GXinvert\n");
- hdcMem = CreateCompatibleDC (g_hdc);
+ hdcMem = CreateCompatibleDC (pGCPriv->hdc);
/* Loop through spans */
for (iIdx = 0; iIdx < nSpans; ++iIdx)
@@ -150,19 +162,20 @@ winSetSpansNativeGDI (DrawablePtr pDrawable,
}
else
{
- hBitmap = CreateDIBitmap (g_hdcMem, &bmih, 0, pSrc, NULL, 0);
+ hBitmap = CreateDIBitmap (pGCPriv->hdcMem,
+ &bmih, 0, pSrc, NULL, 0);
}
hBitmap = SelectObject (hdcMem, hBitmap);
/* Blit the span line to the drawable */
- BitBlt (g_hdcMem, pPoint->x, pPoint->y,
+ BitBlt (pGCPriv->hdcMem, pPoint->x, pPoint->y,
*pWidth / pDrawable->depth, 1,
hdcMem, 0, 0, NOTSRCCOPY);
/* Display some useful information */
- fprintf (stderr, "(%dx%dx%d) (%d,%d) w: %d ps: %08x\n",
- pDrawable->width, pDrawable->height, pDrawable->depth,
- pPoint->x, pPoint->y, *pWidth, pSrc);
+ ErrorF ("(%dx%dx%d) (%d,%d) w: %d ps: %08x\n",
+ pDrawable->width, pDrawable->height, pDrawable->depth,
+ pPoint->x, pPoint->y, *pWidth, pSrc);
/* Calculate offset of next bit source */
pSrc += 4 * ((*pWidth + 31) / 32);
@@ -180,21 +193,21 @@ winSetSpansNativeGDI (DrawablePtr pDrawable,
break;
case GXorReverse:
- fprintf (stderr, "winSetSpans () - GXorReverse\n");
+ ErrorF ("winSetSpans () - GXorReverse\n");
break;
case GXcopyInverted:
- fprintf (stderr, "winSetSpans () - GXcopyInverted\n");
+ ErrorF ("winSetSpans () - GXcopyInverted\n");
break;
case GXorInverted:
- fprintf (stderr, "winSetSpans () - GXorInverted\n");
+ ErrorF ("winSetSpans () - GXorInverted\n");
break;
case GXnand:
- fprintf (stderr, "winSetSpans () - GXnand\n");
+ ErrorF ("winSetSpans () - GXnand\n");
break;
case GXset:
- fprintf (stderr, "winSetSpans () - GXset\n");
+ ErrorF ("winSetSpans () - GXset\n");
default:
- fprintf (stderr, "winSetSpans () - Unknown ROP\n");
+ ErrorF ("winSetSpans () - Unknown ROP\n");
break;
}
#endif