These are all perfectly correct code. Most are simply there because when
we support vertical text writing mode we need to update there, but that's
pretty trivial. No special markers needed.
/me is trying to make user-font clean of XXX and TODO marks
Someone reported on cairo list that on some system with gcc, he had the
compile-time assertion failing, meaning that the following struct:
typedef struct {
unsigned long index;
union {
struct {
double x;
double y;
} d;
struct {
int x;
int y;
} i;
} p;
} cairo_xlib_glyph_t;
had a different size from:
typedef struct {
unsigned long index;
double x;
double y;
} cairo_glyph_t;
That looks quite a weird thing for a compiler to do. Anyway, rewriting
our struct like this may help in those weird situations:
typedef union {
cairo_glyph_t d;
unsigned long index;
struct {
unsigned long index;
int x;
int y;
} i;
} cairo_xlib_glyph_t;
That's what we do now.
Essentially renaming cairo-mutex-type-private.h to cairo-mutex-impl-private.h
and changing all its namespace from cairo_mutex to cairo_mutex_impl.
cairo-mutex-type-private.h then does all the sanity checks on the
implementation that used to be in cairo-mutex-private.h. Plus, defines macros
for the cairo-mutex namespace to map to the cairo-mutex-impl namespace. This
extra mapping layer allows for add debugging facilities.
For really huge font sizes, we can just do path;fill instead of
show_glyphs, as show_glyphs would put excess pressure on the cache,
and moreover, not all components below us correctly handle huge font
sizes. I wanted to set the limit at 256. But alas, seems like cairo's
rasterizer is something like ten times slower than freetype's for huge
sizes. So, no win just yet. For now, do it for insanely-huge sizes,
just to make sure we don't make anyone unhappy. When we get a really
fast rasterizer in cairo, we may want to readjust this.
cairo_surface_destroy and _cairo_scaled_font_fini will call destroy closures
which may call functions that attempt to acquire the mutex resulting in a
deadlock. We fix this by releasing the lock for the call to
cairo_surface_destroy or _cairo_scaled_font_fini.