[PATCHv2] Replace screen->rgf scratch GC flags with a bit in each GC.

Keith Packard keithp at keithp.com
Wed May 19 22:22:22 PDT 2010


On Wed, 19 May 2010 17:25:18 -0700, Jamey Sharp <jamey at minilop.net> wrote:
> This eliminates a poorly-named, poorly-documented field from the
> ScreenRec, using a previously-unused flag bit in each GC instead.
> 
> Signed-off-by: Jamey Sharp <jamey at minilop.net>
> Cc: Adam Jackson <ajax at redhat.com>
> Cc: Keith Packard <keithp at keithp.com>
> ---
> PURPLE!

A fine bikeshed color. Of course, perhaps mauve would be nicer? One
minor comment below, which you may either adopt or ignore. Otherwise:

Reviewed-by: Keith Packard <keithp at keithp.com>


> @@ -1149,7 +1153,7 @@ FreeScratchGC(GCPtr pGC)
>      {
>          if ( pScreen->GCperDepth[i] == pGC)
>  	{
> -	    pScreen->rgf &= ~(1L << (i+1));
> +	    pScreen->GCperDepth[i]->scratch_inuse = FALSE;

Now that we've got the flag in the GC, if you set this to FALSE in
CreateGC, you could just check the flag here instead of looping over the
array in the screen. In fact, you could do that check in FreeGC and make
FreeScratchGC just call that...

-- 
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/20100519/a96c546c/attachment.pgp>


More information about the xorg-devel mailing list