Commit graph

5043 commits

Author SHA1 Message Date
Carl Worth
c19133eb9a Revert "[test] Repeat tests using cairo_push_group()."
This reverts commit 07122e64fa.

The extra testing did find a pdf bug, and that should be fixed,
but the extra maintenance burden of running another iteration
of all tests does not seem justfied at all---particularly since
it looks like dozens of new reference images would be needed
for the svg backend.

Also, the new "failures" of the image backend with this new
testing look like a misunderstanding of exactly what the new
testing is actually drawing.
2008-04-08 01:34:37 -07:00
Carl Worth
c1f7655f2f Check surface->status and finished in cairo_surface_write_to_png
Without these checks, a user could hit an assertion failure
by passing a finished surface to cairo_surface_write_to_png.
Now we return a nice CAIRO_STATUS_SURFACE_FINISHED error in
that case instead.
2008-04-08 00:41:09 -07:00
Chris Wilson
33c54ed240 [test] Add large-source to exercise handling of massive images.
This test exercises https://bugzilla.mozilla.org/show_bug.cgi?id=424333.

The test is expected to fail due to issues with pixman, but cairo
should fail gracefully and neither crash nor cause XErrors.
2008-04-08 07:52:47 +01:00
Chris Wilson
4924d4d928 [cairo-xlib] Do not create surface with mismatching Visual and PictFormat.
As identified by Vladimir Vukicevic,
_cairo_xlib_surface_create_similar_with_format() was erroneously passing
down the source Visual when creating a surface with a different
XRenderPictFormat.
2008-04-08 07:52:47 +01:00
Chris Wilson
9aac5916bc [test/xlib-surface] Check for mismatching Visuals and XRenderPictFormats
Vladimir Vukicevic reported that surfaces were being created with
mismatching Visuals and XRenderPictFormats - and demonstated here.
2008-04-08 07:52:47 +01:00
Chris Wilson
f6afba8f54 [cairo-xlib] Create Pixmap using depth from xrender_format.
Use the depth as specified by the xrender_format when creating the
pixmap (as opposed to a guess based on the cairo_format_t).
2008-04-08 07:52:47 +01:00
Chris Wilson
922fefdde4 [cairo-xlib] Handle missing RENDER during similar surface creation
If the xserver doesn't support the RENDER extension or simply doesn't
have the matching PictFormat then xrender_format might be NULL. Check
and fallback in this case.
2008-04-08 07:52:46 +01:00
Chris Wilson
07122e64fa [test] Repeat tests using cairo_push_group().
Test surfaces using similar surfaces with both CONTENT_COLOR and
CONTENT_COLOR_ALPHA, if applicable. This seems justified by the apparent
bugs in the pdf backend when going from an ARGB32 similar surface to
a destination RGB24 surface as well as isolated bugs in the image
backend.

The original goal was to try and trick the test suite into producing
a xlib surface with mismatching Visual/XRenderPictFormat. This succeeds,
although with a little bit of brute force in the xlib backend, but the
search to reproduce a BadMatch error fruitless.
2008-04-08 07:52:46 +01:00
Chris Wilson
e04e426238 [test/get-xrender-format] Free static data on exit.
Free the internal caches so that valgrind reports zero leaks.
2008-04-08 07:52:46 +01:00
Chris Wilson
e57ef66fab [test/xlib-surface] Zero pixel buffers before use.
As we only use RGB24 surface data the alpha channel is undefined, so
zero it to prevent valgrind warnings.
2008-04-08 07:52:46 +01:00
Chris Wilson
d0672e85ef [test/surface-source] Skip tests if we cannot create the source surface.
Check that the test environment supports the desired source and avoid
triggering asserts in the test routines.
2008-04-08 07:52:46 +01:00
Chris Wilson
056d3c853e [test/stroke-image] Fix memleak.
Release the temporary image surface after setting it as the source.
2008-04-08 07:52:46 +01:00
Carl Worth
e460e586d7 Update several pdf-specific reference images
I don't know if we made minor changes to the pdf backend, or
if this was due to a poppler change, (we recently bumped the
poppler required for testing up to 0.8.0), but any way around
it these test results look just as good as the reference images
they are replacing.
2008-04-07 22:02:44 -07:00
Carl Worth
fdcd144584 Add filter-bilinear-extents to the XFAIL list
This test case does show a bug, and we have lots of ideas on how
to fix the bug, but we want to wait until after the 1.6 release
before we fix it. See:

	http://bugs.freedesktop.org/show_bug.cgi?id=15349
2008-04-07 16:09:08 -07:00
Carl Worth
36246c51ba Revert "_cairo_pattern_get_extents: Fix to allow for expansion based on filter"
This reverts commit 731e121c80.

This commit introduced various problems, (some likely noticeable
in the test suite, and others perhaps not). For some details, see
the latest comments in the original bug report leading to the
fix now being reverted:

	http://bugs.freedesktop.org/show_bug.cgi?id=15349
2008-04-07 16:09:06 -07:00
Carl Worth
c88adb6aee Add svg-specific reference images for smask and smask-mask
The most recent change for the mask_id allocation fixes these
two test, (it fixes mask-image-mask as well, but it didn't need
a new reference image).
2008-04-07 16:09:03 -07:00
Carl Worth
164e9c195c SVG: Fix generation of mask_id identifiers
In tests such as smask-mask (and others) the cairo_mask operation
is used in the construction of a mask. In this case, the single
document->mask_id value was being incremented at inappropriate
times.

We fix this by adding a new _cairo_svg_document_allocate_mask_id
that returns the current value and increments it. That way,
callers can hold onto this reliable value for the desired lifetime
that the code needs the identifier.
2008-04-07 15:56:26 -07:00
Carl Worth
8aa306ec08 Add svg-specific reference images for smask-fill, smask-paint, and smask-text tests 2008-04-07 15:56:26 -07:00
Carl Worth
3d86023281 Add ps-specific reference images for smask and smask-text tests 2008-04-07 15:56:26 -07:00
Carl Worth
f2a94c84a1 Add underscore prefix to private _cairo_pdf_surface_set_size_internal 2008-04-07 13:03:58 -07:00
Adrian Johnson
3d22902fa3 Add PDF ref images for the smask tests
These tests render correctly in acroread 8.1.
2008-04-06 20:38:41 +09:30
Adrian Johnson
688fbc24c3 PDF: Add a function for changing the surface size
The smask-fill test was failing for PDF output because in some places
where the surface size is changed (eg when emitting patterns or
smasks) the cairo_to_pdf matrix was not updated.

Fix this by adding a function to handle the surface size change and
replace all the duplicated code for changing surface size with a call
to this function.
2008-04-06 20:24:40 +09:30
Carl Worth
6e5e852f73 Increment cairo version to 1.5.19 after the 1.5.18 snapshot 2008-04-06 03:25:58 -07:00
Carl Worth
6d6c8aa643 Increment cairo version to 1.5.18 and library versioning to 19:1:17 2008-04-06 03:11:04 -07:00
Carl Worth
44cd51ada6 NEWS: Add notes for 1.5.18 snapshot 2008-04-06 03:10:07 -07:00
Carl Worth
3f5ce00e99 Add missing parens() to function name in gtk-doc comment 2008-04-06 03:09:45 -07:00
Carl Worth
c08e2ba974 Document default opaque black source pattern. 2008-04-06 02:56:19 -07:00
Carl Worth
e07e1b7bbb Document many more defaults
Including: fallback_resolution, fill_rule, line_cap, line_join,
miter_limit, font_face, font_size, and operator.
2008-04-06 02:47:32 -07:00
Carl Worth
a55669c325 Document toy nature of cairo_select_font_face 2008-04-06 02:17:33 -07:00
Carl Worth
d1fe008440 Document default extend modes 2008-04-06 02:17:09 -07:00
Carl Worth
abe6f9541e Document EXTEND_REFLECT and EXTEND_PAD as implemented for surfaces since 1.6 2008-04-06 02:01:04 -07:00
Carl Worth
657b348e01 README: Update dependencies 2008-04-06 01:57:45 -07:00
Carl Worth
c642a40195 Revert "[README] Remove the Dependencies section as it falls out of date easily"
This reverts commit 5f38e215ed.

It's true that the dependencies can fall out of date, but it's really
unkind to not provide users with this information. I think we can
compromise by committing to update this information before major
releases.
2008-04-06 01:14:14 -07:00
Carl Worth
b61d1b01e9 Change default filter from BEST to GOOD
Right now the two filters are implemented identically, so there's
no real change for now. But in the future, it's conceivable that an
X server could implement some crazy, high-quality filter for BEST
without regard to performance, (since that's what BEST means).

Meanwhile, GOOD actually captures what we want by default which is
a good mix of both quality and performance.
2008-04-06 01:07:32 -07:00
Carl Worth
14b056945c Update smask-text reference image
It appears the reference image wasn't generated on a gold-standard
machine, (and yes, the gold standard is, *ahem* whatever happens
to match what Carl's machine does---eventually we'll make the test-
based tests less picky about system configuration like this).
2008-04-06 00:34:59 -07:00
Chris Wilson
3a89bf4a1d [test] Remove some redundant evals from the summary.
In a couple of places we used eval to execute a simple assignment -
complete overkill.
2008-04-05 22:06:34 +01:00
Chris Wilson
fc0a2988cd [test] Disable jobserver with make check.
make -j check has the unfortunate side-effect of performing the summary
before the TESTS have completed, both hiding in the stream of test
output and making it useless. Forcibly disable the jobserver so that the
summary is always last at the expense of not compiling the tests in parallel.
2008-04-05 22:06:34 +01:00
Adrian Johnson
ae6fbe9e6e scaled-font-subsets: Special case .notdef in a new subset
If the .notdef glyph is the first glyph in the subset to be mapped in
scaled font, we do not know if the subset will scaled or unscaled. We
can put it in the unscaled subset as Type1-fallback will embded an
empty glyph if it can not get the path.
2008-04-06 01:08:31 +10:30
Adrian Johnson
0d5902b716 Type1-fallback: Use correct glyph metrics for .notdef glyph
Bug 15348 references the following PDF that was printing incorrectly
when running through poppler and cairo to generate PostScript.

http://launchpadlibrarian.net/12921700/UbuntuDesktop.pdf

The PostScript output had too much space between each word causing
strings of glyphs printed with the TJ operator to overlap.

The original PDF file contains an CFF font with CID Identity-H
encoding. The PDF file is using character code 0 (glyph 0 due to
Identity-H encoding) as a space character. The CFF specification
defines glyph 0 to be the .notdef glyph.

The PS backend subsets CFF fonts as a Type1-fallback
font. Type1-fallback creates it's own empty .notdef glyph with an
arbitrary glyph advance of 500. The problem here is the TJ operator
used to output the glyphs depends on the glyph advance being
correct. pdf-operators.c uses the glyph advance returned by
_scaled_glyph_init(). However the PostScript interpreter sees the
glyph advance of 500 for .notdef. This problem does not occur when
generating PDF as the PDF font dictionary contains an list of glyph
advances that override the font metrics.

Fix this by making Type1-fallback not treat .notdef as special and to
create it the path and metrics obtained from _scaled_glyph_init(). As
a special case, make it not fail if _scaled_glyph_init() is unable to
return a path for .notdef. This was probably the reason Type1-fallback
previously created it's own .notdef glyph as calling
_scaled_glyph_init(_GLYPH_INFO_PATH) for glyph 0 returns
CAIRO_INT_STATUS_UNSUPPORTED for some fonts.

This ensures the Type1-fallback font metrics match the metrics used
by pdf-operators.c to position the glyphs. This also results in the
removal of some duplicated code.
2008-04-06 00:36:02 +10:30
Adrian Johnson
03d2b098ff Type1-fallback: Use correct glyph advance in Type 1 charstrings
5050c55f93 fixed type1-fallback to use the glyph advance instead of
glyph width in the stored glyph metrics in the font. However it did
not fix the same bug in Type 2 charstrings (used by CFF fallback in
PDF). This problem was not noticed since the glyph widths in the PDF
font dictionary overrides these values.

Fix this in case any software reading cairo PDFs uses these values.
2008-04-06 00:36:02 +10:30
Adrian Johnson
40cee8c578 Add assert to scaled_glyph_lookup in scaled-font-subsets
If _cairo_scaled_glyph_lookup() returns CAIRO_INT_STATUS_UNSUPPORTED
it will be caught by the ASSERT_NOT_REACHED in
_emit_unscaled_font_subset in PS/PDF. It is more useful to catch this
closer to the source.
2008-04-06 00:36:02 +10:30
Chris Wilson
93536bf3ac [test] Summarise failures per backend.
Enhance the test failure summary to list the tests that failed per
backend.
2008-04-05 09:31:22 +01:00
Carl Worth
731e121c80 _cairo_pattern_get_extents: Fix to allow for expansion based on filter
This fixes the filter-bilinear-extents test case and the
related bug entry:

	bad clipping with EXTEND_NONE
	http://bugs.freedesktop.org/show_bug.cgi?id=15349

Though there are still differences in the PDF and PostScript
backends, (primarily because we can't capture cairo's filter
modes in those file formats).
2008-04-04 19:00:28 -07:00
Carl Worth
04608952e2 Replace open-coded transformation with a call to _cairo_matrix_transform_bounding_box
It's a wonderful feeiling to remove duplicate code.
2008-04-04 18:56:38 -07:00
Carl Worth
89567f9278 Add new filter-bilinear-extents test
This test exercises code that computes the extents of a surface
pattern with CAIRO_FILTER_BILINEAR, (where the filtering
effectively increases the extents of the pattern).

The original bug was reported by Owen Taylor here:

    bad clipping with EXTEND_NONE
    http://bugs.freedesktop.org/show_bug.cgi?id=15349
2008-04-04 18:28:23 -07:00
Carl Worth
80f7aa03b3 Enable buggy_repeat workaround for X.Org servers < 1.4
This covers the known-to-broken 1.3 servers such as appeared
in Fedora 8. It also leaves the workaround off, (since it's
a severe slowdown), for the known-to-be-working 1.4.99.901
server as appears in Fedora 9 Betas.
2008-04-04 11:30:16 -07:00
Chris Wilson
2c8ead12a6 [xlib] Avoiding sending glyphs > XMaxRequestSize.
XRenderAddGlyph() does not split its image data across multiple requests
and so the glyph surface must be smaller than XMaxRequestSize or else
the server will disconnect the client, causing "Fatal IO error 104".
As this will require an extension to the XRender spec, we can work
around the issue by using our fallbacks if we detect that the glyph will
be too large for a single request.

See bugs https://bugs.freedesktop.org/show_bug.cgi?id=4339 and
http://bugs.freedesktop.org/show_bug.cgi?id=13266 for examples.
2008-04-04 18:08:25 +01:00
Chris Wilson
a4f94624b2 [test] Add bilevel image test case.
Add a simple test to exercise the embedding of an image with a bilevel
alpha channel into a postscript level 3 document.
2008-04-04 15:56:22 +01:00
Chris Wilson
f72799a252 [configure.in] Add a link to the LTP homepage.
If ./configure --enable-gcov fails due to a missing LTP package, then
include a link to LTP homepage in the error message.
2008-04-04 14:22:18 +01:00
Chris Wilson
c0593d16c7 [pdf] Copy the glyphs for use within an smask group.
When constructing an smask group using PDF_SHOW_GLYPHS, we need a copy
of the glyphs else they'll be freed be we use them (in _show_page()).
2008-04-04 13:40:46 +01:00