diff options
Diffstat (limited to 'nx-X11/programs/Xserver/miext/damage')
-rw-r--r-- | nx-X11/programs/Xserver/miext/damage/Imakefile | 2 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/miext/damage/damage.c | 64 |
2 files changed, 19 insertions, 47 deletions
diff --git a/nx-X11/programs/Xserver/miext/damage/Imakefile b/nx-X11/programs/Xserver/miext/damage/Imakefile index 900f52add..25d15984c 100644 --- a/nx-X11/programs/Xserver/miext/damage/Imakefile +++ b/nx-X11/programs/Xserver/miext/damage/Imakefile @@ -5,7 +5,6 @@ DEFINES = -DROOTLESS_WORKAROUND #endif -#if (!(defined(NXAgentServer) && NXAgentServer)) SRCS = damage.c OBJS = damage.o @@ -22,7 +21,6 @@ NormalLibraryTarget(damage,$(OBJS)) LintLibraryTarget(damage,$(SRCS)) NormalLintTarget($(SRCS)) -#endif DependTarget() diff --git a/nx-X11/programs/Xserver/miext/damage/damage.c b/nx-X11/programs/Xserver/miext/damage/damage.c index 9c9161d36..5ec118128 100644 --- a/nx-X11/programs/Xserver/miext/damage/damage.c +++ b/nx-X11/programs/Xserver/miext/damage/damage.c @@ -1335,9 +1335,7 @@ damageDamageChars (DrawablePtr pDrawable, #define TT_POLY16 2 #define TT_IMAGE16 3 -#ifndef NXAGENT_SERVER - -static int +static void damageText (DrawablePtr pDrawable, GCPtr pGC, int x, @@ -1348,38 +1346,28 @@ damageText (DrawablePtr pDrawable, Bool textType) { CharInfoPtr *charinfo; - CharInfoPtr *info; unsigned long i; unsigned int n; - int w; Bool imageblt; imageblt = (textType == TT_IMAGE8) || (textType == TT_IMAGE16); + if (!checkGCDamage(pDrawable, pGC)) + return; + charinfo = (CharInfoPtr *) malloc(count * sizeof(CharInfoPtr)); if (!charinfo) - return x; + return; GetGlyphs(pGC->font, count, (unsigned char *)chars, fontEncoding, &i, charinfo); n = (unsigned int)i; - w = 0; - if (!imageblt) - for (info = charinfo; i--; info++) - w += (*info)->metrics.characterWidth; if (n != 0) { damageDamageChars (pDrawable, pGC->font, x + pDrawable->x, y + pDrawable->y, n, charinfo, imageblt, pGC->subWindowMode); - if (imageblt) - (*pGC->ops->ImageGlyphBlt)(pDrawable, pGC, x, y, n, charinfo, - FONTGLYPHS(pGC->font)); - else - (*pGC->ops->PolyGlyphBlt)(pDrawable, pGC, x, y, n, charinfo, - FONTGLYPHS(pGC->font)); } free(charinfo); - return x + w; } static int @@ -1391,12 +1379,9 @@ damagePolyText8(DrawablePtr pDrawable, char *chars) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (checkGCDamage (pDrawable, pGC)) - x = damageText (pDrawable, pGC, x, y, (unsigned long) count, chars, - Linear8Bit, TT_POLY8); - else - x = (*pGC->ops->PolyText8)(pDrawable, pGC, x, y, count, chars); + damageText(pDrawable, pGC, x, y, (unsigned long) count, chars, + Linear8Bit, TT_POLY8); + x = (*pGC->ops->PolyText8) (pDrawable, pGC, x, y, count, chars); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); return x; } @@ -1410,13 +1395,10 @@ damagePolyText16(DrawablePtr pDrawable, unsigned short *chars) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (checkGCDamage (pDrawable, pGC)) - x = damageText (pDrawable, pGC, x, y, (unsigned long) count, (char *) chars, - FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit, - TT_POLY16); - else - x = (*pGC->ops->PolyText16)(pDrawable, pGC, x, y, count, chars); + damageText (pDrawable, pGC, x, y, (unsigned long) count, (char *) chars, + FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit, + TT_POLY16); + x = (*pGC->ops->PolyText16) (pDrawable, pGC, x, y, count, chars); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); return x; } @@ -1430,12 +1412,9 @@ damageImageText8(DrawablePtr pDrawable, char *chars) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (checkGCDamage (pDrawable, pGC)) - damageText (pDrawable, pGC, x, y, (unsigned long) count, chars, - Linear8Bit, TT_IMAGE8); - else - (*pGC->ops->ImageText8)(pDrawable, pGC, x, y, count, chars); + damageText (pDrawable, pGC, x, y, (unsigned long) count, chars, Linear8Bit, + TT_IMAGE8); + (*pGC->ops->ImageText8) (pDrawable, pGC, x, y, count, chars); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } @@ -1448,18 +1427,13 @@ damageImageText16(DrawablePtr pDrawable, unsigned short *chars) { DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable); - - if (checkGCDamage (pDrawable, pGC)) - damageText (pDrawable, pGC, x, y, (unsigned long) count, (char *) chars, - FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit, - TT_IMAGE16); - else - (*pGC->ops->ImageText16)(pDrawable, pGC, x, y, count, chars); + damageText (pDrawable, pGC, x, y, (unsigned long) count, (char *) chars, + FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit, + TT_IMAGE16); + (*pGC->ops->ImageText16) (pDrawable, pGC, x, y, count, chars); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } -#endif /* NXAGENT_SERVER */ - static void damageImageGlyphBlt(DrawablePtr pDrawable, GCPtr pGC, |