Commit graph

279 commits

Author SHA1 Message Date
Emmanuel Pacaud
e952e0aff8 SVG: Add documentation for public API. Fix test filenames and add testing of CAIRO_CONTENT_COLOR 2006-04-14 22:53:58 +02:00
Carl Worth
c81569d2f1 Flesh test-paginated-surface out into a complete surface.
This adds an aactual test_paginated_surface_backend rather than just
having this test surface create a paginated surface around an image
surface. This is a more realistic test of what a paginated surface is
and should be more useful as an example of how to use the paginated
surface, (and in particular the analysis portions).
2006-04-14 11:05:35 -07:00
Carl Worth
41dc06d711 Add new PS-specific image for dash-zero-length test.
This reference image demonstrates the bug that occurs when we emit zero-length
dash segments into a PostScript file with butt caps.
2006-04-14 10:08:31 -07:00
Jeff Muizelaar
584109d5e6 Add test case for dashed lines.
The new test case tests a variety of circumstances involved with zero length dashing.
2006-04-13 23:38:02 -04:00
Carl Worth
08b109fb9a Add new ps-specific reference image for dash-caps-joins test.
With the recent fix to the treatment of sub-paths with respect to
dashing, this test is now correct except for slight difference in
ghostscript vs. cairo rasterization. This commit records the
ghostscript output as the new reference image against which the ps
output should be tested.
2006-04-10 11:00:26 -07:00
Carl Worth
f02aacbb5f Update dash-caps-joins test cases to show independent dashing of sub-paths.
We would like to be compatible with PostScript/PDF dash semantics. And
according to the description of the setdash operator in section 8.2 of
the PostScript Language Reference Manual, (as well as the description
of the line dash pattern in section 4.3.2 of the PDF Reference), each
sub-path should be treated independently with respect to dashing.

With this change, this test now fails for most backends for which it
previously passed.
2006-04-10 10:54:24 -07:00
Carl Worth
b87726ee2a Tweak initial erase so it doesn't trigger fallbacks for every PS test case.
Add an optimization to cairo-ps-surface.c so that it ignores any
CAIRO_OPERATOR_CLEAR drawing operation that occurs on a blank page.
Also change the test suite to erase with OPERATOR_CLEAR instead of
OPERATOR_SOURCE with an all-0 source pattern.

With this change, 32 of the 61 test cases change from all-fallback to
all-native for the ps backend.

Of these 32 test cases, 13 pass the test suite with the original
reference images. Another 18 cases differ only in the single-pixel
boundary of objects due to cairo vs. ghostscript rasterization
differences. We ignore these by adding new ps-specific reference
images, (included in this commit).

Finally, there appears to be one genuine failure, (dash-caps-joins),
in which the PostScript dashes (at least as rendered by ghostscript)
differ significantly from the cairo-rendered dashes.
2006-04-06 09:43:39 -07:00
Carl Worth
c4fc7b06b5 Revert "Use ghostscript's pngalpha rather than png16m target for PS->PNG"
This reverts 3b873c66be commit.

It seemed like a good idea at the time, but...
The pngalpha target only gets the fully transparent regions correct.
But we still need to get the partially translucent regions correct.
The pngalpha target doesn't help here---instead we were already
flattening the reference image during testing. And in that case,
having anything other than alpha==1 in the output png doesn't really
help, (and meanwhile it was tripping up the current buffer_diff code).
2006-04-06 08:54:59 -07:00
Carl Worth
e01047a76a Build fix for typo from recent commit. 2006-04-05 17:15:48 -07:00
Carl Worth
3b873c66be Use ghostscript's pngalpha rather than png16m target for PS->PNG
This target allows the output files to actually be transparent where
there is no PostScript "ink", which allows for much better testing.
2006-04-05 17:09:45 -07:00
Carl Worth
341d61cda0 Disable show-glyphs-many test to avoid abusing ghostscript too badly. 2006-04-05 17:09:45 -07:00
Carl Worth
66ed9811cc Merge branch 'cairo-origin' into analysis-surface
With the string-array-stream stuff that this merge picks up, the
analysis-surface branch is now passing all of the test suite again.
2006-04-04 14:58:52 -07:00
Carl Worth
0114393a13 Explicitly remove the output png image before creating it during testing.
What was happening here is that some backends (such as the PS surface
backend) directly generate an output file, and then run a conversion
process to generate the png file. Some bugs were such that a broken
file would successfully be generated, the conversion would fail (the
failure was unnoticed), and the test suite would happily verify the
old image from a previously successful run.

This fix eliminates this source of false positives.
2006-04-04 11:17:25 -07:00
Carl Worth
34a4ad1e5b test/show-glyphs-many: New test case to demonstrate bug #5528
This demonstrates an Xlib crash when rendering many glyphs. See:

	_XError from XRenderCompositeText8
	https://bugs.freedesktop.org/show_bug.cgi?id=5528

for more details.
2006-03-02 10:32:38 -08:00
Carl Worth
210dd59a74 Add some basic testing of cairo_font_face_get_type and
cairo_scaled_font_get_type.
2006-02-28 02:30:27 -08:00
Carl Worth
bd2136a23f Correct copyright date 2006-02-28 01:31:15 -08:00
Carl Worth
f9534c856a test/pattern-get-type: Add new test case for cairo_pattern_get_type. 2006-02-28 01:30:58 -08:00
Carl Worth
1dd6e417c1 Add testing for cairo_surface_get_type.
All test targets now list an expected cairo_surface_type_t. Add notes
on current limitations of PDF/PS/meta-surface support that causes
CAIRO_CONTENT_COLOR similar surfaces of PDF and PS surfaces to be
returned as image surfaces.

Add cairo_internal_surface_type_t for the meta, paginated, and various
test surfaces.
2006-02-28 00:55:27 -08:00
Carl Worth
d88c19071f Rename .cvsignore to .gitignore. Add *~ and *.o. 2006-02-15 15:00:26 -08:00
Emmanuel Pacaud
9c05d2aab1 fix filename.
shh!
2006-02-02 12:47:58 +00:00
Christian Biesinger
bfc2b49ad9 Updating BeOS reference images, the tests use a black background now. 2006-01-21 11:54:17 +00:00
Christian Biesinger
9fe4934635 Update BeOS test code per the cairo_format_t -> cairo_content_t changes. 2006-01-21 09:46:13 +00:00
Christian Biesinger
2afe78c0c2 Don't mix declarations and code. This makes the code valid ISO C, fixes a gcc -pedantic warning, and unbreaks the build with the compiler Zeta ships with. 2006-01-21 09:39:10 +00:00
Carl Worth
a6ad853ee1 Fix test to use fontconfig properly so that the test no longer fails. Fixes bug #4674. (Thnks to sunmoon1997 for the fix). 2006-01-20 15:15:40 +00:00
Carl Worth
074f886c00 Rip the cairo_content_t argument out of ps/pdf_surface_create as per discussion on cairo mailing list. Instead these surface will behave as if CONTENT_COLOR_ALPHA had been passed (that is, compositing operators will behave as if destination alpha were available).
This also has the benefit of preserving the API that has been in place for PS/PDF surface since the (experimental) stuff in 1.0.0.
Track API change.
Continue testing PS/PDF surfaces in the CAIRO_CONTENT_COLOR mode but do it by rendering to an intermediate similar surface rather than constructing the target surface differently.
2006-01-19 17:48:22 +00:00
Emmanuel Pacaud
14acc7f132 add missing header. Fix #5544. 2006-01-19 12:44:00 +00:00
Carl Worth
c634e54775 Change documentation to recommend cairo_paint rather than cairo_rectangle;cairo_fill for clearing a surface.
Add documentation. Add a cairo_content_t argument to PDF surface constructors.
Add documentation. Add a cairo_content_t argument to PS surface constructors.
Track changes in PS/PDF surface constructor API.
2006-01-18 16:40:17 +00:00
Carl Worth
b5c5fb613d Big change to the test infrastructure and supporting internals. The goal now is to test both a COLOR_ALPHA and a COLOR content for each surface backend, (since the semantics are different and we probably need to support both in each backend.
The PS/PDF backends don't allow a content to be passed in right now, so they fail against the rgb24 tests, but the trivial addition to the constructors will allow them to pass all tests with both content values.
And new constructors (currently internal only) to create an image surface with a cairo_content_t rather than a cairo_format_t.
Add a cairo_content_t argument to the constructor.
Add a cairo_content_t to the constructor and use this content value when constructing intermediate image surfaces in acquire_source, show_page, copy_page, and snapshot.
Add image flattening by compositing over white, as is done in cairo-ps-surface.c.
Track changes to cairo-paginates-surface which now requires a cairo_content_t value (no change to public PS/PDF constructors yet).
Track change in meta-surface and paginated-surface interfaces by now accepting a cairo_content_t rather than a cairo_format_t.
Ignore new output files (argb32 from pdf and ps as well as rgb24 from test-fallback, test-meta, and test-paginated).
Add new utility for flattening PNG images in order to generate the -argbf-ref.png images.
Add image_diff_flattened for comparing flattened output from PS and PDF backend with ARGB reference images by first blending the reference images over white.
Get rid of conditional, format-specific background-color initialization before running tests. Now uses ARGB(0,0,0,0) in all cases. Switch from specifying tests with a format value to specifying tests with a content value. Add support for a 'fake' COLOR_ALPHA_FLATTENED content for testing the PS and PDF output against a flattened version of the argb32 reference images (first blended over white).
Track change in cairo_ps_surface_create (now requires cairo_content_t value).
Adjust tests that draw in default (black) to first paint white so that the results are visible.
Adjust ARGB32 reference images for new white background for changed tests.
Adjust RGB24 reference images for new black background due to changed initialization (and the tests themselves being unchanged).
2006-01-17 16:59:08 +00:00
Christian Biesinger
0b48d620f1 Update BeOS reference images per the recent gradient changes 2006-01-15 04:44:45 +00:00
Christian Biesinger
c79cda6150 Ignore glitz-glx test output 2006-01-14 06:53:43 +00:00
Carl Worth
4e4b38e759 Add a call to cairo_copy_page, so that that gets called at least once within the test suite.
Fix broken implementation of copy_page in the paginated surface by hiding it from the target surface which sees only show_page operations. (It's hard to do better than that unless we can guarantee thathe subsequent page won't trigger any image fallbacks.)
2006-01-12 16:47:05 +00:00
Carl Worth
25882cd5e9 Add a new CAIRO_HAS_MULTI_PAGE_SURFACES automake conditional.
Remove backend-specific tests (ps-surface, pdf-surface, and pdf-clip) that are now redundant with the ps and pdf support in the rest of the test suite.
Add a new one-off test for testing show_page with both the ps and pdf backends.
2006-01-12 16:35:12 +00:00
Carl Worth
3647ff95f9 Some fixes for the fact that multi-page output was totally broken for cairo_ps_surface_t (at least):
Move the Y-axis-flipping to be on a per-page basis (as it was before and as it must be). Put page number back in, (still missing th number of pages from the header).
Add multi-page output for better testing.
2006-01-12 13:36:36 +00:00
Carl Worth
d6cb82c372 Add printf format attribute to cairo_test_log. 2006-01-09 17:18:12 +00:00
Carl Worth
9737b4de39 2005-10-10 David Reveman <davidr@novell.com>
Throw away old gradient code from within cairo-pattern.c in favor of using new support in pixman for gradients.
Update reference images for all tests involving gradients since the gradient output has changed slightly.
2006-01-04 17:59:03 +00:00
Vladimir Vukicevic
c6cdfc5770 Clamp surface dimensions to a minimum of 1. (_cairo_glitz_surface_get_image): Set the glitz clip to NULL before calling glitz_get_pixels, to return the full surface contents. Restore clip afterwards. (_cairo_glitz_surface_composite_trapezoid): Return UNSUPPORTED if the antialias is anything other than DEFAULT/GRAY.
Try to recover a standard cairo_format_t from given pixman format masks, so that various things that only work with a standard format work correctly.
Remove cairo_glitz_surface_write_to_png, replace with generic cairo_surface_write_to_png (since it works with image-surface create_with_masks fix)
2006-01-03 09:23:48 +00:00
Vladimir Vukicevic
bd265e008b Clean up output some; show only images that fail, otherwise just show pass/fail squares. 2006-01-03 07:29:57 +00:00
Michael Emmel
23e5e55841 New directfb backend for cairo includes test suite and example to run the test is in the comment at the top of cairo-test-directfb.c enable with
--enable-directfb
2005-12-29 07:17:01 +00:00
Christian Biesinger
78d892d70e Add BeOS-specific reference images for tests where the maximum color difference is 1. 2005-12-27 09:47:58 +00:00
Christian Biesinger
4fe93bcf92 Don't require that the caller locks the view; do it in cairo code.
Remove the now-unneeded locking
2005-12-26 16:44:41 +00:00
Carl Worth
e71e2fc4f1 Add a private cairo_paginated_surface_t which builds on top of the meta surface and is intended to provide an easy interface with common functionality for the various paginated surface types (ps, pdf, etc.).
Add test_paginated_surface_t which is another test surface enabled with --enable-test-surfaces. The test_meta_surface code served as the basis for cairo_paginated_surface_t so that test surface may be entirely superfluous now.
2005-12-21 16:46:44 +00:00
Carl Worth
5280c09b7d Fix indentation. 2005-12-21 12:08:57 +00:00
Carl Worth
75b2fe93f0 Use _cairo_surface_paint rather than _cairo_surface_fill_rectangle as only the former is guaranteed to work with all backends.
Refine the comment describing this test surface.
Add new test surface for exercising cairo_meta_surface.
Simplify the image and test_fallback targets by not using create_for_data. Allow for NULL cleanup target functions. Add support for the test_meta_surface.
2005-12-19 22:01:39 +00:00
Emmanuel Pacaud
ffe10b7c87 Shhhh... 2005-12-19 14:18:06 +00:00
Emmanuel Pacaud
ec574cd6f0 CAIRO_CAN_TEST_SVG_SURFACE depends on librsvg.
cairo_svg_surface_t owns a xml node, for support of svg_surface_composite. (_cairo_svg_surface_create_for_document): init xml_node. All surfaces except first one are stored in defs node. (emit_composite_image_pattern): returns pattern size, and don't call emit_transform if is_pattern == TRUE. (emit_composite_svg_pattern): do something. (emit_composite_pattern): returns pattern size. (_cairo_svg_surface_composite): xml_node is stored in cairo_svg_surface_t now. (emit_surface_pattern): emit surface pattern width here. Fix property names. (_cairo_svg_path_close_path): don't close path if no current point. (_cairo_svg_surface_fill_rectangles): new. (_cairo_svg_surface_fill): emit fill rule. xml_node is in surface now. (_cairo_svg_surface_composite_trapezoids): xml_node is in surface now. (_cairo_svg_surface_stroke): ditto. (_cairo_svg_surface_intersect_clip_path): ditto. Emit fill rule.
ignore svg2png.
build svg2png utility.
test SVG backend if CAIRO_HAS_SVG_SURFACE && CAIRO_CAN_TEST_SVG_SURFACE.
new.
2005-12-19 13:59:34 +00:00
Christian Biesinger
6142bc5348 Mention new --enable-svg option
Add notes for the new BeOS backend
Add disabled by default BeOS backend
Add BeOS files
New
New
BEOS_SURFACE_FEATURE
BeOS mutex functions
Ignore files generates by the BeOS tests
Add cairo-test-beos.*
New.
Test BeOS backend.
2005-12-18 17:20:06 +00:00
Carl Worth
c75232f8ab Add a new option --enable-test-surfaces.
New surface backend for testing only. It has as many NULL backend entries as possible.
Add support to test the new test_fallback backend.
2005-12-16 11:31:10 +00:00
Christian Biesinger
6ba7772138 Globally rename "operator" to "op", to allow writing backends in C++
reviewed by: cworth
2005-12-16 03:02:35 +00:00
Stuart Parmenter
88615148ca #define access _access and #define F_OK to 0 on for MSVC
add CAIRO_BEGIN_DECLS and CAIRO_END_DECLS
2005-12-14 19:56:09 +00:00
Carl Worth
77540a2dfa Add preliminary support for --enable-gcov. Thanks to Pierre-Alain Joye (with inspiration from the PHP gcov support by Jani Taskinen and Ilia Alshanetsky).
Ignore *.gcda and *.gcno gcov data files.
2005-12-14 16:22:06 +00:00