Re: GtkCanvas requirements?



On Mon, 2007-04-23 at 20:09 +0100, Emmanuele Bassi wrote:
> On Sun, 2007-04-22 at 21:16 +0100, Damon Chaplin wrote:
> 
> > In these days of 64-bit machines I don't think sizeof (double) is a big
> > deal, if its just for a few coordinates per item. Anyway if we're using
> > interfaces for items then the items can use whatever they like
> > internally.
> 
> it's not a matter of space.
> 
> thinking 'in these days of 64-bit machines' would basically screw up all
> of the people working on getting GTK+ to work on small devices which -
> surprise! - have no FPU, hence perform like shit with doubles and
> floats. in Clutter, for instance, most of the operations are done using
> fixed point algebra and transforming doubles in the public API into
> 16.16 or 21.11 fixed point numbers internally; we also expose a fixed
> point API to avoid using doubles altogether. is this hard? yes. is it
> necessary? yes. should it be a part of the initial design and
> implementation? hell, yes. because history teach us that starting with
> "well, we have 64-bit machines nowadays, what's a double going to do" is
> the perfect way to hit the wall of performance regressions.
> 
> cairo and pango developers and contributors went all the lengths to
> reduce the floating point usage in their libraries; we shouldn't screw
> the developers on embedded devices *again*.

But the cairo API already uses doubles, for coordinates and
transformations. So if the canvas used fixed point numbers you'd be
converting to doubles and then back again. With 32-bit fixed point
numbers you also cut down the maximum possible size of the canvas, plus
you lose the precision of doubles (which may be important for some data
visualization apps).

If the canvas item API uses doubles, items can still use fixed point
numbers internally if necessary.

Damon





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