Commit 73f88998 authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

NXglyphcurs.c: use dixChangeCG()

parent 03d31d2a
...@@ -100,6 +100,7 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, uns ...@@ -100,6 +100,7 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, uns
PixmapPtr ppix; PixmapPtr ppix;
long nby; long nby;
char *pbits; char *pbits;
ChangeGCVal gcval[3];
unsigned char char2b[2]; unsigned char char2b[2];
/* turn glyph index into a protocol-format char2b */ /* turn glyph index into a protocol-format char2b */
...@@ -114,7 +115,8 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, uns ...@@ -114,7 +115,8 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, uns
/* zeroing the (pad) bits seems to help some ddx cursor handling */ /* zeroing the (pad) bits seems to help some ddx cursor handling */
bzero(pbits, nby); bzero(pbits, nby);
ppix = fbCreatePixmap(pScreen, cm->width, cm->height, 1, ppix = fbCreatePixmap(pScreen, cm->width,
cm->height, 1,
CREATE_PIXMAP_USAGE_SCRATCH); CREATE_PIXMAP_USAGE_SCRATCH);
pGC = GetScratchGC(1, pScreen); pGC = GetScratchGC(1, pScreen);
if (!ppix || !pGC) if (!ppix || !pGC)
...@@ -143,28 +145,21 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, uns ...@@ -143,28 +145,21 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, uns
rect.width = cm->width; rect.width = cm->width;
rect.height = cm->height; rect.height = cm->height;
pGC->stateChanges |= GCFunction | GCForeground | GCFont; /* fill the pixmap with 0 */
pGC->alu = GXcopy; gcval[0].val = GXcopy;
gcval[1].val = 0;
pGC->fgPixel = 0; gcval[2].ptr = (void *)pfont;
dixChangeGC(NullClient, pGC, GCFunction | GCForeground | GCFont,
pfont->refcnt++; NULL, gcval);
if (pGC->font)
CloseFont(pGC->font, (Font)0);
pGC->font = pfont;
ValidateGC((DrawablePtr)ppix, pGC); ValidateGC((DrawablePtr)ppix, pGC);
fbPolyFillRect((DrawablePtr)ppix, pGC, 1, &rect); fbPolyFillRect((DrawablePtr)ppix, pGC, 1, &rect);
/* draw the glyph */ /* draw the glyph */
pGC->fgPixel = 1; gcval[0].val = 1;
dixChangeGC(NullClient, pGC, GCForeground, NULL, gcval);
pGC->stateChanges |= GCForeground;
ValidateGC((DrawablePtr)ppix, pGC); ValidateGC((DrawablePtr)ppix, pGC);
miPolyText16((DrawablePtr)ppix, pGC, (int)cm->xhot, (int)cm->yhot, (int)1, (unsigned short*)char2b); miPolyText16((DrawablePtr)ppix, pGC, (int)cm->xhot, (int)cm->yhot,
(int)1, (unsigned short*)char2b);
fbGetImage((DrawablePtr)ppix, 0, 0, cm->width, cm->height, fbGetImage((DrawablePtr)ppix, 0, 0, cm->width, cm->height,
XYPixmap, 1, pbits); XYPixmap, 1, pbits);
*ppbits = (unsigned char *)pbits; *ppbits = (unsigned char *)pbits;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment