aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-10-30 18:26:31 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-11-01 16:42:55 +0100
commit83d9cd4e96824a7533e19b596efd6f159254557f (patch)
tree8c124b353a4d912aaed733db112a15e4be8053a6 /nx-X11/programs/Xserver
parentca7c1c86155a26ee7779a78cfc09900942eab4ff (diff)
downloadnx-libs-83d9cd4e96824a7533e19b596efd6f159254557f.tar.gz
nx-libs-83d9cd4e96824a7533e19b596efd6f159254557f.tar.bz2
nx-libs-83d9cd4e96824a7533e19b596efd6f159254557f.zip
damage: Don't rewrite Text ops to GlyphBlt ops
This backport of a 2013 Xorg fix changes miext/damage.c so that the text functions (damageText, damage{Poly,Image}Text{8,16}) finally are very similar to the changes that NX introduced in 2007 with nxagent-3.0.0-28. Fun fact: the original freedesktop bug mentioned below is from 2005 and the fix came in 2013... Next commit will be the complete drop of NXdamage.c. commit 0f3f8e4295d4c05f33b93e0ffd2f6f8cd5759bf7 Author: Adam Jackson <ajax@redhat.com> Date: Wed Aug 21 11:13:11 2013 -0400 damage: Don't rewrite Text ops to GlyphBlt ops There's no particularly good reason to, and it breaks Xnest. Bugzilla: http://bugs.freedesktop.org/2454 Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'nx-X11/programs/Xserver')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXdamage.c181
-rw-r--r--nx-X11/programs/Xserver/miext/damage/damage.c64
2 files changed, 19 insertions, 226 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdamage.c b/nx-X11/programs/Xserver/hw/nxagent/NXdamage.c
index 3be717f9e..90aae6a31 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXdamage.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXdamage.c
@@ -47,187 +47,6 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-#include "regionstr.h"
-#include "../../miext/damage/damage.h"
-#include <X11/fonts/font.h>
-
-/* prototypes */
-
-static int
-damageText (DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- unsigned long count,
- char *chars,
- FontEncoding fontEncoding,
- Bool textType);
-static int
-damagePolyText8(DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *chars);
-static int
-damagePolyText16(DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *chars);
-static void
-damageImageText8(DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *chars);
-static void
-damageImageText16(DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- int count,
- unsigned short *chars);
-
#include "../../miext/damage/damage.c"
-static int
-damageText (DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- unsigned long count,
- char *chars,
- FontEncoding fontEncoding,
- Bool textType)
-{
- CharInfoPtr *charinfo;
- CharInfoPtr *info;
- unsigned long i;
- unsigned int n;
- int w;
- Bool imageblt;
-
- imageblt = (textType == TT_IMAGE8) || (textType == TT_IMAGE16);
-
- charinfo = (CharInfoPtr *) malloc(count * sizeof(CharInfoPtr));
- if (!charinfo)
- return x;
-
- 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);
-
-#ifndef NXAGENT_SERVER
-
- 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));
-#endif
-
- }
- free(charinfo);
- return x + w;
-}
-
-static int
-damagePolyText8(DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- int count,
- 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);
-#ifndef NXAGENT_SERVER
- else
-#endif
- x = (*pGC->ops->PolyText8)(pDrawable, pGC, x, y, count, chars);
-
- DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
- return x;
-}
-
-static int
-damagePolyText16(DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- int count,
- 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);
-#ifndef NXAGENT_SERVER
- else
-#endif
- x = (*pGC->ops->PolyText16)(pDrawable, pGC, x, y, count, chars);
-
- DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
- return x;
-}
-
-static void
-damageImageText8(DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- int count,
- char *chars)
-{
- DAMAGE_GC_OP_PROLOGUE(pGC, pDrawable);
-
- if (checkGCDamage (pDrawable, pGC))
- damageText (pDrawable, pGC, x, y, (unsigned long) count, chars,
- Linear8Bit, TT_IMAGE8);
-#ifndef NXAGENT_SERVER
- else
-#endif
- (*pGC->ops->ImageText8)(pDrawable, pGC, x, y, count, chars);
-
- DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
-}
-
-static void
-damageImageText16(DrawablePtr pDrawable,
- GCPtr pGC,
- int x,
- int y,
- int count,
- 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);
-#ifndef NXAGENT_SERVER
- else
-#endif
- (*pGC->ops->ImageText16)(pDrawable, pGC, x, y, count, chars);
-
- DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable);
-}
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,