summaryrefslogtreecommitdiff
path: root/render/picture.c
diff options
context:
space:
mode:
authorKevin E Martin <kem@kem.org>2004-06-30 20:06:56 +0000
committerKevin E Martin <kem@kem.org>2004-06-30 20:06:56 +0000
commit7976ee51afcad41b611e642d2feb31d805dedcf6 (patch)
tree218e5c900399e880dd01458154896d011a2ff238 /render/picture.c
parentd5db59bd79f5d8788b99056bf9d969b5b3ad99e1 (diff)
Add Distributed Multihead X (DMX) support
Diffstat (limited to 'render/picture.c')
-rw-r--r--render/picture.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/render/picture.c b/render/picture.c
index ad746b277..ca95e56b2 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -46,6 +46,57 @@ RESTYPE PictFormatType;
RESTYPE GlyphSetType;
int PictureCmapPolicy = PictureCmapPolicyDefault;
+/* Picture Private machinery */
+
+static int picturePrivateCount;
+
+void
+ResetPicturePrivateIndex (void)
+{
+ picturePrivateCount = 0;
+}
+
+int
+AllocatePicturePrivateIndex (void)
+{
+ return picturePrivateCount++;
+}
+
+Bool
+AllocatePicturePrivate (ScreenPtr pScreen, int index2, unsigned int amount)
+{
+ PictureScreenPtr ps = GetPictureScreen(pScreen);
+ unsigned int oldamount;
+
+ /* Round up sizes for proper alignment */
+ amount = ((amount + (sizeof(long) - 1)) / sizeof(long)) * sizeof(long);
+
+ if (index2 >= ps->PicturePrivateLen)
+ {
+ unsigned int *nsizes;
+
+ nsizes = (unsigned int *)xrealloc(ps->PicturePrivateSizes,
+ (index2 + 1) * sizeof(unsigned int));
+ if (!nsizes)
+ return FALSE;
+ while (ps->PicturePrivateLen <= index2)
+ {
+ nsizes[ps->PicturePrivateLen++] = 0;
+ ps->totalPictureSize += sizeof(DevUnion);
+ }
+ ps->PicturePrivateSizes = nsizes;
+ }
+ oldamount = ps->PicturePrivateSizes[index2];
+ if (amount > oldamount)
+ {
+ ps->PicturePrivateSizes[index2] = amount;
+ ps->totalPictureSize += (amount - oldamount);
+ }
+
+ return TRUE;
+}
+
+
Bool
PictureDestroyWindow (WindowPtr pWindow)
{
@@ -82,6 +133,8 @@ PictureCloseScreen (int index, ScreenPtr pScreen)
if (ps->formats[n].type == PictTypeIndexed)
(*ps->CloseIndexed) (pScreen, &ps->formats[n]);
SetPictureScreen(pScreen, 0);
+ if (ps->PicturePrivateSizes)
+ xfree (ps->PicturePrivateSizes);
xfree (ps->formats);
xfree (ps);
return ret;