summaryrefslogtreecommitdiff
path: root/dix/colormap.c
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2004-07-31 08:24:14 +0000
committerEric Anholt <anholt@freebsd.org>2004-07-31 08:24:14 +0000
commitd690556d496c7331bd112903a0c9e6553c7d3342 (patch)
tree0e0016e04d05d6cbcdfb689ddb05d8f3a928dadf /dix/colormap.c
parent8763cca7f9927bd6c9caf804bf09dcfea929eed0 (diff)
Integrate COMPOSITEWRAP branch including composite wrapper. This code still
has several issues, including: - CopyWindow and PaintWindow wrappers missing (will be done soon) - Some segfaults seen in the Render wrappers. - Xprt server build breaks with Composite. - DDXs must be recompiled for Composite due to VisualRec size change. - Composite bugs pointed out by Deron Johnson in email. Also, reorder XFixes initialization according to comments by Keith which are also in xserver CVS.
Diffstat (limited to 'dix/colormap.c')
-rw-r--r--dix/colormap.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/dix/colormap.c b/dix/colormap.c
index 1d7772188..8ea87674c 100644
--- a/dix/colormap.c
+++ b/dix/colormap.c
@@ -1,4 +1,4 @@
-/* $XdotOrg$ */
+/* $XdotOrg: xc/programs/Xserver/dix/colormap.c,v 1.2.2.1 2004/07/30 06:54:41 anholt Exp $ */
/* $XFree86: xc/programs/Xserver/dix/colormap.c,v 3.11 2003/11/03 05:10:59 tsi Exp $ */
/***********************************************************
@@ -190,7 +190,15 @@ static void FindColorInRootCmap (
#define NUMRED(vis) ((vis->redMask >> vis->offsetRed) + 1)
#define NUMGREEN(vis) ((vis->greenMask >> vis->offsetGreen) + 1)
#define NUMBLUE(vis) ((vis->blueMask >> vis->offsetBlue) + 1)
-#define RGBMASK(vis) (vis->redMask | vis->greenMask | vis->blueMask)
+#ifdef COMPOSITE
+#define NUMALPHA(vis) ((vis->alphaMask >> vis->offsetAlpha) + 1)
+#define ALPHAMASK(vis) (vis->alphaMask)
+#else
+#define NUMALPHA(vis) 0
+#define ALPHAMASK(vis) 0
+#endif
+
+#define RGBMASK(vis) (vis->redMask | vis->greenMask | vis->blueMask | ALPHAMASK(vis))
/* GetNextBitsOrBreak(bits, mask, base) --
* (Suggestion: First read the macro, then read this explanation.
@@ -866,6 +874,9 @@ AllocColor (pmap, pred, pgreen, pblue, pPix, client)
*pPix = (pixR << pVisual->offsetRed) |
(pixG << pVisual->offsetGreen) |
(pixB << pVisual->offsetBlue);
+#ifdef COMPOSITE
+ *pPix |= pVisual->alphaMask;
+#endif
*pred = pmap->red[pixR].co.local.red;
*pgreen = pmap->green[pixG].co.local.green;
*pblue = pmap->blue[pixB].co.local.blue;
@@ -956,6 +967,9 @@ AllocColor (pmap, pred, pgreen, pblue, pPix, client)
return (BadAlloc);
}
*pPix = pixR | pixG | pixB;
+#ifdef COMPOSITE
+ *pPix |= pVisual->alphaMask;
+#endif
break;
}
@@ -1928,6 +1942,10 @@ AllocDirect (client, pmap, c, r, g, b, contig, pixels, prmask, pgmask, pbmask)
}
pmap->numPixelsBlue[client] += npixB;
pmap->freeBlue -= npixB;
+#ifdef COMPOSITE
+ for (pDst = pixels; pDst < pixels + c; pDst++)
+ *pDst |= pmap->pVisual->alphaMask;
+#endif
DEALLOCATE_LOCAL(ppixBlue);
DEALLOCATE_LOCAL(ppixGreen);