From 73f88998a7187b929307331618e6115584ccb9b5 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Wed, 22 May 2019 23:35:12 +0200 Subject: NXglyphcurs.c: use dixChangeCG() --- nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c | 31 ++++++++++-------------- 1 file changed, 13 insertions(+), 18 deletions(-) (limited to 'nx-X11/programs/Xserver') 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; -- cgit v1.2.3 From 67b03f5d5ae1674fa69794728ba5f36e402accfc Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Wed, 22 May 2019 23:58:15 +0200 Subject: NXglyph.c: adapt FindGlyph() to better match render/glyph.c no function change --- nx-X11/programs/Xserver/hw/nxagent/NXglyph.c | 43 ++++++++++++++++------------ 1 file changed, 24 insertions(+), 19 deletions(-) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c b/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c index 72d8242bd..a0817c622 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c @@ -161,30 +161,35 @@ AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id) CheckDuplicates (&globalGlyphs[glyphSet->fdepth], "AddGlyph bottom"); } -GlyphPtr FindGlyph (GlyphSetPtr glyphSet, Glyph id) +GlyphPtr +FindGlyph (GlyphSetPtr glyphSet, Glyph id) { - GlyphRefPtr gr; - GlyphPtr glyph; - - gr = FindGlyphRef (&glyphSet->hash, id, FALSE, 0); - glyph = gr -> glyph; - - if (glyph == DeletedGlyph) - { - glyph = 0; - } - else if (gr -> corruptedGlyph == 1) - { - #ifdef DEBUG - fprintf(stderr, "FindGlyphRef: Going to synchronize the glyph [%p] for glyphset [%p].\n", + GlyphPtr glyph; + +#ifdef NXAGENT_SERVER + GlyphRefPtr gr = FindGlyphRef (&glyphSet->hash, id, FALSE, 0); + glyph = gr -> glyph; +#else + glyph = FindGlyphRef (&glyphSet->hash, id, FALSE, 0)->glyph; +#endif + if (glyph == DeletedGlyph) + { + glyph = 0; + } +#ifdef NXAGENT_SERVER + else if (gr -> corruptedGlyph == 1) + { + #ifdef DEBUG + fprintf(stderr, "FindGlyphRef: Going to synchronize the glyph [%p] for glyphset [%p].\n", (void *) glyph, (void *) glyphSet); - #endif + #endif - nxagentAddGlyphs(glyphSet, &id, &(glyph -> info), 1, + nxagentAddGlyphs(glyphSet, &id, &(glyph -> info), 1, (CARD8*)(glyph + 1), glyph -> size - sizeof(xGlyphInfo)); - } + } +#endif - return glyph; + return glyph; } Bool -- cgit v1.2.3 From fcbd27105c968124aa9ab4a337fad51abcbbe35c Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Wed, 12 Jun 2019 00:54:40 +0200 Subject: NXglyph.c: mark NX changes --- nx-X11/programs/Xserver/hw/nxagent/NXglyph.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'nx-X11/programs/Xserver') diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c b/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c index a0817c622..022ef09f4 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c @@ -274,18 +274,21 @@ miGlyphs (CARD8 op, BoxRec extents; CARD32 component_alpha; +#ifdef NXAGENT_SERVER /* * Get rid of the warning. */ extents.x1 = 0; extents.y1 = 0; +#endif if (maskFormat) { GCPtr pGC; xRectangle rect; +#ifdef NXAGENT_SERVER if (nxagentGlyphsExtents != NullBox) { memcpy(&extents, nxagentGlyphsExtents, sizeof(BoxRec)); @@ -298,6 +301,9 @@ miGlyphs (CARD8 op, memcpy(nxagentGlyphsExtents, &extents, sizeof(BoxRec)); } +#else + GlyphExtents (nlist, list, glyphs, &extents); +#endif if (extents.x2 <= extents.x1 || extents.y2 <= extents.y1) return; @@ -369,6 +375,7 @@ miGlyphs (CARD8 op, glyph->info.width, glyph->info.height, 0, 0, -1, (void *) (glyph + 1)); +#ifdef NXAGENT_SERVER /* * The following line fixes a problem with glyphs that appeared * as clipped. It was a side effect due the validate function @@ -378,7 +385,7 @@ miGlyphs (CARD8 op, */ pPicture->pDrawable->serialNumber = NEXT_SERIAL_NUMBER; - +#endif pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; if (maskFormat) { -- cgit v1.2.3