This way the same callback code can be used to render multiple different
glyph arrays. Change done for education purposes, otherwise doesn't
make any difference in the test.
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.
From -1024..15359, to -4096..122887. This still does not fix the
large-font test as that uses a 10000 font. Working on a proper fix
for glyph dropping now.
10000 that is. xlib fails now again. Not because of glyph size issues.
Because we skip rendering any glyphs with positions not in range -1024..15359.
Working on a fix.
First, XMaxRequestSize returns number of 4-byte words. So multiply by 4 is
needed in all uses. Next, XRenderAddGlyphs uses BIG-REQUEST extension if
available, so when checking for glyph size overflow, we should use
XExtendedMaxRequestSize() first.
Also use the right format when calculating glyph size.
These changes combined, push the biggest font size that can be uploaded to the
server from under 200 to about 5000.
See bug #4339 for history.
Originally reported here:
http://lists.cairographics.org/archives/cairo/2008-May/014032.html
and analyized later in the thread.
Change (font and surface) backend show_glyphs() API to take a
int *remaining_glyphs argument. It's used to communicate to the caller,
by way of setting remaining_glyphs and returning INT_STATUS_UNSUPPORTED,
that some of the glyphs were shown but not the others. The xlib backend
now correctly uses this to handle failure to upload a glyph to the server.
So the large-font test passes now.
An alternative approach could be to add some public value for glyphs
indices that are not shown. -1 perhaps (the xlib backend already uses
that value internally). Then instead of remaining_glyphs, a backend
could simply set glyph indices of glyphs shown to that -1 value.
This reverts commit ddcd6781a2.
This was an experimental commit that was intended to be on a side
branch but accidentally got committed and pushed to master. Sorry
for the noise.
This is an initial attempt at addressing the recently noticed
fallback-resolution bug. It isn't working correctly yet.
I'm just committing so that behdad can see what I'm up to.