[cairo] Cairo vs. Xft glyph rendering

Jorn Baayen jorn at openedhand.com
Fri Dec 15 04:00:19 PST 2006


On Mon, 2006-12-11 at 04:46 -0500, Behdad Esfahbod wrote:
> On Fri, 2006-12-08 at 10:04 -0500, Vladimir Vukicevic wrote:
> > Maybe one of the X folks here could let us know whether doing this could 
> > result in a performance gain?  We already have to do the lookup per 
> > glyph to make sure that it's sent to the server, so we could always 
> > change the data structure that's used to pass things down to 
> > xlib_show_glyphs{8,16,32} so that it sends the right info, instead of 
> > just sending down the cairo_glyph_t array.  That is, either pass down 
> > cairo_glyph_t + per-glyph offsets, or even do the run computation ahead 
> > of time and pass down some structure that can be trivially converted to 
> > the appropriate size XGlyphElt array.
> This is basically what I've done now, and pushed into my tree under the
> branch xlib-show-glyphs-fast:
> http://gitweb.freedesktop.org/?p=users/behdad/cairo.git;a=shortlog;h=xlib-show-glyphs-fast
> The patch set is attached.  I started by introducing a new type
> cairo_glyph_fixed_t and pass that down, but at the end I figured this is
> actually a penalty for most backends and not much gain for any, so I
> backed that up.
> Other than compressing glyphs into elements, I also made a semantic
> change to show_glyphs() calls all over the tree, that is, those
> functions that get a non-const cairo_glyph_t* are allowed to modify the
> glyph array unless then return CAIRO_STATUS_UNSUPPORTED.  This means,
> backends can modify the input glyph array or use it for totally
> different things instead of having to duplicate it or allocate memory.
> My rewritten cairo_xlib_show_glyphs() heavily uses this.
> Anyway, patchset attached.  It looks ready to me, and on my laptop saves
> some 6% on timetext (plus a malloc per show_glyphs()).
> Waiting for numbers :-)

The usual timetext profile (pango 1.15.1, cairo 1.3.4 + patchset):

A 5% win on timetext. Yay :)



> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://cairographics.org/cgi-bin/mailman/listinfo/cairo
OpenedHand Ltd.

More information about the cairo mailing list