Unverified Commit 5f806ddf authored by Mike Gabriel's avatar Mike Gabriel

Merge branch 'uli42-pr/simplify_nxglyph' into 3.6.x

parents 03d31d2a fcbd2710
...@@ -161,30 +161,35 @@ AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id) ...@@ -161,30 +161,35 @@ AddGlyph (GlyphSetPtr glyphSet, GlyphPtr glyph, Glyph id)
CheckDuplicates (&globalGlyphs[glyphSet->fdepth], "AddGlyph bottom"); CheckDuplicates (&globalGlyphs[glyphSet->fdepth], "AddGlyph bottom");
} }
GlyphPtr FindGlyph (GlyphSetPtr glyphSet, Glyph id) GlyphPtr
FindGlyph (GlyphSetPtr glyphSet, Glyph id)
{ {
GlyphRefPtr gr; GlyphPtr glyph;
GlyphPtr glyph;
#ifdef NXAGENT_SERVER
gr = FindGlyphRef (&glyphSet->hash, id, FALSE, 0); GlyphRefPtr gr = FindGlyphRef (&glyphSet->hash, id, FALSE, 0);
glyph = gr -> glyph; glyph = gr -> glyph;
#else
if (glyph == DeletedGlyph) glyph = FindGlyphRef (&glyphSet->hash, id, FALSE, 0)->glyph;
{ #endif
glyph = 0; if (glyph == DeletedGlyph)
} {
else if (gr -> corruptedGlyph == 1) glyph = 0;
{ }
#ifdef DEBUG #ifdef NXAGENT_SERVER
fprintf(stderr, "FindGlyphRef: Going to synchronize the glyph [%p] for glyphset [%p].\n", else if (gr -> corruptedGlyph == 1)
{
#ifdef DEBUG
fprintf(stderr, "FindGlyphRef: Going to synchronize the glyph [%p] for glyphset [%p].\n",
(void *) glyph, (void *) glyphSet); (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)); (CARD8*)(glyph + 1), glyph -> size - sizeof(xGlyphInfo));
} }
#endif
return glyph; return glyph;
} }
Bool Bool
...@@ -269,18 +274,21 @@ miGlyphs (CARD8 op, ...@@ -269,18 +274,21 @@ miGlyphs (CARD8 op,
BoxRec extents; BoxRec extents;
CARD32 component_alpha; CARD32 component_alpha;
#ifdef NXAGENT_SERVER
/* /*
* Get rid of the warning. * Get rid of the warning.
*/ */
extents.x1 = 0; extents.x1 = 0;
extents.y1 = 0; extents.y1 = 0;
#endif
if (maskFormat) if (maskFormat)
{ {
GCPtr pGC; GCPtr pGC;
xRectangle rect; xRectangle rect;
#ifdef NXAGENT_SERVER
if (nxagentGlyphsExtents != NullBox) if (nxagentGlyphsExtents != NullBox)
{ {
memcpy(&extents, nxagentGlyphsExtents, sizeof(BoxRec)); memcpy(&extents, nxagentGlyphsExtents, sizeof(BoxRec));
...@@ -293,6 +301,9 @@ miGlyphs (CARD8 op, ...@@ -293,6 +301,9 @@ miGlyphs (CARD8 op,
memcpy(nxagentGlyphsExtents, &extents, sizeof(BoxRec)); memcpy(nxagentGlyphsExtents, &extents, sizeof(BoxRec));
} }
#else
GlyphExtents (nlist, list, glyphs, &extents);
#endif
if (extents.x2 <= extents.x1 || extents.y2 <= extents.y1) if (extents.x2 <= extents.x1 || extents.y2 <= extents.y1)
return; return;
...@@ -364,6 +375,7 @@ miGlyphs (CARD8 op, ...@@ -364,6 +375,7 @@ miGlyphs (CARD8 op,
glyph->info.width, glyph->info.height, glyph->info.width, glyph->info.height,
0, 0, -1, (void *) (glyph + 1)); 0, 0, -1, (void *) (glyph + 1));
#ifdef NXAGENT_SERVER
/* /*
* The following line fixes a problem with glyphs that appeared * The following line fixes a problem with glyphs that appeared
* as clipped. It was a side effect due the validate function * as clipped. It was a side effect due the validate function
...@@ -373,7 +385,7 @@ miGlyphs (CARD8 op, ...@@ -373,7 +385,7 @@ miGlyphs (CARD8 op,
*/ */
pPicture->pDrawable->serialNumber = NEXT_SERIAL_NUMBER; pPicture->pDrawable->serialNumber = NEXT_SERIAL_NUMBER;
#endif
pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; pPixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER;
if (maskFormat) if (maskFormat)
{ {
......
...@@ -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