Commit graph

1900 commits

Author SHA1 Message Date
M Joonas Pihlaja
9686331cb0 [spans] Round rasterization grid pixel areas instead of truncating.
When converting a grid pixel area into the range [0,255] the
GRID_AREA_TO_ALPHA() macro would truncate extra bits off the result
rather than rounding. This could cause seams between abutting
collinear edges of separately rendered polygons even when the
coordinates of the abutting edges were the same.

Reported by Soeren Sandmann on the cairo mailing list:

http://lists.cairographics.org/archives/cairo/2009-May/017043.html
2009-07-10 19:06:48 +03:00
Chris Wilson
4bb157672e [test] Rename some structures within cairo-test-trace
Simply rename a few structures so that their names are less confusing with
the mix of process and threads used to executes traces.
2009-07-05 09:22:44 +01:00
Chris Wilson
88cb69b10c [boilerpate] Move target definition to backends.
By moving the backend target definition out of the massive amlagamated
block in cairo-boilerplate.c and into each of the
cairo-boilerplate-backend.c, we make it much easier to add new targets as
the information need only be entered in a single file and not scattered
across three. However, updating the target interface means trawling across
all the files -- except given that I found it difficult maintaining the
single massive array I do not see this as an increase in the maintenance
burden.
2009-07-04 21:43:27 +01:00
Chris Wilson
fef3649953 [script] Fix the trivial errors running the test suite
A few typos crept in breaking the script output and various refreshes of
the expected results.
2009-07-04 18:32:57 +01:00
Chris Wilson
2395bba1e6 [any2ppm] Choose a more appropriate format for the replay content
Actually select a format that matches the request content when replaying
the script to an image.
2009-07-04 18:31:49 +01:00
Chris Wilson
6003ab77e1 Export meta-surface
The meta-surface is a vital tool to record a trace of drawing commands
in-memory. As such it is used throughout cairo.

The value of such a surface is immediately obvious and should be
applicable for many applications. The first such case is by
cairo-test-trace which wants to record the entire graph of drawing commands
that affect a surface in the event of a failure.
2009-07-03 18:26:50 +01:00
Chris Wilson
fe73a9dd14 [test] Record trace to an in-memory meta-surface
Requires hooking into test-meta-surface currently. Export meta-surface!

The idea is that on detection of an error, we can reconstruct a minimal
trace from the meta-surface. The first step is to simply dump the trace
for the failing meta-surface. Later, we should automatically minimise
this further.
2009-07-03 12:34:10 +01:00
Carlos Garcia Campos
b2e2a2f31a [test] Update argb32 pdf reference image for trap-clip 2009-07-02 15:01:41 +02:00
Carlos Garcia Campos
910afc7a8e [test] Mark all smask tests as XFAIL for pdf
Those tests use linear gradients which are not correctly handled by
poppler yet. See https://bugs.freedesktop.org/show_bug.cgi?id=10942
2009-07-02 15:01:33 +02:00
Carlos Garcia Campos
5becfc2bd5 [test] Add pdf reference image for rotate-image-surface-paint
Remove also argb32 and rgb24 pdf reference images.
2009-07-02 14:56:58 +02:00
Carlos Garcia Campos
f81203cde8 [test] Add pdf reference image for mask-transformed-image 2009-07-02 14:56:48 +02:00
Carlos Garcia Campos
9d538ef337 [test] Update argb32 and rgb24 pdf reference image for mask 2009-07-02 14:56:39 +02:00
Carlos Garcia Campos
97def877bb [test] Update pdf reference image for surface-pattern
Remove also argb32 and rgb24 pdf reference images.
2009-07-02 14:56:30 +02:00
Carlos Garcia Campos
8a6bdc63c1 [test] Update argb32 and rgb24 pdf reference image for text-pattern 2009-07-02 14:56:22 +02:00
Carlos Garcia Campos
b46ba7aa33 [test] Update pdf reference image for text-transform 2009-07-02 14:56:14 +02:00
Carlos Garcia Campos
9bc7ab980d [test] Update pdf reference image for filter-nearest-transformed
Remove also argb32 and rgb24 pdf reference images.
2009-07-02 14:50:16 +02:00
Carlos Garcia Campos
27938f7e3f [test] Update pdf reference image for filter-nearest-offset
Remove also argb32 and rgb24 pdf reference images.
2009-07-02 14:50:16 +02:00
Carlos Garcia Campos
e6576e8912 [test] Update argb32 pdf reference image for clip-operator 2009-07-02 14:50:16 +02:00
Carlos Garcia Campos
13d9374ec1 [test] Remove PDF reference images for scale-source-surface-paint
It works with current poppler now
2009-07-02 14:50:16 +02:00
Carlos Garcia Campos
3710c4184c [test] Remove PDF reference images for paint-with-alpha
It works with current poppler now
2009-07-02 14:50:15 +02:00
Carlos Garcia Campos
8162acd81a [test] Remove PDF reference images for paint-source-alpha
It works with current poppler now
2009-07-02 14:50:15 +02:00
Carlos Garcia Campos
1e1f4fd092 [test] Use poppler_page_render with a transparent surface
Instead of using an opaque surface filled in white, use a transparent
surface and fill it in white by using CAIRO_OPERATOR_DEST_OVER after
rendering.
2009-07-02 14:50:15 +02:00
Chris Wilson
4f745fbe33 [test] Only run fallback-resolution for enabled targets
A secondary check that both activates CAIRO_TEST_TARGET and prevents a
NULL-deref with the null test surface.
2009-06-29 10:49:51 +01:00
Chris Wilson
758a18b354 [test] Timeout support for tests
Enforce that each test must render within 60 seconds or be considered to
have hit an infinite loop and be reported as a CRASH. The timeout value is
adjustable via CAIRO_TEST_TIMEOUT -- a value of 0 will disable.
2009-06-28 21:10:30 +01:00
Chris Wilson
ddadd41a6c [test] Remove broken PDF reference images for push-group
More XFAIL reference images that are now invalidated by changes in
poppler.
2009-06-27 18:07:36 +01:00
Chris Wilson
4d233fa4a6 [test] Remove invalid smask PDF reference images
These need to be recorded using an XFAIL reference. In the meantime, as
the poppler output has changed, just remove all the invalid PDF reference
images.
2009-06-27 18:04:37 +01:00
Chris Wilson
86624627e4 [test] Add group-unaligned
Test case for:
   Bug 22441 -- Unexpected shift with push_group and pop_group
   https://bugs.freedesktop.org/show_bug.cgi?id=22441

This is a test that demonstrates the error in the pdf backend when using
groups on surfaces with non-integer sizes. In order to create such a
surface, we need to update the boilerplate to use doubles instead of
integers when specifying the surface size.
2009-06-27 17:53:18 +01:00
M Joonas Pihlaja
c7cf5317f5 [test] Fix Makefile.am for Solaris make.
Sun's make doesn't like conditional assignments to variables
in dependencies in the form of "target: VAR+=VAL".  This
construct was used to force the test suite run in the foreground
in the check-valgrind target.  It is replaced by a more
explicit set of the CAIRO_TEST_MODE environment variable.
2009-06-24 23:33:44 +01:00
M Joonas Pihlaja
a2d4fb5009 [test] Fix a typo in the _POSIX_SOURCE version number.
I hope POSIX isn't around in 20000 AD!
2009-06-21 17:34:13 +03:00
Chris Wilson
b71b6ecb59 [test] Fix the image compare
Oh, it's a bad sign when I can't even correctly compare a bunch of pixels.
2009-06-21 10:13:30 +01:00
Chris Wilson
3bad3efaa2 [test] Add cairo-test-trace to .gitignore 2009-06-19 19:09:03 +01:00
Chris Wilson
851c883962 [test] Add group-clip
Larry Ewing found an ancient and nasty bug whereby a path was not
corrected whilst pushing and popping groups.
2009-06-19 19:08:29 +01:00
Chris Wilson
0a34abace7 [test] Experiment with reference targets
Specify another boilerplate target to use as the reference for this
target. We then use this in cairo-test-trace in preference to using the
image surface. Still not perfect, though the framework is improving.
2009-06-19 19:06:17 +01:00
M Joonas Pihlaja
729457b174 [test] Add trap rendered ref images for fill-image.
The fill code path for the xlib and fallback surfaces use trapezoids
rather than spans, so there's lots of differences due to antialising
differences at the edge of the fill.  This patch adds a ref image
for the xlib and test-fallback surfaces.
2009-06-19 02:45:39 +03:00
M Joonas Pihlaja
8e7f667abb [test] Mark scale-offset tests as XFAIL for image, xlib-fallback.
The scale-offset tests trigger a loss-of-precision bug when
converting double matrices from cairo to pixman format.

http://lists.cairographics.org/archives/cairo/2008-November/015671.html
2009-06-19 02:45:38 +03:00
Chris Wilson
5ad64dfda2 [test] Add the sha1sum of the required fonts
(Note, I think these are currently out-of-date... But it will serve as a
useful reminder to verify and update them in future.)
2009-06-19 00:28:59 +01:00
Chris Wilson
6e78c94615 [test] Move calls to the getters from out of the innermost loops.
Tidy the code slightly by removing excess and unsightly calls to
cairo_test_get_context() and cairo_get_scaled_font().
2009-06-19 00:28:58 +01:00
M Joonas Pihlaja
9ecee571c1 [test/build] Don't test Freetype font stuff without Fontconfig.
Most Freetype hitting tests require Fontconfig to find
them some fonts.
2009-06-18 16:09:31 +01:00
M Joonas Pihlaja
742b1ad4b0 [test] Fix checking of the fenv.h include.
This adds a configure check for fenv.h and makes
invalid-matrix.c check for it with HAVE_FENV_H instead
of HAVE_FEDISABLEEXCEPT -- turns out Solaris doesn't
have fedisableexcept(), but it does have feclearexcept().

The same issue appears on OSX and was fixed in
ab86662ab4. This patch
adds some configure magic.
2009-06-18 16:07:56 +01:00
M Joonas Pihlaja
75f1d11d93 [test] Fallback to HUGE_VAL in place of INFINITY in invalid-matrix.c.
GCC 3.4.3 on OpenSolaris does not recognise INFINITY.  Use HUGE_VAL
instead for every compiler instead of just MSVC.
2009-06-18 16:07:56 +01:00
M Joonas Pihlaja
d1994d1ac2 [test/any2ppm] Daemonize without BSD's daemon().
Solaris libc doesn't provide daemon() so implement
any2ppm daemon's detaching without it.
2009-06-18 16:07:38 +01:00
M Joonas Pihlaja
c4c0693169 [test] Make test constructors without perl.
Remove the dependency on perl when building the test suite
by replacing the script which makes cairo-test-constructors.c
with a C program.
2009-06-18 15:41:19 +01:00
M Joonas Pihlaja
cdd27a8d4c [test] Never use gcc __attribute__ magic for constructors.
The configure test for __attribute__((constructor)) succeeds when
compiling with Sun Studio 12 on OpenSolaris but the attribute
is just ignored and has no actual effect.  This causes the test
suite to not run any tests at all.  With this patch we revert to
always using make-cairo-test-constructors.pl.
2009-06-18 15:39:16 +01:00
Nis Martensen
3c5e57e694 [test] Verify current point position after subpath closure
Make sure cairo_close_path always takes the current point where it
should be.
2009-06-17 16:39:00 +01:00
Chris Wilson
e5727e20f5 Expose _cairo_null_surface_create() via a test surface
Using a null surface is a convenient method to measure the overhead of the
performance testing framework, so export it although as a test-surface so
that it will only be available in development builds and not pollute
distributed libraries.
2009-06-15 12:03:37 +01:00
Chris Wilson
216a2e24c7 [test] Minor tweak to cairo-test-trace
Cleanse the code of a couple of redundant pointer manipulations.
2009-06-13 21:40:05 +01:00
Chris Wilson
2ab4245c86 [test] Need SOURCE when copying image data
As cairo-test-trace does not clear the image data before reuse, using
the default OVER operator will cause differing results for each process
when inadvertently alpha blending into the shared memory region. As we
essentially want to just copy the source pixels, be explicit and set the
SOURCE operator.
2009-06-13 21:36:20 +01:00
Chris Wilson
e003d665fe [test] Disable compilation of cairo-test-trace without shm_open()
Remember to only add cairo-test-trace to the list of EXTRA_PROGRAM so long
as we can actually compile it.
2009-06-13 19:18:11 +01:00
Chris Wilson
c092136fe9 [configure] Check for shm_open()
As needed for cairo-test-trace.
2009-06-13 19:07:37 +01:00
Chris Wilson
f298dd92ca [test] Remove dlmalloc
cairo-test-trace's shared memory allocation pattern is much simpler than
anticipated as it allocates a bunch of images and then frees them all,
and so only needs a simple linear allocator.
2009-06-13 19:07:00 +01:00