[PATCH] cache glyphs in the destination format requested to make sure the hardware can use the cached glyphs

Michel Dänzer michel at daenzer.net
Tue Jan 10 07:46:35 UTC 2017


On 09/01/17 07:36 AM, Michael Lorenz wrote:
> From: Michael Lorenz <macallan at netbsd.org>
> 
> Signed-off-by: Michael Lorenz <macallan at netbsd.org>
> ---
>  exa/exa_glyphs.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/exa/exa_glyphs.c b/exa/exa_glyphs.c
> index 192a643cc..7386d05e9 100644
> --- a/exa/exa_glyphs.c
> +++ b/exa/exa_glyphs.c
> @@ -544,7 +544,6 @@ exaBufferGlyph(ScreenPtr pScreen,
>                 INT16 ySrc, INT16 xMask, INT16 yMask, INT16 xDst, INT16 yDst)
>  {
>      ExaScreenPriv(pScreen);
> -    unsigned int format = (GetGlyphPicture(pGlyph, pScreen))->format;
>      int width = pGlyph->info.width;
>      int height = pGlyph->info.height;
>      ExaCompositeRectPtr rect;
> @@ -554,13 +553,10 @@ exaBufferGlyph(ScreenPtr pScreen,
>      if (buffer->count == GLYPH_BUFFER_SIZE)
>          return ExaGlyphNeedFlush;
>  
> -    if (PICT_FORMAT_BPP(format) == 1)
> -        format = PICT_a8;
> -
>      for (i = 0; i < EXA_NUM_GLYPH_CACHES; i++) {
>          ExaGlyphCachePtr cache = &pExaScr->glyphCaches[i];
>  
> -        if (format == cache->format &&
> +        if (pDst->format == cache->format &&
>              width <= cache->glyphWidth && height <= cache->glyphHeight) {
>              ExaGlyphCacheResult result = exaGlyphCacheBufferGlyph(pScreen,
>                                                                    &pExaScr->
> 

Unfortunately, testing reveals that this doesn't work correctly in
general when exaGlyphs is called with maskFormat == NULL, I suspect
because pDst->format may not have any alpha bits here in that case. This
results e.g. in some missing text in xfce4-terminal for me.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the xorg-devel mailing list