aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.NX.original
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.NX.original')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.NX.original51
1 files changed, 48 insertions, 3 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.NX.original
index 5d6f71475..be961c400 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.NX.original
+++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.NX.original
@@ -1,6 +1,6 @@
/**************************************************************************/
/* */
-/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */
+/* Copyright (c) 2001, 2010 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 */
@@ -9,7 +9,7 @@
/* */
/* Check http://www.nomachine.com/licensing.html for applicability. */
/* */
-/* NX and NoMachine are trademarks of NoMachine S.r.l. */
+/* NX and NoMachine are trademarks of Medialogic S.p.A. */
/* */
/* All rights reserved. */
/* */
@@ -62,6 +62,7 @@
#include "Screen.h"
#include "Pixmaps.h"
#include "Drawable.h"
+#include "Render.h"
#define PANIC
#define WARNING
@@ -1063,7 +1064,47 @@ static void initGradient(SourcePictPtr pGradient, int stopCount,
static PicturePtr createSourcePicture(void)
{
PicturePtr pPicture;
- pPicture = (PicturePtr) xalloc(sizeof(PictureRec));
+
+ extern int nxagentPicturePrivateIndex;
+
+ unsigned int totalPictureSize;
+
+ DevUnion *ppriv;
+
+ char *privPictureRecAddr;
+
+ int i;
+
+ /*
+ * Compute size of entire PictureRect, plus privates.
+ */
+
+ totalPictureSize = sizeof(PictureRec) +
+ picturePrivateCount * sizeof(DevUnion) +
+ sizeof(nxagentPrivPictureRec);
+
+ pPicture = (PicturePtr) xalloc(totalPictureSize);
+
+ if (pPicture != NULL)
+ {
+ ppriv = (DevUnion *) (pPicture + 1);
+
+ for (i = 0; i < picturePrivateCount; ++i)
+ {
+ /*
+ * Other privates are inaccessible.
+ */
+
+ ppriv[i].ptr = NULL;
+ }
+
+ privPictureRecAddr = (char *) &ppriv[picturePrivateCount];
+
+ ppriv[nxagentPicturePrivateIndex].ptr = (pointer) privPictureRecAddr;
+
+ pPicture -> devPrivates = ppriv;
+ }
+
pPicture->pDrawable = 0;
pPicture->pFormat = 0;
pPicture->pNext = 0;
@@ -1697,6 +1738,10 @@ FreePicture (pointer value,
if (--pPicture->refcnt == 0)
{
+#ifdef NXAGENT_SERVER
+ nxagentDestroyPicture(pPicture);
+#endif
+
if (pPicture->transform)
xfree (pPicture->transform);
if (!pPicture->pDrawable) {