aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/dix')
-rw-r--r--xorg-server/dix/dixfonts.c54
-rw-r--r--xorg-server/dix/gc.c6
2 files changed, 22 insertions, 38 deletions
diff --git a/xorg-server/dix/dixfonts.c b/xorg-server/dix/dixfonts.c
index dc4b32cc2..bd62cc890 100644
--- a/xorg-server/dix/dixfonts.c
+++ b/xorg-server/dix/dixfonts.c
@@ -1170,6 +1170,7 @@ doPolyText(ClientPtr client, PTclosurePtr c)
enum { NEVER_SLEPT, START_SLEEP, SLEEPING } client_state = NEVER_SLEPT;
FontPathElementPtr fpe;
GC *origGC = NULL;
+ int itemSize = c->reqType == X_PolyText8 ? 1 : 2;
if (client->clientGone)
{
@@ -1255,10 +1256,6 @@ doPolyText(ClientPtr client, PTclosurePtr c)
val.ptr = pFont;
ChangeGC(NullClient, c->pGC, GCFont, &val);
ValidateGC(c->pDraw, c->pGC);
- if (c->reqType == X_PolyText8)
- c->polyText = (PolyTextPtr) c->pGC->ops->PolyText8;
- else
- c->polyText = (PolyTextPtr) c->pGC->ops->PolyText16;
}
/* Undo the refcnt++ we performed when going to sleep */
@@ -1270,7 +1267,7 @@ doPolyText(ClientPtr client, PTclosurePtr c)
else /* print a string */
{
unsigned char *pNextElt;
- pNextElt = c->pElt + TextEltHeader + (*c->pElt)*c->itemSize;
+ pNextElt = c->pElt + TextEltHeader + (*c->pElt) * itemSize;
if ( pNextElt > c->endReq)
{
err = BadLength;
@@ -1283,7 +1280,7 @@ doPolyText(ClientPtr client, PTclosurePtr c)
}
if (c->pDraw)
{
- lgerr = LoadGlyphs(client, c->pGC->font, *c->pElt, c->itemSize,
+ lgerr = LoadGlyphs(client, c->pGC->font, *c->pElt, itemSize,
c->pElt + TextEltHeader);
}
else lgerr = Successful;
@@ -1381,8 +1378,12 @@ doPolyText(ClientPtr client, PTclosurePtr c)
if (c->pDraw)
{
c->xorg += *((INT8 *)(c->pElt + 1)); /* must be signed */
- c->xorg = (* c->polyText)(c->pDraw, c->pGC, c->xorg, c->yorg,
- *c->pElt, c->pElt + TextEltHeader);
+ if (c->reqType == X_PolyText8)
+ c->xorg = (* c->pGC->ops->PolyText8)(c->pDraw, c->pGC, c->xorg, c->yorg,
+ *c->pElt, (char *) (c->pElt + TextEltHeader));
+ else
+ c->xorg = (* c->pGC->ops->PolyText16)(c->pDraw, c->pGC, c->xorg, c->yorg,
+ *c->pElt, (unsigned short *) (c->pElt + TextEltHeader));
}
c->pElt = pNextElt;
}
@@ -1442,16 +1443,7 @@ PolyText(ClientPtr client, DrawablePtr pDraw, GC *pGC, unsigned char *pElt,
local_closure.pDraw = pDraw;
local_closure.xorg = xorg;
local_closure.yorg = yorg;
- if ((local_closure.reqType = reqType) == X_PolyText8)
- {
- local_closure.polyText = (PolyTextPtr) pGC->ops->PolyText8;
- local_closure.itemSize = 1;
- }
- else
- {
- local_closure.polyText = (PolyTextPtr) pGC->ops->PolyText16;
- local_closure.itemSize = 2;
- }
+ local_closure.reqType = reqType;
local_closure.pGC = pGC;
local_closure.did = did;
local_closure.err = Success;
@@ -1469,6 +1461,7 @@ doImageText(ClientPtr client, ITclosurePtr c)
{
int err = Success, lgerr; /* err is in X error, not font error, space */
FontPathElementPtr fpe;
+ int itemSize = c->reqType == X_ImageText8 ? 1 : 2;
if (client->clientGone)
{
@@ -1493,7 +1486,7 @@ doImageText(ClientPtr client, ITclosurePtr c)
}
}
- lgerr = LoadGlyphs(client, c->pGC->font, c->nChars, c->itemSize, c->data);
+ lgerr = LoadGlyphs(client, c->pGC->font, c->nChars, itemSize, c->data);
if (lgerr == Suspended)
{
if (!ClientIsAsleep(client)) {
@@ -1515,14 +1508,14 @@ doImageText(ClientPtr client, ITclosurePtr c)
*new_closure = *c;
c = new_closure;
- data = malloc(c->nChars * c->itemSize);
+ data = malloc(c->nChars * itemSize);
if (!data)
{
free(c);
err = BadAlloc;
goto bail;
}
- memmove(data, c->data, c->nChars * c->itemSize);
+ memmove(data, c->data, c->nChars * itemSize);
c->data = data;
pGC = GetScratchGC(c->pGC->depth, c->pGC->pScreen);
@@ -1562,8 +1555,12 @@ doImageText(ClientPtr client, ITclosurePtr c)
}
if (c->pDraw)
{
- (* c->imageText)(c->pDraw, c->pGC, c->xorg, c->yorg,
- c->nChars, c->data);
+ if (c->reqType == X_ImageText8)
+ (* c->pGC->ops->ImageText8)(c->pDraw, c->pGC, c->xorg, c->yorg,
+ c->nChars, (char *) c->data);
+ else
+ (* c->pGC->ops->ImageText16)(c->pDraw, c->pGC, c->xorg, c->yorg,
+ c->nChars, (unsigned short *) c->data);
}
bail:
@@ -1601,16 +1598,7 @@ ImageText(ClientPtr client, DrawablePtr pDraw, GC *pGC, int nChars,
local_closure.data = data;
local_closure.xorg = xorg;
local_closure.yorg = yorg;
- if ((local_closure.reqType = reqType) == X_ImageText8)
- {
- local_closure.imageText = (ImageTextPtr) pGC->ops->ImageText8;
- local_closure.itemSize = 1;
- }
- else
- {
- local_closure.imageText = (ImageTextPtr) pGC->ops->ImageText16;
- local_closure.itemSize = 2;
- }
+ local_closure.reqType = reqType;
local_closure.did = did;
(void) doImageText(client, &local_closure);
diff --git a/xorg-server/dix/gc.c b/xorg-server/dix/gc.c
index 902f20675..e7bcc66f1 100644
--- a/xorg-server/dix/gc.c
+++ b/xorg-server/dix/gc.c
@@ -527,8 +527,6 @@ CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus,
pGC->numInDashList = 2;
pGC->dash = DefaultDash;
pGC->dashOffset = 0;
- pGC->lastWinOrg.x = 0;
- pGC->lastWinOrg.y = 0;
/* use the default font and stipple */
pGC->font = defaultFont;
@@ -801,7 +799,7 @@ is what fills the default tile. (maybe this comment should
go with CreateGC() or ChangeGC().)
*/
-GCPtr
+static GCPtr
CreateScratchGC(ScreenPtr pScreen, unsigned depth)
{
GCPtr pGC;
@@ -841,8 +839,6 @@ CreateScratchGC(ScreenPtr pScreen, unsigned depth)
pGC->dashOffset = 0;
pGC->numInDashList = 2;
pGC->dash = DefaultDash;
- pGC->lastWinOrg.x = 0;
- pGC->lastWinOrg.y = 0;
/* scratch GCs in the GCperDepth pool start off unused */
pGC->scratch_inuse = FALSE;