[PATCH 03/13] render: Reshuffle and resize GlyphRec

Keith Packard keithp at keithp.com
Tue Nov 23 13:33:58 PST 2010


On Tue, 23 Nov 2010 14:45:38 -0500, Adam Jackson <ajax at redhat.com> wrote:

>  typedef struct {
> -    unsigned char sha1[20];
> +    unsigned char sha1[16];
>  } ExaCachedGlyphRec, *ExaCachedGlyphPtr;

Ick. This seems like an ugly kludge. I'd rather see it retain the full
size and just move to the end of the struct so that the pointers get
aligned correctly. Yeah, yeah, oword compares.

> +    int              glyph_size = sizeof(GlyphRec)
> +                                  + screenInfo.numScreens * sizeof (PicturePtr)
> +                                  + dixPrivatesSize(PRIVATE_GLYPH);

How about a function for this? I can imagine getting this wrong. Make it
static inline if you don't want to see it using space in a non-dmx build.

> diff --git a/render/glyph.c b/render/glyph.c
> index 7193d47..4556046 100644
> --- a/render/glyph.c
> +++ b/render/glyph.c
> @@ -128,7 +128,7 @@ GlyphRefPtr
>  FindGlyphRef (GlyphHashPtr	hash,
>  	      CARD32		signature,
>  	      Bool		match,
> -	      unsigned char	sha1[20])
> +	      unsigned char	sha1[16])

It'd be nice to have a typedef or a #define for the size.x

-- 
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/20101123/06fc105c/attachment.pgp>


More information about the xorg-devel mailing list