aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-05-22 23:35:12 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-11-02 11:36:24 +0100
commit73f88998a7187b929307331618e6115584ccb9b5 (patch)
treed4f8b5c06feddc5611b6be7adab561b7ef5e3db6 /nx-X11/programs/Xserver
parent03d31d2ab37548dffa2bc9f70608cdcc67b09d97 (diff)
downloadnx-libs-73f88998a7187b929307331618e6115584ccb9b5.tar.gz
nx-libs-73f88998a7187b929307331618e6115584ccb9b5.tar.bz2
nx-libs-73f88998a7187b929307331618e6115584ccb9b5.zip
NXglyphcurs.c: use dixChangeCG()
Diffstat (limited to 'nx-X11/programs/Xserver')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c b/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c
index 549ab4333..9f26b7d6f 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c
@@ -100,6 +100,7 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, uns
PixmapPtr ppix;
long nby;
char *pbits;
+ ChangeGCVal gcval[3];
unsigned char char2b[2];
/* turn glyph index into a protocol-format char2b */
@@ -114,7 +115,8 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, uns
/* zeroing the (pad) bits seems to help some ddx cursor handling */
bzero(pbits, nby);
- ppix = fbCreatePixmap(pScreen, cm->width, cm->height, 1,
+ ppix = fbCreatePixmap(pScreen, cm->width,
+ cm->height, 1,
CREATE_PIXMAP_USAGE_SCRATCH);
pGC = GetScratchGC(1, pScreen);
if (!ppix || !pGC)
@@ -143,28 +145,21 @@ ServerBitsFromGlyph(FontPtr pfont, unsigned ch, register CursorMetricPtr cm, uns
rect.width = cm->width;
rect.height = cm->height;
- pGC->stateChanges |= GCFunction | GCForeground | GCFont;
- pGC->alu = GXcopy;
-
- pGC->fgPixel = 0;
-
- pfont->refcnt++;
-
- if (pGC->font)
- CloseFont(pGC->font, (Font)0);
-
- pGC->font = pfont;
-
+ /* fill the pixmap with 0 */
+ gcval[0].val = GXcopy;
+ gcval[1].val = 0;
+ gcval[2].ptr = (void *)pfont;
+ dixChangeGC(NullClient, pGC, GCFunction | GCForeground | GCFont,
+ NULL, gcval);
ValidateGC((DrawablePtr)ppix, pGC);
fbPolyFillRect((DrawablePtr)ppix, pGC, 1, &rect);
/* draw the glyph */
- pGC->fgPixel = 1;
-
- pGC->stateChanges |= GCForeground;
-
+ gcval[0].val = 1;
+ dixChangeGC(NullClient, pGC, GCForeground, NULL, gcval);
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,
XYPixmap, 1, pbits);
*ppbits = (unsigned char *)pbits;