Ensure the win32-printing surface has the same fixes for meta surface
patterns with more than one level of push/pop group that PS/PDF
received in 060f384310
When the emitted image is not inside a PS procedure we can use the
currentfile operator as the datasource instead of an array of strings.
This avoids having to read to entire image data into printer memory
before the image can be decoded. This improves the performance and
reduces the chance of running out of memory on printers with limited
memory.
To be able to use the currentfile operator we need to combine the
image data and mask data into the one data source. InterleaveType 2
scan line interleaves the image and data.
_ps_surface_fill() can also avoid using PS patterns for EXTEND_NONE
surface patterns. A clip path is set around the fill path then the
surface is painted.
This is the first of four patches intended to fix the bug reported in
http://lists.cairographics.org/archives/cairo/2007-December/012226.html
Previously the PS backend would draw all cairo patterns (except solid
colors) by emitting a PS pattern. As PS does not support non repeating
patterns, the PS backend would set a large repeat step to ensure that
only one copy of the pattern is on the page.
Some printers with limited memory are unable to print large images
inside a pattern. This was probably because when using patterns the
printer tries to keep the uncompressed image in memory so it can tile
the pattern.
When painting surface patterns with the extend mode EXTEND_NONE we do
not need to use PS patterns. The image or meta surface commands can be
emitted directly.
Changes include:
- Replace PS prolog with new prolog that emulates PDF operators
- Remove the [1 0 0 -1 0 height] ctm on each page. PS and PDF surfaces
now both transform all output to PS/PDF coordinates.
- Invert images to match PDF images where (0,0) is top left
- emit_surface_pattern now uses the same transform as PDF
- move the special dash handling into cairo-pdf-operators.c
This code is never used because outline glyphs that go through the
fallback path are always embedded with Type 1 fallback. The only fonts
that are embedded as Type 3 are bitmap fonts.
The PDF emit path orginally had two matrix transforms in the path
struct. One for strokes and one for fill/clip. As only one transform
at a time is ever used this can be simplified.
The deflate stream has bounded (constant) memory overhead, whereas
compress_dup() allocates memory proportional to the uncompressed data.
This replaces compress_dup() usage with a compressed PDF stream for
emitting images, alpha masks and font subsets, and eliminates the
compress_dup() function.
Previously we were passing the root window of the same screen.
Letting the X server know the actual Drawable for which we're
trying to be similar allows the X server to be more efficient.
cairo_has_current_point() can be used to determine whether a current
point is defined. We introduce this new symbol with a boolean return
value to avoid the versioning ambiguity of modifying
cairo_get_current_point(). This way we also don't have to map what
should be a routine operation to an error condition as was previously
proposed.
Make sure that we don't test lines that start or end inside the box,
since our algorithm will find intersections on the wrong ends on the
line, and not count them.
The PS Language Reference requires the PS miter to be >= 1.
The PDF Reference does not specify miter limits however acroread fails
to display pages when the miter is < 1. Older versions of ghostscript
crash when the PDF miter is < 1.
The image/meta-pattern is written once. A PS pattern twice the size of
the cairo pattern is created and the surface drawn four times in a
reflect pattern inside the PS pattern.
This fixes the extend-reflect and extend-reflect-similar PS test
failures.
Store the surface size in each pattern and smask group and use this
size when the pattern/group is emitted. This is required as a pattern
or group may be used from a meta surface with a different size to the
PDF surface. However the pattern or group is emitted after the the meta
surface content has been emitted and the surface size has been
restored to the the page size.
This fixes the following pdf test failures:
extend-reflect-similar
extend-repeat-similar
mask