[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cairo
Subject:    Re: [cairo] Cairo 1.9.2 performance
From:       Chris Wilson <chris () chris-wilson ! co ! uk>
Date:       2009-06-18 6:14:45
Message-ID: 1245305685.2407.231.camel () tiger
[Download RAW message or body]

On Wed, 2009-06-17 at 20:38 -0400, cu wrote:
> I ran application through profiler and found that vast majority of the
> slowdown is attributable to text drawing. Specifically, profiler shows
> enormous amount of time spent in cairo_show_text

cairo_show_text() is the toy text interface interface, which now lazily
resolves the font (if it has been changed on the context) on every call
(since the resolved font can in fact change between calls). Consider
this a strong hint not to use this in a non-demonstration application
and use a full layout library like Pango instead. 

Alternatively you can always query the font chosen for a particular
face, family, size, slant and weight by calling
cairo_get_scaled_font(cr) after setting up the font parameters. Then to
restore that particular resolved font, use cairo_set_scaled_font().

Did I mention use Pango?
-ickle

_______________________________________________
cairo mailing list
cairo@cairographics.org
http://lists.cairographics.org/mailman/listinfo/cairo
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic