[PATCH xserver 03/11] dix: Don't special-case a 1bpp scratch GC

Keith Packard keithp at keithp.com
Sat Dec 10 16:57:12 UTC 2016


Adam Jackson <ajax at redhat.com> writes:

> The comment in CreateGCperDepth here is wrong, there is already a 1bpp
> entry in the pixmap format list.

Yeah, but I don't think numDepths includes bitmaps; it's computed only
From visuals in miInitVisuals:

    ndepth = 0;
    for (visuals = miVisuals; visuals; visuals = nextVisuals) {
        nextVisuals = visuals->next;
        ndepth++;
        nvisual += visuals->count;
    }

And that's why all of these loops are 

        for (i = 0; i <= pScreen->numDepths; i++)

as the depth 1 entry is at 0. So, we either need to add depth 1 to the
numDepths array (which would mess up the visual stuff), or continue to
special case it for scratch GCs.

When the server has depth-1 windows, we end up with two scratch
GCs. And, the scratch GC code will actually use them if you need two
at a time. Weird stuff. And was this way all the way back to X11R1.

I'd say don't mess with this.

-- 
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20161210/e5932dcc/attachment.sig>


More information about the xorg-devel mailing list