diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2019-11-01 16:44:08 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2019-11-01 16:44:08 +0100 |
commit | 7b63809aefde4b45684a71d0a60e0c00b287837a (patch) | |
tree | 4e5a7216dd84d25aae7bae01dd0e2f650401e537 | |
parent | 753535e390c1036e12d1fc593a232782a68bb927 (diff) | |
parent | 2a0994122ff23cdcb852596a457ce3e57e48f9df (diff) | |
download | nx-libs-7b63809aefde4b45684a71d0a60e0c00b287837a.tar.gz nx-libs-7b63809aefde4b45684a71d0a60e0c00b287837a.tar.bz2 nx-libs-7b63809aefde4b45684a71d0a60e0c00b287837a.zip |
Merge branch 'uli42-pr/fix_broken_damage' into 3.6.x
Attributes GH PR #870: https://github.com/ArcticaProject/nx-libs/pull/870
-rw-r--r-- | nx-X11/programs/Xserver/Imakefile | 5 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Imakefile | 5 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/NXdamage.c | 225 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/miext/damage/Imakefile | 2 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/miext/damage/damage.c | 64 |
5 files changed, 19 insertions, 282 deletions
diff --git a/nx-X11/programs/Xserver/Imakefile b/nx-X11/programs/Xserver/Imakefile index cd81c650b..8c281c453 100644 --- a/nx-X11/programs/Xserver/Imakefile +++ b/nx-X11/programs/Xserver/Imakefile @@ -134,9 +134,7 @@ INSTPGMFLAGS = OS = os/LibraryTargetName(os) BSDEMUL = $(DEPXBSDLIB) FB = fb/LibraryTargetName(fb) -#if (!(defined(NXAgentServer) && NXAgentServer)) DAMAGE = miext/damage/LibraryTargetName(damage) -#endif SHADOW = miext/shadow/LibraryTargetName(shadow) LAYER = miext/layer/LibraryTargetName(layer) #if !HasFfs && (defined(mingwArchitecture) || defined(cygwinArchitecture)) @@ -247,7 +245,6 @@ NXAGENTOBJS = hw/nxagent/miinitext.o \ hw/nxagent/NXextension.o \ hw/nxagent/NXglxext.o \ hw/nxagent/NXresource.o \ - hw/nxagent/NXdamage.o \ $(NULL) #elif !defined(Win32Architecture) NXAGENTOBJS = hw/nxagent/miinitext.o \ @@ -264,7 +261,6 @@ NXAGENTOBJS = hw/nxagent/miinitext.o \ hw/nxagent/NXglxext.o \ hw/nxagent/NXxvdisp.o \ hw/nxagent/NXresource.o \ - hw/nxagent/NXdamage.o \ $(NULL) #else NXAGENTOBJS = hw/nxagent/miinitext.o \ @@ -281,7 +277,6 @@ NXAGENTOBJS = hw/nxagent/miinitext.o \ hw/nxagent/NXglxext.o \ hw/nxagent/NXxvdisp.o \ hw/nxagent/NXresource.o \ - hw/nxagent/NXdamage.o \ dix/main.o \ $(NULL) #endif 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 ef50edbee..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdamage.c +++ /dev/null @@ -1,225 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine (http://www.nomachine.com) */ -/* Copyright (c) 2008-2014 Oleksandr Shneyder <o.shneyder@phoca-gmbh.de> */ -/* Copyright (c) 2011-2016 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>*/ -/* Copyright (c) 2014-2016 Mihai Moldovan <ionic@ionic.de> */ -/* Copyright (c) 2014-2016 Ulrich Sibiller <uli42@gmx.de> */ -/* 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 "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); - else - 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); - else - 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); - else - (*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); - else - (*pGC->ops->ImageText16)(pDrawable, pGC, x, y, count, chars); - - DAMAGE_GC_OP_EPILOGUE(pGC, pDrawable); -} - 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, |