summaryrefslogtreecommitdiff
path: root/dix/colormap.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2004-08-13 08:16:14 +0000
committerKeith Packard <keithp@keithp.com>2004-08-13 08:16:14 +0000
commita29bfbd3d0a5d39ccee5b83ac1ba632091b031bb (patch)
treeb087d11fa09d5f36f7a3b34e6333bfa8b0e6d50c /dix/colormap.c
parent24bed5cff908a6f8b1857e3dadac22d6db54c69e (diff)
Empty damage object when freeing pixmap.
Wrap InstallColormap so that the DDX doesn't see colormaps from our ARGB visual (avoids lovely green tint to screen). Also, set visual->nplanes of ARGB visual to all used (including alpha) planes so DIX can set pixel values correctly. Translate automatic update regions correctly to account for borders When nplanes == 32 (ARGB visuals), mask in all ones for alpha values to allocated pixel values. Remove redundant fbAddTraps declaration Fix fbCopyWindow to work on non-screen pixmaps (not needed yet) Replace broken clipping code with that from modular tree. Respect subWindowMode.
Diffstat (limited to 'dix/colormap.c')
-rw-r--r--dix/colormap.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/dix/colormap.c b/dix/colormap.c
index a0c6b8056..947ffe46d 100644
--- a/dix/colormap.c
+++ b/dix/colormap.c
@@ -1,4 +1,4 @@
-/* $XdotOrg: xc/programs/Xserver/dix/colormap.c,v 1.3 2004/07/31 08:24:13 anholt Exp $ */
+/* $XdotOrg: xc/programs/Xserver/dix/colormap.c,v 1.4 2004/08/07 00:58:21 keithp Exp $ */
/* $XFree86: xc/programs/Xserver/dix/colormap.c,v 3.11 2003/11/03 05:10:59 tsi Exp $ */
/***********************************************************
@@ -190,11 +190,10 @@ 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)
-#if 0
-#define NUMALPHA(vis) XXX cant store in visual because of ABI concerns
-#define ALPHAMASK(vis) XXX cant store in visual because of ABI concerns
+#if COMPOSITE
+#define ALPHAMASK(vis) ((vis)->nplanes < 32 ? 0 : \
+ (CARD32) ~((vis)->redMask|(vis)->greenMask|(vis)->blueMask))
#else
-#define NUMALPHA(vis) 0
#define ALPHAMASK(vis) 0
#endif
@@ -873,9 +872,8 @@ AllocColor (pmap, pred, pgreen, pblue, pPix, client)
pixB = FindBestPixel(pmap->blue, NUMBLUE(pVisual), &rgb, BLUEMAP);
*pPix = (pixR << pVisual->offsetRed) |
(pixG << pVisual->offsetGreen) |
- (pixB << pVisual->offsetBlue);
-
- *pPix |= ALPHAMASK(pVisual);
+ (pixB << pVisual->offsetBlue) |
+ ALPHAMASK(pVisual);
*pred = pmap->red[pixR].co.local.red;
*pgreen = pmap->green[pixG].co.local.green;
@@ -966,9 +964,7 @@ AllocColor (pmap, pred, pgreen, pblue, pPix, client)
(void)FreeCo(pmap, client, REDMAP, 1, &pixR, (Pixel)0);
return (BadAlloc);
}
- *pPix = pixR | pixG | pixB;
-
- *pPix |= ALPHAMASK(pVisual);
+ *pPix = pixR | pixG | pixB | ALPHAMASK(pVisual);
break;
}