Re: Floating point in pango


On Thu, 2006-07-20 at 11:41 -0700, Carl Worth wrote:

> > Id be interested your thoughts on optimising FP to perform when you dont
> > have an FPU. Maybe the amount of FP calls in pango-cairo could simply be
> > heavily reduced ? 
> Sure. If switching from floating-point to fixed-point within
> pango-cairo is a win, then please do that.

The only floating-point usage within pango-cairo that could be made to
use fixed-point is glyph coordinate calculation. This however is
responsible for only 1% of the pango-cairo profile[1], and the advantage
would probably be drowned out by the then necessary additional
fixed->double conversion.

[1] See "pango_cairo_renderer_draw_glyphs [self]" in

> > If Cairo cares about performing well on embedded type hardware ( maybe
> > it doesn't? ), use of fixed point seems pretty much mandatory on lower
> > end hardware - For example OpenGL ES, Playstation and Nintendo Handheld
> > graphics API's all use it. 
> It is important to me for cairo to perform well on embedded hardware,
> but I'm not yet ready to sacrifice ease-of-use in the API in an effort
> to get this performance, (particularly when we don't yet know if that
> sacrifice is necessary).
> Here's my recommendation: Imagine that we added a fixed-point API to
> cairo today. Then, do the work necessary in pango, (or other
> important layers), to take advantage of that API. Also, do the work
> within cairo to operate on fixed-point values wherever possible.
> Once that work is done, all that should be left is a pair of
> conversions fixed->floating->fixed right at the cairo API. And at that
> point, if the overhead from that conversion is a performance problem
> then I will be happy to add new API for this. (And obviously, cairo
> would be using a faster approach for conversion than what it's using
> now.)
> That plan should involve no extra work, but has the huge benefit of
> not sacrificing the design of the API until we've proven that that is
> necessary in order to get the performance we want.
> Does that make sense?

I'm not quite sure what you are suggesting. Are you suggesting to add a
fixed-point API to cairo, or not?



> -Carl
> _______________________________________________
> Performance-list mailing list
> Performance-list gnome org
OpenedHand Ltd.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]