[PATCH 4/5] Pre-validate ChangeGC XIDs.

Keith Packard keithp at keithp.com
Fri May 7 21:33:26 PDT 2010


On Fri,  7 May 2010 20:23:59 -0700, Jamey Sharp <jamey at minilop.net> wrote:

> In order to execute a wire-level ChangeGC request, we need to look up
> the resources named by any XIDs in the value-list. Various places in the
> server already have pointers to the resources they want to set into the
> GC, though, so over time the interface has evolved to accept either XIDs
> or pointers, with several different function call signatures used in
> different eras.

I'm liking the general direction where the basic GC changing function
takes the union instead of either union or XID list. However, I'd
suggest that only DIX ever needs to use the XID version of this
function, and in fact only in a very few places. The only places in the
next patch that I see where it should be using the XID version is in
ProcChangeGC and doPolyText. I'd suggest that open-coding the XID lookup
in those two functions would be more appropriate than exposing an
XID-using ChangeGC function.

Further, now that we're back to a single function which changes a GC,
how about using the venerable 'ChangeGC' name again? Nice and short.

So, in this patch, provide ChangeGC which takes just the union, and
dixChangeGC which open-codes the XID lookup and calls ChangeGC. Then, in
the next patch, eliminate all calls to dixChangeGC along with
dixChangeGC itself.

What do you think? Crazy talk?

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100507/78cd6ee5/attachment.pgp>


More information about the xorg-devel mailing list