diff --git a/fb/fbgc.c b/fb/fbgc.c index 4af8f55f4..a9a46ae83 100644 --- a/fb/fbgc.c +++ b/fb/fbgc.c @@ -152,7 +152,24 @@ fbValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) pPriv->fg = pGC->fgPixel & mask; pPriv->bg = pGC->bgPixel & mask; + /* + * Widening the planemask to cover the padding bits lets the blit and + * fill paths take their "all ones" shortcuts, but it also makes them + * write those bits. A rootless server keeps the alpha channel of its + * on screen windows opaque by clearing the alpha bits from the + * planemask (see miext/rootless/rootlessGC.c), and it can only do so + * from its own ValidateGC. mi revalidates the GC in the middle of a + * drawing operation for dashed lines, dashed arcs and opaque text, + * and by then the rootless funcs have been unwrapped by the damage + * layer, so that reassertion never happens. Leave the padding bits + * alone when they aren't part of the depth. + */ +#ifdef ROOTLESS_SAFEALPHA + if (pDrawable->depth == pDrawable->bitsPerPixel && + (pGC->planemask & depthMask) == depthMask) +#else if ((pGC->planemask & depthMask) == depthMask) +#endif pPriv->pm = mask; else pPriv->pm = pGC->planemask & mask;