Ideally, the minimum value would indicate the best possible performance,
but I've encountered situations where a bogus minimum value gets lodged
into the cached results for some reason, (and yet doesn't also get
discarded as an outlier). The downside of that situation is that running
more iterations never changes the result, so it's hard to fix the problem,
(resulting in cairo-perf-diff feeling just plain broken as more runs
change nothing).
So let's try using the median time instead.
The so-attributed-to-X-server bug was that cairo maps the drawing
region to the pattern space, rounds the box, and uploads only that
part of the source surface to the X server. Well, this only works for
NEAREST filter as any more sophisticated filter needs to sneak a peek
at the neighboring pixels around the edges too.
The right fix involves taking into account the filter used, and the
pattern matrix, but for most cases, a single pixel should be enough.
Not sure about scaling down...
Anyway, this is just a workaround to get 1.4.4 out of the door. I'll
commit a proper fix soon.
It's much nicer to use automake to conditionally compile a file,
instead of always compiling it and conditionally having the compiler
see an empty file.
It looks like this is an X server bug, and we don't have an
imminent fix. Meanwhile, the bug is avoidable by preferring
to use xlib surface sources for transformed rendering to xlib
instead of using image surface sources.
This test can fail if the wrong font is loaded, but that's no
different than many other text tests---so it doesn't really
deserve special XFAIL treatment because of that.
Due to the interaction between multiple threads showing glyphs and
asynchronous CloseDisplays, it is possible for a font to maintain a
cairo_xlib_screen_info_t beyond the CloseDisplay. The simple solution
is to add a reference count in order to track the lifetime of the
cairo_xlib_screen_info_t correctly.
This new feature isn't appropriate for a minor cairo release,
(we're between 1.4.2 and 1.4.4 right now), but will make a
lot of sense during 1.5.
The code being reverted here was originally added with the
following commit:
46eab95698
but this change reverts only the public-facing parts of it.
In order to avoid recursive dead-locks where whilst one thread holds the
scaled font lock and is waiting on the XLockDisplay() another thread catches
the CloseDisplay and then tries to acquire the scaled font lock, we drop
the list mutex whilst processing the callbacks.
Do not initialize font options when setting up the
cairo_xlib_screen_info_t corresponding to the display itself and not
associated with any screen. This avoids a potential NULL dereferences.
(Fixes https://bugs.freedesktop.org/show_bug.cgi?id=10517)
Whilst not being able to delete all of the test output is messy it is
however not fatal, so do not abort configuration simply because we
cannot find either program.
Replace hard-coded find, xargs and rm with the paths determined during
configure. This also gives us an opportunity to detect missing programs
and inform the developer.
pixman_format_t is a simple structure used in short-term allocations and
suitable for on-stack allocation.
Killing the pixman_format_create()/pixman_format_destroy() pairs avoid
around 6% of the allocations during cairo-perf (e.g. 426,158 allocs out
of a total of 7,063,469).
It is possible for a scaled_font to be flagged as in error, though only
through a "true error" e.g. a malloc failure. However, when returning a font
from the cache it should not be in error. So if we find a error font in the
cache we remove it and return a new font.
These are all to satisfy new warnings caused by the preceding commit,
(which added cairo_warn to various function tables). While fixing the
propoagation, fix functions to declare a return type of cairo_status_t
instead of int.
By defining cairo_public_warn as an extension of cairo_public, the
programmer need only to override cairo_public in order to export the
complete API for different architectures i.e. existing configurations
will continue to work with no alterations.
The attribute was introduced with gcc-3.4, but the ability to suppress
warnings from misapplied attributes (-Wno-attributes) was only introduced
later. Without the supression, gcc will emit tens of warnings for each
compilation completely drowning the real errors that the programmer
must see.
Once again we have hit the command line limit with the sheer volume of
generated test output. So replace the glob with a find which has the
additional advantage of only needing to walk the tree once to generate
the file lists - this begins to be noticeable with such large directories.
By unexporting these function we have exact control over their call sites
and so can convert the initial guards into asserts which transforms the
two functions to return unconditional success and hence conversion to
void.