[cairo] Fixed point bug
Krzysztof Kosiński
tweenk.pl at gmail.com
Sun Dec 12 05:07:37 PST 2010
Hello
I recently submitted a bug that, once fixed, would allow Inkscape to
use Cairo for all drawing.
https://bugs.freedesktop.org/show_bug.cgi?id=32215
I believe this requires switching to floats or doubles in Pixman on
architectures that have a floating point unit. At this point I don't
know whether it's better to provide 3 functions for each call in
Pixman that uses pixman_fixed_t now and convert to a build time
configurable numeric type, or make an API break.
Here's an example of how the non-API-breaking solution would look
like, I don't remember whether I've mentioned it previously:
void pixman_foo(pixman_fixed_t a, pixman_fixed_t b) {
pixman_foo_real(pixman_fixed_to_arith(a), pixman_fixed_to_arith(b));
}
void pixman_foo_d(double a, double b) {
pixman_foo_real(pixman_double_to_arith(a), pixman_double_to_arith(b));
}
void pixman_foo_f(float a, float b) {
pixman_foo_real(pixman_float_to_arith(a), pixman_float_to_arith(b));
}
void pixman_foo_real(pixman_arith_t a, pixman_arith_t b) {
// implementation of pixman_foo
// pixman_arith_t can be pixman_fixed_t, float or double depending on
// build time configuration
}
Regards, Krzysztof
More information about the cairo
mailing list