aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/dixfonts.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-09-14 14:23:04 +0000
committermarha <marha@users.sourceforge.net>2010-09-14 14:23:04 +0000
commit2ddb14008968ea365e3d395487cad2bfe154da9d (patch)
treef9d970e9dd6ee1ec835fedcadc15a8705a50e6d5 /xorg-server/dix/dixfonts.c
parentb7a6351e37e788bb25415dc79aaf2718b48d6939 (diff)
parent3815190d52f8ae453c2458335394eb5b18ab9bf5 (diff)
downloadvcxsrv-2ddb14008968ea365e3d395487cad2bfe154da9d.tar.gz
vcxsrv-2ddb14008968ea365e3d395487cad2bfe154da9d.tar.bz2
vcxsrv-2ddb14008968ea365e3d395487cad2bfe154da9d.zip
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/dix/dixfonts.c')
-rw-r--r--xorg-server/dix/dixfonts.c54
1 files changed, 21 insertions, 33 deletions
diff --git a/xorg-server/dix/dixfonts.c b/xorg-server/dix/dixfonts.c
index f1f53a13b..a363eab8e 100644
--- a/xorg-server/dix/dixfonts.c
+++ b/xorg-server/dix/dixfonts.c
@@ -1172,6 +1172,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)
{
@@ -1257,10 +1258,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 */
@@ -1272,7 +1269,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;
@@ -1285,7 +1282,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;
@@ -1383,8 +1380,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;
}
@@ -1444,16 +1445,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;
@@ -1471,6 +1463,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)
{
@@ -1495,7 +1488,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)) {
@@ -1517,14 +1510,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);
@@ -1564,8 +1557,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:
@@ -1603,16 +1600,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);