diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2009-06-03 16:11:33 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-06-03 16:11:33 +1000 |
commit | 6de67d3206f0a4e307070714564c19efc84da2ec (patch) | |
tree | ac95c56d8396c52e2ae10c05c5d9649f66c2148a /mi | |
parent | af4e658401ecbd2f2cc515b4c5abe5aee361cd64 (diff) | |
parent | 7f027d9dc0146e229802aeac342ea2dbab63264a (diff) |
Merge branch 'master' into xi2
Diffstat (limited to 'mi')
-rw-r--r-- | mi/miexpose.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/mi/miexpose.c b/mi/miexpose.c index 2c43d9824..6ce56ee85 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -522,7 +522,7 @@ void miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) { ScreenPtr pScreen = pWin->drawable.pScreen; - ChangeGCVal gcval[5]; + ChangeGCVal gcval[6]; BITS32 gcmask; GCPtr pGC; int i; @@ -590,18 +590,35 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) gcval[0].val = GXcopy; gcmask = GCFunction; +#ifdef ROOTLESS_SAFEALPHA +/* Bit mask for alpha channel with a particular number of bits per + * pixel. Note that we only care for 32bpp data. Mac OS X uses planar + * alpha for 16bpp. + */ +#define RootlessAlphaMask(bpp) ((bpp) == 32 ? 0xFF000000 : 0) +#endif + if (solid) { +#ifdef ROOTLESS_SAFEALPHA + gcval[1].val = fill.pixel | RootlessAlphaMask(pWin->drawable.bitsPerPixel); +#else gcval[1].val = fill.pixel; +#endif gcval[2].val = FillSolid; gcmask |= GCForeground | GCFillStyle; } else { - gcval[1].val = FillTiled; - gcval[2].ptr = (pointer)fill.pixmap; - gcval[3].val = tile_x_off; - gcval[4].val = tile_y_off; + int c=1; +#ifdef ROOTLESS_SAFEALPHA + gcval[c++].val = ((CARD32)-1) & ~RootlessAlphaMask(pWin->drawable.bitsPerPixel); + gcmask |= GCPlaneMask; +#endif + gcval[c++].val = FillTiled; + gcval[c++].ptr = (pointer)fill.pixmap; + gcval[c++].val = tile_x_off; + gcval[c++].val = tile_y_off; gcmask |= GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin; } |