Without this, any tests that were using cairo_test_init rather than
cairo_test would end up leaking a FILE* for the log file. So this
keeps valgrind much more happy with the test suite.
Previously, an INVALID_RESTORE error would leave cr->gstate as NULL,
(which is generally impossible/invalid). This seems safe enough as
most cairo functions check cr->status first and bail if anything
looks fishy.
However, the many cairo_get functions happily march along in spite
of any current error. We could instrument all of those functions to
check for the error status and return some dummy value in that case.
But it's much easier to get the same basic effect by simply creating
a non-NULL cr->gstate which will hold all those dummy values, and
we can eliminate the crashes without having to touch up every
cairo_get function.
This fixes the bug reported here:
evolution crash to _cairo_gstate_backend_to_user()
https://bugs.freedesktop.org/show_bug.cgi?id=9906
It also eliminates the crash that was added to the nil-surface test
with the previous commit.
So it looks like it took us three commits before we finally got
all of the users of inner/outer switched to c1/c2. Hopefully
someday we'll have the compiler passing over all of cairo's
source code even if the backends aren't available to be run
on a particular system.
There was some leftover cut-and-paste description of get_font_face
in the documentation for get_scaled_font. That turned out to be a
good thing as it alerted me to the fact that the get_font_face
documentation was stale as well.
Add description of the 'nil' object return values, rather than NULL.
When choosing the samples that are not outliers we use a half-open interval
(outlier_min <= x < outlier_max). This causes all of the samples to be
discarded when the interquartile range is 0 because none of them are less
than outlier_max. Fix the problem and make the test more consistent by
using a closed interval (outliner_min <= x <= outlier_max).
The trick here is that with the weak symbol support for pthreads,
pthread_mutex_init can be a NOP leaving the mutex uninitialized.
Then, if some pthread-using library is dynamically loaded, the
non-NOP pthread functions get used and we end up trying to lock
an uninitialized mutex.
This should fix the bugs reported here:
Cairo 1.3.14 deadlocks in cairo_scaled_font_glyph_extents or _cairo_ft_unscaled_font_lock_face
https://bugs.freedesktop.org/show_bug.cgi?id=10035
Previously the gradient walker was doing excessive resets, (such
as on every pixel in constant-colored regions or outside the
gradient with CAIRO_EXTEND_NONE). Don't do that.
The previous implementation fell apart quite badly when neither radius
value was equal to 0.0. I derived the math from scratch, (much thanks to
Vincent Torri <vtorri@univ-evry.fr> for guiding me to a simpler derivation
than I was doing originally), and it's working much better now without
being any slower, (in fact, cairo-perf shows speedup of 1.05x to 1.58x on
my laptop here).
This work also provides groundwork for defining the behavior of radial
gradients where neither circle is wholly contained within the other, (though
we haven't done that definition yet---it will require a new test case and a
very little bit of work on the implementation).
This is a fix for the following bug report:
Radial Gradients with nonzero inner radius misplace stops
https://bugs.freedesktop.org/show_bug.cgi?id=7685
Embarrassingly enough, the test suite previously never called
into cairo_pattern_create_radial at all. Unsurprisingly, this
has led to bugs creeping into the radial gradient implementation.
This reverts the following commits:
2715f2098167e3b3c53b
See this thread for an analysis of the problems it caused:
http://lists.freedesktop.org/archives/cairo/2007-February/009825.html
In short, a single cache for all backends doesn't work, as one thread
using any backend can cause an unused xlib pattern to be evicted from
the cache, and trigger an xlib call while the display is being used
from another thread. Xlib is not prepared for this.
This is needed since cairo-test does not issue a show_page now, and
the one coming from paginated layer is too late (around finish).
The way we force the show_page is kinda funny. That is, we create
a temporary cairo_t and call cairo_show_page() on it. But works.
That is, we always emit at least one page of output. Otherwise our
PS/PDF/SVG files would be corrupt, and output with zero pages does
not make much sense.
This means, PS/PDF/SVG do not need the final cairo_show_page() anymore.
If there is any drawing in the page, a cairo_show_page() is done
automatically.