aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2015-04-14 09:42:35 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2015-04-16 17:59:18 +0200
commita5f71f084e9f32e947a04da69edb7aae96d61697 (patch)
tree03acc5d7d7bb0d35152bfc597eb788b938f09647 /nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c
parentfad840cfe558601a8ec02414f1235824bc9f3168 (diff)
downloadnx-libs-a5f71f084e9f32e947a04da69edb7aae96d61697.tar.gz
nx-libs-a5f71f084e9f32e947a04da69edb7aae96d61697.tar.bz2
nx-libs-a5f71f084e9f32e947a04da69edb7aae96d61697.zip
NXAGENT_UPGRADE code cleanup:
NX agent contains/ed two build trees. An old one (probably pre-3.x.y) and a "newer" one. The "newer" code tree used to become enabled by setting NXUpgradeAgentServer in nx-X11/config/cf/host.def to YES. As building the NXUpgradeAgentServer has been the default for years now, we drop all code that does not get used at build time for NXUpgradeAgentServer == YES (i.e., the code that belongs to the pre-3.x.y phase of NX agent).
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c129
1 files changed, 79 insertions, 50 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c b/nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c
index 7d0a99572..f418654b4 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXmitrap.c
@@ -1,13 +1,24 @@
-#ifdef NXAGENT_UPGRADE
-
-#include "X/NXmitrap.c"
-
-#else
+/**************************************************************************/
+/* */
+/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */
+/* */
+/* NXAGENT, NX protocol compression and NX extensions to this software */
+/* are copyright of NoMachine. Redistribution and use of the present */
+/* software is allowed according to terms specified in the file LICENSE */
+/* which comes in the source distribution. */
+/* */
+/* Check http://www.nomachine.com/licensing.html for applicability. */
+/* */
+/* NX and NoMachine are trademarks of Medialogic S.p.A. */
+/* */
+/* All rights reserved. */
+/* */
+/**************************************************************************/
/*
- * $XFree86: xc/programs/Xserver/render/mitrap.c,v 1.9 2002/11/05 23:39:16 keithp Exp $
+ * $XFree86: xc/programs/Xserver/render/mitrap.c,v 1.8 2002/09/03 19:28:28 keithp Exp $
*
- * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
+ * Copyright © 2002 Keith Packard, member of The XFree86 Project, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
@@ -28,6 +39,10 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
#include "scrnintstr.h"
#include "gcstruct.h"
#include "pixmapstr.h"
@@ -37,6 +52,12 @@
#include "picturestr.h"
#include "mipict.h"
+#ifdef NXAGENT_SERVER
+
+#include "Render.h"
+
+#endif
+
PicturePtr
miCreateAlphaPicture (ScreenPtr pScreen,
PicturePtr pDst,
@@ -142,17 +163,46 @@ miTrapezoids (CARD8 op,
{
ScreenPtr pScreen = pDst->pDrawable->pScreen;
PictureScreenPtr ps = GetPictureScreen(pScreen);
- PicturePtr pPicture = 0;
- BoxRec bounds;
- INT16 xDst, yDst;
- INT16 xRel, yRel;
-
- xDst = traps[0].left.p1.x >> 16;
- yDst = traps[0].left.p1.y >> 16;
-
- if (maskFormat)
+
+ /*
+ * Check for solid alpha add
+ */
+ if (op == PictOpAdd && miIsSolidAlpha (pSrc))
+ {
+ for (; ntrap; ntrap--, traps++)
+ (*ps->RasterizeTrapezoid) (pDst, traps, 0, 0);
+ }
+ else if (maskFormat)
{
- miTrapezoidBounds (ntrap, traps, &bounds);
+ PicturePtr pPicture;
+ BoxRec bounds;
+ INT16 xDst, yDst;
+ INT16 xRel, yRel;
+
+ xDst = traps[0].left.p1.x >> 16;
+ yDst = traps[0].left.p1.y >> 16;
+
+ #ifdef NXAGENT_SERVER
+
+ if (nxagentTrapezoidExtents != NullBox)
+ {
+ memcpy(&bounds, nxagentTrapezoidExtents, sizeof(BoxRec));
+ }
+ else
+ {
+ nxagentTrapezoidExtents = (BoxPtr) xalloc(sizeof(BoxRec));
+
+ miTrapezoidBounds (ntrap, traps, &bounds);
+
+ memcpy(nxagentTrapezoidExtents, &bounds, sizeof(BoxRec));
+ }
+
+ #else
+
+ miTrapezoidBounds (ntrap, traps, &bounds);
+
+ #endif
+
if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2)
return;
pPicture = miCreateAlphaPicture (pScreen, pDst, maskFormat,
@@ -160,37 +210,9 @@ miTrapezoids (CARD8 op,
bounds.y2 - bounds.y1);
if (!pPicture)
return;
- }
- for (; ntrap; ntrap--, traps++)
- {
- if (!xTrapezoidValid(traps))
- continue;
- if (!maskFormat)
- {
- miTrapezoidBounds (1, traps, &bounds);
- if (bounds.y1 >= bounds.y2 || bounds.x1 >= bounds.x2)
- continue;
- pPicture = miCreateAlphaPicture (pScreen, pDst, maskFormat,
- bounds.x2 - bounds.x1,
- bounds.y2 - bounds.y1);
- if (!pPicture)
- continue;
- }
- (*ps->RasterizeTrapezoid) (pPicture, traps,
- -bounds.x1, -bounds.y1);
- if (!maskFormat)
- {
- xRel = bounds.x1 + xSrc - xDst;
- yRel = bounds.y1 + ySrc - yDst;
- CompositePicture (op, pSrc, pPicture, pDst,
- xRel, yRel, 0, 0, bounds.x1, bounds.y1,
- bounds.x2 - bounds.x1,
- bounds.y2 - bounds.y1);
- FreePicture (pPicture, 0);
- }
- }
- if (maskFormat)
- {
+ for (; ntrap; ntrap--, traps++)
+ (*ps->RasterizeTrapezoid) (pPicture, traps,
+ -bounds.x1, -bounds.y1);
xRel = bounds.x1 + xSrc - xDst;
yRel = bounds.y1 + ySrc - yDst;
CompositePicture (op, pSrc, pPicture, pDst,
@@ -199,6 +221,13 @@ miTrapezoids (CARD8 op,
bounds.y2 - bounds.y1);
FreePicture (pPicture, 0);
}
+ else
+ {
+ if (pDst->polyEdge == PolyEdgeSharp)
+ maskFormat = PictureMatchFormat (pScreen, 1, PICT_a1);
+ else
+ maskFormat = PictureMatchFormat (pScreen, 8, PICT_a8);
+ for (; ntrap; ntrap--, traps++)
+ miTrapezoids (op, pSrc, pDst, maskFormat, xSrc, ySrc, 1, traps);
+ }
}
-
-#endif /* NXAGENT_UPGRADE */