Commit graph

1075 commits

Author SHA1 Message Date
Chris Wilson
85a4f0dcee Workaround undefined functions required by rsvg & poppler.
If the native windowing system is disable (e.g. --disable-xlib) then the
test suite fails to build since the vector converters typically depend
upon gdk-pixbuf-2.0, which in turn depends upon a native gdk which
requires cairo to be built with support for the native windowing system. A
mess that should be resolved by separating rsvg and poppler into core and
higher-level libraries, but which we can workaround by simply ignoring
errors from undefined functions at link time.
2008-09-17 15:25:18 -04:00
Chris Wilson
7761a106ce [test] Check set_operator()
Draw a pair of rectangles with each operator in turn - seems to trigger an
issue with the PDF/PS backends.
2008-09-17 11:59:29 +01:00
Behdad Esfahbod
ff9a2af19e [test] Make test programs depend on check programs
Since they use them when being run.
2008-09-16 19:45:03 -04:00
Adrian Johnson
e880d0f956 Change user-font-rescale test to use opaque colors
The combination of the initial cairo_paint() and the translucent text
colors were causing image fallbacks that prevented the PS type 3 font
embedding from being tested.
2008-09-16 19:13:50 +09:30
Chris Wilson
1a3863688c [test/user-font-rescale] Tidy
Behdad warned that the static UNICODE_TO_GLYPH converter was not portable,
and needed to be replaced. And do a quick coding-style blitz.
2008-09-16 03:06:39 +01:00
Chris Wilson
be9df58b5d [test/user-font-rescale] Fixup use of NAN
Kill the use of the C99 feature, and replace with strtod("NaN").
2008-09-16 02:52:30 +01:00
Jeff Muizelaar
e53fe3ec24 [test] Add a test case for drawing glyphs with different metrics.
The ability to draw glyphs with different metrics is useful when doing
font substitution with fixed layout like in pdf and I eventually plan on
adding code to poppler to do something similar.
2008-09-16 01:59:28 +01:00
Chris Wilson
5c7c2b5187 [test] Test handling of fractional device offsets. 2008-09-15 17:11:42 +01:00
Chris Wilson
77b43da99f [test] Fixup potential use of uninitialized test_image.
In the churn of reordering the tests, some of the error paths were left
unaltered - causing potential invalid dereferences.
2008-09-15 16:48:22 +01:00
M Joonas Pihlaja
4e731f7c90 [test] Only test truetype-tables if we can.
Doesn't build without CAIRO_HAS_FONT_SUBSET.
2008-09-12 09:40:23 +03:00
Behdad Esfahbod
66d6cb642c [Makefile.am.common] Unify more common rules 2008-09-11 18:06:57 -04:00
Behdad Esfahbod
de5b8bce37 Makefile.am cleanup
Use a common build/Makefile.am.common file.
2008-09-11 15:49:09 -04:00
Chris Wilson
e9e439a7a8 [test] Check for updated reference images.
Delete the results of previous runs if the reference images are more
recent.

There's still potential error if the conversion utility or its required
libraries are modified...
2008-09-11 12:58:48 +01:00
Adrian Johnson
e1c1bba3ff Update user-font-proxy PDF/PS ref images 2008-09-11 19:00:17 +09:30
Chris Wilson
140ffa6e27 [test] Fix order of deleting images vs checks.
The early-checks assume that the images are still available - so it helps
not to unlink them before comparing results to the previous run.
2008-09-11 10:00:57 +01:00
Chris Wilson
8abb252b0e [test/Makefile.am] Update list of reference images.
Remove the references to the deleted PS images and the premature
addition of the PDF images.
2008-09-10 20:29:05 +01:00
Chris Wilson
e895ab81f3 [test/Makefile.am] Remove reference to clip-operator-ps-argb32-ref.png
The test passes using the general reference image since the PS now
correctly uses the image fallback for the alpha gradients.
2008-09-10 19:02:49 +01:00
Behdad Esfahbod
042ef899a2 [test/pdiff] Fix include syntax 2008-09-10 13:57:17 -04:00
Chris Wilson
84a7a9955c [test] Typo in Makefile.am
s/AC_CPPFLAGS/AM_CPPFLAGS/g
2008-09-10 18:23:31 +01:00
Behdad Esfahbod
43a42d0a19 [test/pdiff/Makefile.am] Another automake warning fix 2008-09-10 12:41:32 -04:00
Chris Wilson
378b11aaf3 [test] fill-alpha
Update alpha value to non-divisable-by-256 number to expose a bug in
pixman where it appears to be mixing in empty registers.
2008-09-09 09:07:34 +01:00
Behdad Esfahbod
c20179b65f [{test,perf}/Makefile.am] Define html-local target instead of html
Fixes automake warning.
2008-09-08 15:17:52 -04:00
Behdad Esfahbod
87dfceb9ec [Makefile.am] Rename INCLUDES to AM_CPPFLAGS
Fixes automake warnings
2008-09-08 15:13:07 -04:00
Chris Wilson
1affc3192b [test] Add fill-alpha-pattern.
A slight variation on the simple fill-alpha theme is that if Company is
truly seeing a regression where we dither, the error on a constant
background will be small and might be missed by the test suite.
2008-09-08 13:34:45 +01:00
Chris Wilson
ee5e6c821f [test] Add fill-alpha.
Benjamin Otte reported "who broke rgba fills? they look dithered with
recent git."

This commit is the result of a skim through the test-suite which revealed
no single test responsible for checking the basic operation of
"set_rgba(); fill();".
2008-09-08 12:34:36 +01:00
Chris Wilson
7439c45039 [ps] Only use fallback images if the gradient has non-constant alpha.
If the gradient has constant alpha, then we can express it as a flattened
linear gradient. Otherwise, should the opacity vary across the gradient we
need to fallback.
2008-09-07 15:03:47 +01:00
Chris Wilson
94fd60d5ec [test] Add gradient-constant-alpha.
PostScript can handle alpha gradients, iff they have a constant alpha. So
exercise that path.
2008-09-07 15:03:37 +01:00
Chris Wilson
a33f2f6962 Revert "[ps] A flattened gradient is not linear."
This reverts commit 85ed37da33.

Adrian Johnson pointed out that iff the gradient has constant alpha then
it can be flattened. Reverting this commit in order to restore the
capability to handle gradient flattening.
2008-09-07 15:03:21 +01:00
Chris Wilson
85ed37da33 [ps] A flattened gradient is not linear.
We cannot express an alpha-gradient as a simple linear interpolation
between 2 flattened colors. So fallback.
2008-09-06 09:10:25 +01:00
Chris Wilson
c1c86afa87 [ps] Use floating point values when flattening color.
Use the full-precision color values when computing the alpha-blended
color.
2008-09-06 09:10:20 +01:00
Behdad Esfahbod
965b0e51ec [test] Do not include "xmalloc.h" directly
Not needed, it's renamed and included by boilerplate directly.
2008-09-04 23:25:27 -04:00
Behdad Esfahbod
a7951081f1 Move _GNU_SOURCE declarations to where it's used
Such that we don't rely on more GNU extensions accidentally.
2008-09-02 21:54:09 -04:00
Behdad Esfahbod
5926257770 Revamp the build system.
Quick summary of changes:

  - Move list of cairo source files out of src/Makefile.am and into
    src/Sources.mk,

  - Generate files src/Config.mk and src/Config.mk.win32 that choose
    the right set of source files and headers based on configured
    backends and features.  This drastically simplifies building
    using other build systems.  The src/Makefile.win32 file needs
    to be updated to reflect these changes.

  - Add README files to various directories,

  - Add toplevel HACKING file.
2008-09-02 20:24:08 -04:00
Chris Wilson
7b2e8035f2 [cairo-test] Fixup a few memleaks on failure.
Free the test image before jumping to UNWIND_CAIRO.
2008-09-02 10:54:13 +01:00
Chris Wilson
bd21b2f630 [test] Ensure that the output is always saved.
Do the saving of the output first before checking for various failures
with respect to the reference images.
2008-08-26 23:03:08 +01:00
Chris Wilson
08ea9d1f2a [pdiff] Get the surface data pointer once.
Don't call cairo_image_surface_get_data() for every single component of
the two surfaces to compare.
2008-08-26 23:01:30 +01:00
Chris Wilson
17a6d541f8 [test] Explicity save a fail image.
Be explicit about handling cached FAIL images, instead of relying on the
sequences of failed matches as the files are an external resource and we
can not guarantee their individual accessibility.

Note this also changes the filename, so you may want to run:
$ find -name '*-last.*' -print | xargs rm
after this checkout.
2008-08-21 08:45:06 +01:00
Chris Wilson
b9287e6669 [test] Cache last output and compare next time.
Compare the current output against a previous run to determine if there
has been any change since last time, and only run through imagediff if
there has been. For the vector surfaces, we can check the vector output
first and potentially skip the rasterisation. On my machine this reduces
the time for a second run from 6 minutes to 2m30s. As most of the time,
most test output will remain unchanged, so this seems to be a big win. On
unix systems, hard linking is used to reduce the amount of storage space
required - others will see about a three-fold increase in the amount of
disk used.  The directory continues to be a stress test for file selectors.

In order to reduce the changes between runs, the current time is no longer
written to the PNG files (justified by that it only exists as a debugging
aid) and the boilerplate tweaks the PS surface so that the creation date
is fixed. To fully realise the benefits here, we need to strip the
creation time from all the reference images...

The biggest problem with using the caches is that different runs of the
test suite can go through different code paths, introducing potential
Heisenbergs. If you suspect that caching is interfering with the test
results, use 'make -C test clean-caches check'.
2008-08-20 23:56:56 +01:00
Chris Wilson
b47c772934 [test/bufferdiff] Move unused code.
Only imagediff calls png_diff, so it makes sense to move that function out
of the cairo-test and into the utility.
2008-08-20 23:20:09 +01:00
Chris Wilson
5712a2c619 [test] Destroy test ouput image on failure.
Add the missing cairo_surface_destroy(). Sigh, less haste more speed.
2008-08-19 15:17:45 +01:00
Chris Wilson
0354457bed [test] Always write the test output to a png.
Always write the test output to a png so that it can be copied and used as
a reference image with CAIRO_REF_DIR.
2008-08-19 15:10:51 +01:00
Chris Wilson
86d221521b [test] Pass extended output name to ref_name_for_test().
Having included some extra details in the test output PNG filename, we
need to pass the extra information to
cairo_ref_name_for_test_target_format() in order to find the match.
2008-08-19 14:58:48 +01:00
Chris Wilson
776844eb9e [boilerplate] Daemonic conversion utility.
In order to achieve substantial speed improvements the external conversion
utilities are rewritten as a daemon that communicates with the test suite
over a local socket. This is faster as it avoids the libtool and dynamic
linker overhead for each invocation, the caches persist between tests and
we no longer require a round trip through libpng.

The daemon is started automatically by the test suite and if communication
cannot be established then it falls back to using a pipe to a normal
conversion utility. The daemon will then persist for 60 seconds waiting
for further connections.

Of course any memory leak (stares at poppler) is exacerbated.
2008-08-19 11:15:12 +01:00
Chris Wilson
4cd478b95f [test] Initialise test context.
Fixup a couple more tests that do not initialise a test context for
themselves.
2008-08-18 17:56:21 +01:00
Chris Wilson
c56385eacc [test/make-html.pl] Don't include links to non-existent images.
Some tests do not generate output images, so do not insert a link if we
don't have an image.
2008-08-18 16:18:57 +01:00
Chris Wilson
17fbb652b1 [test] Avoid redundant writes/reads of test surfaces via png.
As Behdad suggested, we can dramatically speed up the test suite by
short-circuiting the write to a png file, only to then immediately read it
back in. So for the raster based surfaces, we avoid the round-trip through
libpng by implementing a new boilerplate method to directly extract the image
buffer from the test result. A secondary speedup is achieved by caching the
most recent reference image.
2008-08-18 16:18:52 +01:00
Chris Wilson
9b0b55cea7 [test/leaky-dashed-rectangle] Add ref to bug report.
Yevgen Muntyan has filed a bug report with the same symptoms as
leaky-dashed-rectangle, so add a reminder for when it is finally fixed.
2008-08-18 08:26:57 +01:00
Chris Wilson
212cbd3f1b [test/user-font] Correct the lifetime of the user font face.
By keeping a static reference to the user font face, it is erroneously kept
alive during a call to cairo_debug_reset_static_data(). (A violation of
the caller's contract to ensure that no active reference to a cairo object
is held by the caller.)
2008-08-18 08:26:43 +01:00
Chris Wilson
c745a622db [test/toy-font-face] Use cairo_test_init/fini().
Minor step to harmonise the test with the rest of the suite.
2008-08-17 17:33:29 +01:00
Chris Wilson
37bca38772 [test/create-from-png] Return the failure.
Having checked all the possible PNG formats, report any failures.
2008-08-17 15:30:51 +01:00