[With this change, two tests with gradients exhibit subtle differences
under device offsets. I don't think we actually care about them
though. -cworth]
This commit adds the following new functions to the cairo-ps API:
cairo_ps_surface_dsc_comment
cairo_ps_surface_dsc_begin_setup
cairo_ps_surface_dsc_begin_page_setup
Many thanks are due to Michael Sweet who provided invaluble guidance
during the design of this API.
It is hoped that with this API in place, basically all printer control
that is likely to be desired to be performed with cairo PostScript
output is now possible.
This commit augments the ps-features test to exercise the new API.
Add a new cairo_ps_surface_set_size which can be used to produce a
PostScript file consisting of pages of various different sizes (or
orientations).
Also add a new test (ps-features.c) for testing this and subsequent
ps-specific function calls.
In several cases the -rgb24 reference images were identical to the -ref images.
So we change the logic to find the latter if the former doesn't exist, and then
we remove the redundant images.
Add a new cairo_test_paint_checkered function so that tests that draw
with alpha can easily put an easy-to-see checkered background in place
first.
Add new tests caps-joins-alpha and paint-source-alpha that do simple
tests of strokes and image painting with source pattern alpha.
Also, add the checkered background to paint-with-alpha for
consistency.
It only fails because the PDF ouput doesn't preserve the NEAREST filter attribute.
There might be a way to get something like this in the PDF, but it's not the point
of the test.
Some tests were using source surfaces created as ARGB32 even though all
alpha values are entirely opaque. This meant these tests were triggering
more fallbacks than strictly necessary for what the tests are ttrying to
do.
This isn't very exciting text output---it simply turns every call to
cairo_show_glyphs into a single filled path. But at the very least,
text will no longer trigger image fallbacks for the PDF backend.
With this commit, the following tests change from all-fallback to
all-native for the PDF backend:
show-text-current-point
text-antialias-gray
text-antialias-none
text-antialias-subpixel
text-cache-crash
text-rotate
There are rasterization differences in the output (cairo vs. freetype)
so this commit also adds new PDF-specific reference images for some of
those tests so that the suite continues to report PASS.
That helps SVG backend to pass this test, since CAIRO_OPERATOR_CLEAR on a part of a surface use "comp-op" element which is not supported with current librsvg.
Antialias property is not directly supported by SVG, and probably not the most wanted feature. In the future, we could use an image fallback in order to emulate it, or try to use text-rendering, shape-rendering and image-rendering
properties (http://www.w3.org/TR/SVG/painting.html#RenderingProperties).
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).
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.
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.
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.
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).