[cairo] towards 24.8

Vladimir Vukicevic vladimir at pobox.com
Mon Jun 18 13:27:05 PDT 2007


So I've got this working!  The current work in progress is in the 
fixed-24-8 branch in my tree 
(git://git.cairographics.org/~vladimir/cairo I believe).  Cairo can use 
any fixed point format, and it'll correctly convert to 16.16 for talking 
to pixman/xlib/xcb/etc, but svg, pdf, and other surfaces get the full 
precision.  It should be possible to easily convert to using a 64-bit 
fixed point type, or even using doubles throughout, though it's more 
work than just increasing/decreasing the number of fractional bits.

There are still some things I need to clean up, and I'll probably end up 
redoing a number of the commits to incorporate fixes for issues that I 
discovered in future patches to make it easier to review.  There are a 
lot of changes, so I expect review to be a bit painful, but essentially 
the separate chunks are:

- Make fixed point methods static inline and don't hardcode 16.16
- [misc] Remove usage of cairo_fixed_16_16_t from quartz surface (should 
be cairo_fixed_t)
- Use _cairo_fixed_mul() instead of hand-written fixed-point multiplication
- Convert all usage of cairo_rectangle_int16_t to cairo_rectangle_int_t, 
which is typedef'd based on how many bits of precision are present in 
the fixed type (this could also always just be 32-bit, but I wanted to 
be able to keep things how they are for 16.16)
- Remove dependencies on pixman_color_stop_t, pixman_gradient_t, and 
friends -- introduce cairo_gradient_stop_t; add code to convert from 
cairo_gradient_stop_t etc. to pixman equivalents in cairo-pattern.c
- Fix up image surface to translate cairo_fixed_t to 16.16
- Fix up xlib surface to translate cairo_fixed_t to 16.16
- Fix up xcb surface to translate cairo_fixed_t to 16.16
- create cairo_region_t and replace all usage of pixman_region16_t usage 
with it (initially, it just wraps pixman_region16_t)

I've confirmed that I can switch fixed point types trivially and get 
correct results from PS, SVG, etc. surfaces that don't rely on pixman. 
Two #defines and you can get 24.8, 26.6, etc..

    - Vlad


More information about the cairo mailing list