Commit graph

1731 commits

Author SHA1 Message Date
Anders Carlsson
bfd467453c * Fix build
* Add shortcut to cairo-atsui-font.c for the common case.
2006-04-07 17:40:30 +02: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
6d5627ca2a Add a call to _cairo_ps_surface_start_page in _cairo_ps_surface_intersect_clip_path.
If clipping occurs before any drawing, then we still need to issue a start page call.
Otherwise, the clip ends up being inverted since the scaling
transformation that puts PostScript into a cairo-oriented coordinate
system only happens in start_page.
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
Emmanuel Pacaud
5baae7ff21 SVG: Fix typo and stream status handling 2006-04-05 21:24:06 +02:00
Carl Worth
4fd30e6f40 Merge branch 'analysis-surface' into cairo 2006-04-04 15:04:36 -07:00
Carl Worth
a8e5a77ad4 Add attribution for Bdale Garbee to the AUTHORS file. 2006-04-04 15:04:18 -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
45bbdf94cb Break PostScript image data into chunks that each fit into a string.
This solves the problem with the previous commit that made strings
longer than the "standard" 65k implementation limit for strings.
It's achieved by removing the line-wrapping from the base85 stream and
instead adding a new string-array stream between the base85 stream and
the output stream (the string-array stream does the line wrapping and
enforces the 65k characters per string limit).
2006-04-04 12:50:44 -07:00
Carl Worth
d1134cd7e2 Emit images into PostScript output as strings rather than inline.
This is a baby step toward having shared source patterns in the
PostScript output. This patch is based on original work by Keith
Packard in the following commit:

	06b83b89fc

One problem with this approach is that it attempts to put an entire
image into a PostScript string object. However, PostScript strings are
typically limited to 65k bytes. So, as is, this commit causes a few
failures for tests in the suite with large output images.
2006-04-04 11:21:17 -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
dd67cf6616 Implement proper cairo-style error-handling for cairo_output_stream_t.
The cairo_output_stream_t object already had an internal status value,
but it was annoyingly returning status values from various functions.
It also was missing proper shutdown-on-error as well as nil-create
semantics.

This fixes those shortcomings and adjusts all callers for the new
semantics, (leading to simpler and more correct calling
code---particularly in the case of cairo-base85-stream.c).
2006-04-04 10:45:38 -07:00
Carl Worth
5a06133eb2 Implement cairo-base85-stream as a filtering output stream not just a write function.
Now _cairo_output_stream_create accepts a new close callback, (which
the base85 stream uses to write its trailer). This eliminates the
former kludge used to fclose the stdio output streams, and required a
bit of touchup to the pdf, ps, and svg-surface usage of streams.
2006-04-03 23:44:51 -07:00
Carl Worth
57fe9b17b0 Move base85 code out of cairo-output-stream.c into new cairo-base85-stream.c 2006-04-03 15:26:17 -07:00
Christian Biesinger
9bdb4f6ff7 Use more portable shell syntax
Reported by Dave Yeo in
http://lists.freedesktop.org/archives/cairo/2006-April/006600.html

Fixed for the other tests in 0883155111
2006-04-02 15:55:27 +02:00
Vladimir Vukicevic
03eb1b85a9 [win32] Add missing depth-16 format check
(cherry picked from 969d624db8d32d35361bbcc89dbcc354f3d48eaa commit)
2006-04-01 08:56:29 -08:00
Christian Biesinger
6a430478f5 Add an assert for the unsupported image surface formats 2006-03-27 15:46:02 +02:00
Christian Biesinger
8fbd0d448d Implement create_similar for BeOS 2006-03-27 02:57:59 +02:00
Carl Worth
edb83e306b cairo-ps-surface: Simplify operation analysis.
Introduce a new pattern_operation_analyze function which allows a much
simpler idiom to be used by all of the drawing operations. This also
provides new assertions that when we are not analyzing we are never
called to perform an operation that we would analyze as
unsupported.
2006-03-24 12:07:21 -08:00
Carl Worth
29dad9867a cairo-ps-surface: Don't support meta-surfaces. This isn't ready yet. 2006-03-24 11:58:45 -08:00
Carl Worth
7cee03957b cairo-ps-surface: Fix characterization of CLEAR and SOURCE operators.
CLEAR should always be considered a translucent operator, while SOURCE is not
necessarily always opaque.
2006-03-24 11:57:18 -08:00
Carl Worth
498094027e Back out use of meta-surface for similar-paginated-surface. It's not ready yet. 2006-03-24 11:49:48 -08:00
Carl Worth
ecb062a679 Update PDF backend for new paginated API so it at least doesn't crash. 2006-03-24 11:48:35 -08:00
Carl Worth
3259efed76 _cairo_lzw_compress: Remove unused code which we had for testing
conformance with the LZW compression from libtiff.
2006-03-23 15:36:41 -08:00
Carl Worth
bcfe344608 Optimize the implementation of _cairo_lzw_compress.
This switches the implementation of _cairo_lzw_compress from using
cairo-hash.c to a custom implementation of the same algorithm that
takes advantage of the specific details of what is needed here.

This final version now has comparable performance to the libtiff code,
but should hopefully be easier to understand.

Add a bunch of comments explaining how the various pieces work.
2006-03-23 15:27:00 -08:00
Carl Worth
639c2fe4df cairo-lzw: Replace LZW code from libtiff with an original implementation.
This new implementation is an entirely original work directly from the
description of the LZWDecode filter in the PostScript Language
Reference, (and in spite of the bugs in the examples provided in that
reference).

This implementation uses the existing cairo-hash.c for the symbol
table. This implementation is somewhat easier to read than the libtiff
code, and avoids any code that may have an advertising clause
attached. This new implementation is the simplest thing I could
implement. It is not as efficient as the libtiff code, (though I did
expect better things from cairo-hash.c).
2006-03-23 15:23:29 -08:00
Carl Worth
ec60bb0a60 Rename _cairo_compress_lzw to _cairo_lzw_compress and tighten the parameter list. 2006-03-23 15:00:40 -08:00
Carl Worth
cabe94a15c Make all hash/cache keys_equal function accept const pointers. 2006-03-22 23:12:23 -08:00
Emmanuel Pacaud
a193f70b94 SVG: return len in _cairo_svg_document_write when operation succeed. 2006-03-22 11:48:44 +01:00
Christian Biesinger
ef04471b1b More consistent naming for the BeOS surface functions 2006-03-18 18:08:20 +01:00
Christian Biesinger
69acfa6576 Don't link to C++ libraries on non-BeOS systems 2006-03-17 21:26:27 +01:00
Behdad Esfahbod
0623f8a7d1 Merge branch 'master' of git+ssh://git.cairographics.org/git/cairo 2006-03-15 15:25:59 -05:00
Behdad Esfahbod
26b06b3638 Clarify that git tag -s does GPG signing.
(cherry picked from e942518615 commit)
2006-03-15 15:25:10 -05:00
Behdad Esfahbod
f5013b6dc6 Add a release-publish-message target to only get the message.
(cherry picked from 98facc6c2d commit)
2006-03-15 15:25:03 -05:00
Behdad Esfahbod
46e5ed66d3 Note using "git diff" instead of "git status" as the latter is a bit tricky when it says nothing to commit...
(cherry picked from a1621eadb6 commit)
2006-03-15 15:24:45 -05:00
Behdad Esfahbod
f00a183334 Update release infra to reflect git transition.
(cherry picked from 508b0be5f2 commit)
2006-03-15 15:24:35 -05:00
Behdad Esfahbod
037732cac9 Add make bits to autogenerate ChangeLog
(cherry picked from 393000021c commit)
2006-03-15 15:24:18 -05:00
Alexander Larsson
a7f58f8862 Add LZW image compression and ASCII85 encoding for PostScript image output.
* src/Makefile.am:
Add cairo-lzw.c to sources
Remove erronous space at start of line

* src/cairo-lzw.c:
New file implementing _cairo_compress_lzw which does Lempel-Ziv & Welch
compression as used by postscript. Based on code from libtiff.

* src/cairo-output-stream.c:
Add _cairo_output_stream_write_base85_string which implements
an encoder for the ASCII85Decode postscript filter.

* src/cairoint.h:
Add _cairo_compress_lzw and _cairo_output_stream_write_base85_string.

* src/cairo-ps-surface.c:
Write Images LZW + Base85 encoded.
Change ps level to 2 (we only needed level 3 for FlateDecode).
Change DocumentData to Clean7Bit as we don't include binary data
anymore.
2006-03-15 10:47:10 -08:00
Carl Worth
d6f8df7417 Remove annoyinc RCS magic lines that are not being used, but cause conflicts. 2006-03-15 10:47:09 -08:00
Emmanuel Pacaud
2af29f720f SVG: use xmlOutputBuffer for file creation, instead of dumping xml tree in a memory buffer. 2006-03-14 23:02:39 +01:00
Carl Worth
5d89faf6b3 fbCompositeTrans_0888xnx0888: Fix suspicious logical negation of pointer value.
Surely, the ! instead of ~ here was just a typo. I'd feel better if I
had a failing test case for this though, (time to break out gcov
again).

Fixes bug #6185:

	Strange pointer operations in fbCompositeTrans_0888xnx0888 (pixman/src/fbpict.c)
	https://bugs.freedesktop.org/show_bug.cgi?id=6185
2006-03-13 13:20:29 -08:00
Carl Worth
6f0d8eedc5 _clip_and_composite_trapezoids: Avoid NULL pointer dereference due to OOM.
This closes bug #6197:

	Null pointer dereference on OOM in _clip_and_composite_trapezoids()
	https://bugs.freedesktop.org/show_bug.cgi?id=6197
2006-03-13 12:25:25 -08:00
Carl Worth
79075b2cb1 cairo-clip: Fix memory leak during OOM handling.
This closes bug #6196:

	Memory leak in _cairo_clip_intersect_path (src/cairo-clip.c)
	https://bugs.freedesktop.org/show_bug.cgi?id=6196
2006-03-13 12:20:23 -08:00
Carl Worth
fc51a78a1e cairo-pdf-surface: Close memory leak during OOM handling.
This fixes bug #6186:

	Memory leak in emit_image_rgb_data (src/cairo-pdf-surface.c)
	https://bugs.freedesktop.org/show_bug.cgi?id=6186
2006-03-13 12:14:47 -08:00
Carl Worth
25cccaaa1f Merge branch 'cairo-origin' into cairo 2006-03-13 12:05:37 -08:00
Carl Worth
c780f4a562 cairo-output-stream: Don't dereference a NULL pointer due to OOM.
This close bug #6176:

	Null pointer dereference on OOM in _cairo_output_stream_create_for_file()
	https://bugs.freedesktop.org/show_bug.cgi?id=6176
2006-03-13 12:05:13 -08:00
Emmanuel Pacaud
118f71b438 Merge branch 'master' of git+ssh://emmanuel@git.cairographics.org/git/cairo 2006-03-12 19:30:29 +01:00