From ca7c1c86155a26ee7779a78cfc09900942eab4ff Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Wed, 30 Oct 2019 17:50:44 +0100 Subject: NXdamage.x fix wrong backport f0ba303d48439e0ebb572d56db972995388ac865 errornously added the "else" which had been explicitly removed in NX 3.0.0-28 with this comment: - Changed damage's GCOps functions drawing text. This was needed be- cause the original functions didn't call agent GCOps if the drawable was registered for damage events. --- nx-X11/programs/Xserver/hw/nxagent/NXdamage.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'nx-X11/programs/Xserver/hw') diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdamage.c b/nx-X11/programs/Xserver/hw/nxagent/NXdamage.c index ef50edbee..3be717f9e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdamage.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdamage.c @@ -156,8 +156,10 @@ damagePolyText8(DrawablePtr pDrawable, if (checkGCDamage (pDrawable, pGC)) x = damageText (pDrawable, pGC, x, y, (unsigned long) count, chars, Linear8Bit, TT_POLY8); +#ifndef NXAGENT_SERVER else - x = (*pGC->ops->PolyText8)(pDrawable, pGC, x, y, count, chars); +#endif + x = (*pGC->ops->PolyText8)(pDrawable, pGC, x, y, count, chars); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); return x; @@ -177,8 +179,10 @@ damagePolyText16(DrawablePtr pDrawable, x = damageText (pDrawable, pGC, x, y, (unsigned long) count, (char *) chars, FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit, TT_POLY16); +#ifndef NXAGENT_SERVER else - x = (*pGC->ops->PolyText16)(pDrawable, pGC, x, y, count, chars); +#endif + x = (*pGC->ops->PolyText16)(pDrawable, pGC, x, y, count, chars); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); return x; @@ -197,8 +201,10 @@ damageImageText8(DrawablePtr pDrawable, if (checkGCDamage (pDrawable, pGC)) damageText (pDrawable, pGC, x, y, (unsigned long) count, chars, Linear8Bit, TT_IMAGE8); +#ifndef NXAGENT_SERVER else - (*pGC->ops->ImageText8)(pDrawable, pGC, x, y, count, chars); +#endif + (*pGC->ops->ImageText8)(pDrawable, pGC, x, y, count, chars); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } @@ -217,8 +223,10 @@ damageImageText16(DrawablePtr pDrawable, damageText (pDrawable, pGC, x, y, (unsigned long) count, (char *) chars, FONTLASTROW(pGC->font) == 0 ? Linear16Bit : TwoD16Bit, TT_IMAGE16); +#ifndef NXAGENT_SERVER else - (*pGC->ops->ImageText16)(pDrawable, pGC, x, y, count, chars); +#endif + (*pGC->ops->ImageText16)(pDrawable, pGC, x, y, count, chars); DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); } -- cgit v1.2.3 From 83d9cd4e96824a7533e19b596efd6f159254557f Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Wed, 30 Oct 2019 18:26:31 +0100 Subject: 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 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 Reviewed-by: Eric Anholt Signed-off-by: Adam Jackson --- nx-X11/programs/Xserver/hw/nxagent/NXdamage.c | 181 -------------------------- 1 file changed, 181 deletions(-) (limited to 'nx-X11/programs/Xserver/hw') 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 - -/* 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); -} -- cgit v1.2.3 From 2a0994122ff23cdcb852596a457ce3e57e48f9df Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Wed, 30 Oct 2019 18:34:05 +0100 Subject: Drop NXdamage.c With the previous commits this file finally becomes obsolete. --- nx-X11/programs/Xserver/hw/nxagent/Imakefile | 5 --- nx-X11/programs/Xserver/hw/nxagent/NXdamage.c | 52 --------------------------- 2 files changed, 57 deletions(-) delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXdamage.c (limited to 'nx-X11/programs/Xserver/hw') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Imakefile b/nx-X11/programs/Xserver/hw/nxagent/Imakefile index ff9538f3e..c300e41db 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Imakefile +++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile @@ -21,7 +21,6 @@ SRCS = \ NXglxext.c \ NXxvdisp.c \ NXresource.c \ - NXdamage.c \ NXmitrap.c \ Args.c \ Binder.c \ @@ -81,7 +80,6 @@ OBJS = \ NXglxext.o \ NXxvdisp.o \ NXresource.o \ - NXdamage.o \ NXmitrap.o \ Args.o \ Binder.o \ @@ -139,7 +137,6 @@ INCLUDES = \ -I../../mi \ -I../../include \ -I../../os \ - -I../../miext/damage \ -I../../miext/cw \ -I../../GL/glx \ -I../../GL/include \ @@ -164,7 +161,6 @@ INCLUDES = \ -I../../GL/include \ -I../../../../lib/GL/include \ -I../../Xext \ - -I../../miext/damage \ -I../../miext/cw \ -I../../../../lib/include/X11 \ -I$(EXTINCSRC) -I$(XINCLUDESRC) \ @@ -185,7 +181,6 @@ INCLUDES = \ -I../../GL/include \ -I../../../../lib/GL/include \ -I../../Xext \ - -I../../miext/damage \ -I../../miext/cw \ -I../../../../../nxcomp \ -I../../../../../nxcompshad \ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdamage.c b/nx-X11/programs/Xserver/hw/nxagent/NXdamage.c deleted file mode 100644 index 90aae6a31..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdamage.c +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ -/* Copyright (c) 2008-2014 Oleksandr Shneyder */ -/* Copyright (c) 2011-2016 Mike Gabriel */ -/* Copyright (c) 2014-2016 Mihai Moldovan */ -/* Copyright (c) 2014-2016 Ulrich Sibiller */ -/* Copyright (c) 2015-2016 Qindel Group (http://www.qindel.com) */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of the aforementioned persons and companies. */ -/* */ -/* Redistribution and use of the present software is allowed according */ -/* to terms specified in the file LICENSE which comes in the source */ -/* distribution. */ -/* */ -/* All rights reserved. */ -/* */ -/* NOTE: This software has received contributions from various other */ -/* contributors, only the core maintainers and supporters are listed as */ -/* copyright holders. Please contact us, if you feel you should be listed */ -/* as copyright holder, as well. */ -/* */ -/**************************************************************************/ - -/* - * $Id: damage.c,v 1.19 2005/10/06 21:55:41 anholt Exp $ - * - * Copyright © 2003 Keith Packard - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#include "../../miext/damage/damage.c" - - -- cgit v1.2.3