Commit graph

1725 commits

Author SHA1 Message Date
Carl Worth
687802cca6 Obnoxious churn of gtk-doc templates.
We really need to get these built files out from under version control, (or
else abandon gtk-doc altogether).
2006-04-14 14:44:16 -07:00
Emmanuel Pacaud
d284c2b5a4 SVG: enable SVG backend API documentation in /doc 2006-04-14 23:11:35 +02:00
Emmanuel Pacaud
b9eb4f018e PDF: Fix typo in documentation. 2006-04-14 22:55:48 +02:00
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
Emmanuel Pacaud
f919ba858f SVG: Emulate CLEAR and SOURCE operators on paint call when no clipping region is defined. 2006-04-14 22:06:28 +02:00
Carl Worth
8f3c60096d Add a new cairo_paginated_surface_backend_t rather than just a single function pointer. 2006-04-14 11:33:48 -07:00
Carl Worth
5461f25df9 Fix _composite_trap_region to restore the original clip when done. 2006-04-14 11:05:37 -07: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
Carl Worth
11b4d24671 Move cairo_pdf_surface_backend to file end so it's easier to find. 2006-04-14 09:36:41 -07:00
Jeff Muizelaar
2078557c5c Fix skipping zero length dash segments in dash_start.
The extra check makes sure zero length segments are not skipped when computing
the dash start state. This is needed so that we get proper line capping if, for
example, the first dash segment has zero length and we have a dash offset of
zero.
2006-04-14 01:51:26 -04:00
Jeff Muizelaar
5eaf71e77b Move the test for zero length sub edges below the computation of faces.
Face computation still works if a line has zero length, all that is needed is a
slope and a point. This patch fixes bug #5561 because the faces are initialized
even if the segment has zero length as expected by
_cairo_stroker_line_to_dashed.
2006-04-13 23:41:45 -04:00
Jeff Muizelaar
20fca01a2c Move calculation of slope outside of _cairo_stroker_add_sub_edge.
This makes the slope calculation more accurate for dashed lines by computing it
once for the entire line instead for each individual dash segment. It also
adjusts stroker_line_to() to match the new convention for
stroker_add_sub_edge().
2006-04-13 23:41:26 -04:00
Jeff Muizelaar
8a2ea660fb Check for zero length dashed lines.
This makes line_to_dashed more like line_to by returning immediately on
degenerate paths. This is needed so that we can do the slope calculation for
the entire line.
2006-04-13 23:40:21 -04: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
f17b347ab4 Fix page numbers in PostScript output to start at 1 2006-04-13 07:59:52 -07:00
Carl Worth
6beababd47 Optimize PostScript file size with procedures instead of builtin operators.
This is based on a suggestion by Michael Sweet.
2006-04-12 16:19:08 -07:00
Carl Worth
d60eaab222 Add simple word wrapping to keep PostScript output within 80 columns or less. 2006-04-12 15:48:59 -07:00
Carl Worth
6a5d8fc7ff Merge branch 'ps-type3' into cairo (no bitmap support for type 3 yet).
Conflicts:

	src/cairo-hash.c
	src/cairo-ps-surface.c
2006-04-12 14:15:08 -07:00
Carl Worth
b30e281627 Add documentation for _cairo_output_stream_create_for_file. 2006-04-12 14:06:32 -07:00
Carl Worth
193b43001d Propagate stream status values through _cairo_ps_surface_finish 2006-04-12 14:06:26 -07:00
Carl Worth
d9137e56b6 Use ferror to get error checking for stdio-based output streams. 2006-04-12 13:44:14 -07:00
Carl Worth
32994379db Fix missing argument to printf in _cairo_ps_surface_stat_page 2006-04-12 13:40:05 -07:00
Carl Worth
5444aa55b3 Clean up output_stream error handling in _cairo_ps_surface_create.
We teach the output stream to catch a NULL file error here, which
allows for less checking in ps_surface_create. We also fix the ps
surface code to look for the status of a nil stream rather than
checking for NULL.
2006-04-12 13:39:24 -07:00
Carl Worth
a7abf8e451 Merge 'Save PS output in temp file' from ps-type3 branch 2006-04-12 12:54:28 -07:00
Carl Worth
0386a72895 Add some documentation to string_array_stream 2006-04-12 11:08:18 -07:00
Carl Worth
39592788b3 Print both page label and number in PostScript %%Page headers. 2006-04-12 11:08:18 -07:00
Kristian Høgsberg
523f9e46d8 Make cairo_t and cairo_output_stream_t destructors handle NULL.
All other cairo destructors and reference functions accept and ignore NULL,
so fix up cairo_destroy(), cairo_reference(), and cairo_output_stream_destroy()
to do so too.
2006-04-11 20:49:55 -04:00
Keith Packard
6e77a0e248 Allow hash entry deletion during cairo_hash_foreach
I discovered that _cairo_hash_table_foreach walks over the hash table
without preventing it from being resized as a result of deletions
occuring from the callback.

Kinda nasty when you're trying to free everything from a hash table.

It was also easy to fix; just prevent the table from being resized while
iterating and clean it up after the iteration is completed.
2006-04-11 12:31:57 -07:00
Anders Carlsson
9231ab4043 Merge with git+ssh://git.cairographics.org/git/cairo 2006-04-11 01:09:30 +02:00
Anders Carlsson
1e5f5aed07 Make the API more like Vlad's new API.# 2006-04-11 01:07:33 +02:00
Anders Carlsson
3ed576522d Remove unused function 2006-04-10 22:29:51 +02:00
Anders Carlsson
8ba59b0336 Rework the quartz backend to not always hold an image but instead to create it on demand.# 2006-04-10 22:24:02 +02:00
Anders Carlsson
df3c02c9ca Don't set can_draw_directly to FALSE. 2006-04-10 22:23:39 +02:00
Laxmi Harikumar
baa3436e9d Simple fix for build failure on DEC/OSF1.
Apparently this platform also requires inttypes.h rather than
stdint.h.

This should fix the bug reported here:

        https://bugzilla.mozilla.org/show_bug.cgi?id=331428
2006-04-10 12:04:01 -07: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
Jeff Muizelaar
65e706ee14 Reset dashing for new subpaths.
Fixes the bug mentioned in b87726ee2a by reseting
the dash pattern for each new subpath. This is correct behaviour according to
the end of PDF Reference v1.6 section 4.3.2.

This commit now makes the dash-caps-joins test case pass for all
backends except for the PostScript backend.
2006-04-10 10:57:28 -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
Anders Carlsson
807f64d57c Merge with git+ssh://git.cairographics.org/git/cairo 2006-04-10 19:32:47 +02:00
Anders Carlsson
5ee26e3b0e * Save and restore state when drawing glyphs using the short circuit. 2006-04-10 19:18:36 +02:00
Keith Packard
0727e3c1a9 Use Type3 fonts for PostScript output. No bitmap support yet. 2006-04-09 00:38:43 -07:00
Keith Packard
da2c5e44ab Allow hash entry deletion during cairo_hash_foreach 2006-04-09 00:37:58 -07:00
Keith Packard
ade195cdba Save PS output in temp file so we can prepend global data (like fonts) 2006-04-08 21:29:14 -07:00
Carl Worth
732e06258c Rename write_data to write_func in cairo_output_stream_t. 2006-04-07 15:47:02 -07:00
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