Commit graph

1279 commits

Author SHA1 Message Date
Jeff Muizelaar
a303bbaea3 [font-face-get-type] Fix test to cleanup the surface and context properly
Destroy the context and the surface even when the test fails.

I ran into this because cairo_debug_reset_static_data() is called between the
tests on the quartz backend (it doesn't fork) and isn't on other backends? This
is perhaps a mistake...
2008-12-23 16:12:56 -05:00
Chris Wilson
93672d842f [test] Fix reference handling in user-font-rescale
user-font-rescale stored the current font on the context in order to
create a rescaling proxy font. As we failed to take a reference to the
font, it caught us by surprise when the font disappeared as we modified
the context before creating our proxy. Ho hum.
2008-12-23 15:03:08 +00:00
M Joonas Pihlaja
38ec6e302c [test] Fix any2ppm build when building without the full complement of surfaces.
It was complaining about g_init_type () being used without the proper includes
which would have been pulled in by the svg or poppler includes.
2008-12-23 02:05:32 +02:00
Jeff Muizelaar
f8886ad1b3 [scaled-font-zero-matrix] Destrory scaled font and font options
Oops.
2008-12-18 20:50:20 -05:00
Jeff Muizelaar
4567692326 Add test creating a scaled font with a zero ctm matrix 2008-12-18 18:03:40 -05:00
Jeff Muizelaar
18054ef00c [test] Quartz doesn't like being forked
When the cairo-test-suite forks CoreFoundation complains with:
"The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec().
When forked so avoid doing it in the test suite for now. In the future we should investigate
the possibility of a work around.
2008-12-18 18:01:52 -05:00
Chris Wilson
3a53e0261b [test] Update twin reference images.
Closing the 'o' in twin has removed a slight artefact - update the reference
images to match.
2008-12-18 12:06:46 +00:00
Chris Wilson
c2478de26c [twin] Switch internal users to the new name.
s/<cairo>/@cairo:/
2008-12-18 12:06:46 +00:00
Chris Wilson
43edb4dd7b Fix compilation with gcov
We need to add --coverage to LDFLAGS, so create CAIRO_LDFLAGS and use that
to populate AM_LDFLAGS.
2008-12-14 16:44:03 +00:00
Chris Wilson
bcea3151d6 [test] Add missing joins.ref.png
Missed this file when adding the reference images for joins.
2008-12-14 16:44:03 +00:00
Chris Wilson
792057539b [test] Only delete output images beneath output.
We were using an overly-liberal find that also deleted copied output for
use in CAIRO_REF_DIR if that directory was below test/. So only delete
files below output/ (which should only be used by cairo-test).
2008-12-12 13:43:36 +00:00
Chris Wilson
913cbad25e [test] Add a simple joins test case
Exercise joins between short (<LINE_WIDTH) lines - used in debugging
stroke-to-path.
2008-12-12 13:43:30 +00:00
Chris Wilson
4ff884fe4d [test] Check idempotency of append_path() -> copy_path()
The API should preserve the precision across the public interface so that
the user is able to retrieve the co-ordinates that he used to construct
the path. However since we transform the path to a 24.8 fixed-point
internal represent we currently incur a precision-loss - the affects of
which can be seen in the miter-precision test case for example. It is
planned to move to keeping the path as doubles until the backend
explicitly requests the fixed-point coodinates (and some backends, e.g.
pdf, might only ever use the doubles). Then, barring rounding errors
during path transformations, we should be able to return the exact path
the user set (under an identity CTM, of course ;-).
2008-12-12 13:23:09 +00:00
Chris Wilson
fe4af195a7 [test] Add a rectilinear-dash test case.
Exercise dashing on pixel-aligned boundaries to test extending the
rectilinear stroker to handle dashes.
2008-12-12 13:23:08 +00:00
Chris Wilson
888f62feaa [test] Propagate error from path
If the path is in error, just append it to the context so that the error
is propagated correctly.
2008-12-12 11:11:49 +00:00
Chris Wilson
f13f63e3d8 [test/clip-nesting] Propagate status from sub-context.
Use cairo_path_append() to propagate an error status from a child context
to it parent so that it is properly reported under memfault.
2008-12-12 11:11:49 +00:00
Chris Wilson
e6e33b036f [test/solid-pattern-cache-stress] Propagate status from sub-contexts.
Use a cairo_append_path() to set an arbitrary error status on the parent
context, in order to propagate errors from a child.
2008-12-12 11:11:49 +00:00
Chris Wilson
dfc49a67e6 [test] Trim the number of fallback resolutions tested.
Simplify the test matrix to only include testing the fallback-resolution
of a uniform scale in one or both axes.
2008-12-12 11:11:48 +00:00
Chris Wilson
0ebbcd671c [test] Fix memleak from fallback-resolution.
The test-name was being recreated for every pass, but was never freed.
2008-12-12 11:11:48 +00:00
Chris Wilson
a9697e5fb0 [test] Exercise glyph culling.
Sascha Steinbiss reported an issue with glyph culling,
http://lists.cairographics.org/archives/cairo/2008-December/015976.html,
whereby we failed to update the text clusters upon culling the glyphs in
the gstate and proceeded to read beyond the end of the glyph array in the
PDF backend. This test case setups a similar condition as reported, by
trying to write a wide string into a small box.
2008-12-12 11:11:48 +00:00
M Joonas Pihlaja
5e06085b48 [cairo-spans] Render clip mask surfaces with spans if we can.
Generating surface masks for clipping can also benefit from span
rendering sometimes.
2008-12-07 03:51:07 +02:00
M Joonas Pihlaja
18634c3702 [cairo-spans] Hook up filling paths with spans to cairo-surface-fallback.c.
This speeds up the mask generation step in cairo_fill() for the image
surface by up to 10x in especially favourable cases.

image-rgba                              twin-800 7757.80 0.20% -> 749.41 0.29%: 10.36x speedup
image-rgba spiral-diag-pixalign-nonzero-fill-512   15.16 0.44% ->   3.45 8.80%:  5.54x speedup

More typical simple non-rectilinear geometries are sped up by 30-50%.
This patch does not affect any stroking operations or any fill
operations of pixel aligned rectilinear geometries; those are still
rendered using trapezoids.
2008-12-07 03:27:13 +02:00
Chris Wilson
1659db2c1f [test] Fix surface leak from device-offset-positive.
A forgotten cairo_surface_destroy() caused the similar surface to be
leaked during the test.
2008-11-29 11:20:35 +00:00
Chris Wilson
f0804d4856 [test] Exercise caps and joins under reflection.
The nature of the joins depends critically upon whether the joint is
clockwise or counter-clockwise, so extend the basic caps-joins test to
exercise both conditions i.e. repeat the test under a reflection.
2008-11-29 11:20:29 +00:00
Chris Wilson
f39dd86e29 [test] Add simple cap test.
Add a test case that only exercises capping, useful for developing
new strokers.
2008-11-29 10:14:26 +00:00
Paolo Bonzini
47275c7ece [test] Fix glitz-surface-source test
The recent changes to separate glitz/agl broke the compilation of the
glitz-surface-source test.
2008-11-26 16:18:41 +00:00
Paolo Bonzini
a84ea78290 [test] Add quartz-surface-source test
Add a simple test to exercise using a Quartz surface as a source.
2008-11-26 16:17:45 +00:00
Paolo Bonzini
993941cfd7 [perf] Fix SDL compilation for MacOS X
The attached patch makes the SDL tests compile under Mac OS X.  The
problem is:

1) that <SDL_main.h> should be included in files that define the main
function for SDL Mac OS X programs (this is not true with the upcoming
SDL 1.3 release).

2) that -lSDLmain, because it is statically linked, needs the Cocoa
framework in the LDADD of the main program.  Again, 1.3 will not require
this.
2008-11-26 16:15:35 +00:00
Adrian Johnson
b87d81ef0b Add image/jp2 to mime-data test 2008-11-24 22:27:03 +10:30
Chris Wilson
7894abbe6d [test] Support foreground only execution.
Add an option to prevent forking - which makes it difficult to
valgrind/gdb individual tests.
2008-11-19 11:59:20 +00:00
Chris Wilson
97edc680c1 [twin] Reduce tolerance.
As the glyphs are rendered to cache, ensure that they are rendered at the
highest quality settings.
2008-11-19 11:59:20 +00:00
Chris Wilson
e50538863a [twin] Tweak line width.
Slightly increase line width to eliminate internal holes in the characters
where the strokes were not quite overlapping.
2008-11-19 11:59:20 +00:00
Chris Wilson
3a82f94398 [test] Add util/cairo-script to include path.
any2ppm needs the include path for cairo-script-interpreter so that it can
be built without an existing install.
2008-11-16 18:21:52 +00:00
Chris Wilson
a2eff7c7de [test] Add build rule for libcairo-script-interpreter.la
Add a rule to build the cairo-script-interpreter on behalf of any2ppm.
2008-11-16 16:21:37 +00:00
Chris Wilson
bf309aab60 [configure] Delete CAN_TEST_SCRIPT
A CairoScript interpreter is built under utils and so is always available.
2008-11-16 16:21:37 +00:00
Chris Wilson
cdfffc7420 Add CairoScript interpreter
Add a CairoScript interpreter library and use it to replay the test output
for the CairoScript backend. The library is also used by the currently
standalone Sphinx debugger [git://anongit.freedesktop.org/~ickle/sphinx].
The syntax/operator semantics are not yet finalized, but are expected to
mature before the next stable release.
2008-11-13 11:36:55 +00:00
Chris Wilson
a856371bef Add CairoScript backend.
A new meta-surface backend for serialising drawing operations to a
CairoScript file. The principal use (as currently envisaged) is to provide
a round-trip testing mechanism for CairoScript - i.e. we can generate
script files for every test in the suite and check that we can replay them
with perfect fidelity. (Obviously this does not provide complete coverage
of CairoScript's syntax, but should give reasonable coverage over the
operators.)
2008-11-13 11:36:54 +00:00
Chris Wilson
9afad53730 [test] Expand in-fill-trapezoid
Test vertices and edges of a rectangle to probe 'corner-cases', using the
insideness conditions from flash.
2008-11-13 11:36:42 +00:00
Chris Wilson
cd2e18ddc6 [test] Fix-up rgb byte packing
Another embarrassing, but thankfully, trivial bug.
2008-11-07 19:35:26 +00:00
Chris Wilson
2554d17598 [surface] Pass a separate closure for the mime-type destroy notifier.
A limitation of the current API was that the destroy notifier was called
on the mime-data block. This prevents the user from passing in a pointer
to a managed block, for example a mime-data block belonging to a
ref-counted object. We can overcome this by allowing the user to specify
the closure to be used with the destroy notifier.
2008-11-07 19:30:33 +00:00
Chris Wilson
9dee7af41f [test] Add off-centre tests to in-fill-trapezoid.
Reading through the previous commit spotted that the arguments to
edge_compare_for_y_against_x were transposed, but the test-suite had
failed to catch detect it. This is due that in order to actually
solve the equation we need to have a diagonal edge passing near an
off-centre point of interest, which was not among the test cases. So add
some off-centre tests to fully exercise the code.
2008-11-06 01:06:20 +00:00
Chris Wilson
0ac9846159 [test] Add WINDING variants to in-fill test
Check cairo_in_fill() with some WINDING tests as well as the current
EVEN_ODD.
2008-11-06 00:06:12 +00:00
Chris Wilson
34564aa84a [test/pdf2png] Remove dependency on GdkPixbuf
It's appears to be dropped from the current poppler trunk, so just use our
own venerable cairo_surface_write_ton_png().
2008-11-05 19:27:49 +00:00
Chris Wilson
d63267e4e7 [test] Update mime-data to check image/png
Add a "image/png" mime-type test.
2008-11-05 18:13:10 +00:00
Chris Wilson
199c0e7113 [svg] Embed jpeg data.
Support jpeg embedding for svg output.
2008-11-05 15:13:02 +00:00
Chris Wilson
29621bd399 [matrix] Remove stray offset from previous commit.
I moved the pixel centre to xc,yc but forgot to remove it during
compensation - as caught by the test suite.

Refresh a couple of reference images that depend upon exact pixel-centre
rounding conditions.
2008-11-05 12:16:47 +00:00
Chris Wilson
c95eebc923 [pattern] Split the translation between the matrix and [xy]_offset
pixman limits the src] co-ordinates (and thus [xy]_offset] to 16bits,
so we need to be careful how much of the translation vector to push into
[xy]_offset. Since the range is the same for both, split the integer
component between the matrix and the offset.

test/scale-offset* now at least shows the source image, even if it is
misplaced.
2008-11-05 10:00:13 +00:00
Chris Wilson
68309481aa [test] Mark targets with is_meta?
Allow tests to skip targets based on whether they are a meta surface or
not.
2008-11-05 08:36:01 +00:00
Chris Wilson
8855f9583e [test] Add scale-offset-(similar|image)
Add a test case for the scaling bug reported by Michel Iwaniec:
http://lists.cairographics.org/archives/cairo/2008-November/015660.html
2008-11-05 08:01:27 +00:00
Chris Wilson
aad9809003 [test] Only depend on any2ppm if we build it.
Do not add a dependency to any2ppm if it has been deconfigured.
2008-11-05 08:01:27 +00:00