Commit graph

1900 commits

Author SHA1 Message Date
Chris Wilson
595414bb78 [test/fallback-resolution] Extend to cover separate ppi x/y.
Adrian Johnson proposed a hack that fixed the current test by simply
scaling the dashed stroke by device_transform.xx. Obviously this exposes a
deficiency in the test case. So add an outer loop to iterate over several
common ppi for both x and y and in doing so reveal more ugly artifacts in
the current fallback code.
2008-10-14 14:24:49 +01:00
Chris Wilson
9886cb3353 [pattern] Only perform non-integer optimization for identity matrices.
A complication I realised after pushing 3eb4bc3 was handling larger
sampled areas.  Extending the test case revealed that the optimization
was broken for anything but the identity transform (after removing the
translation).  Correctness first, leaving the "pixel-exact" solution for
interested reader...
2008-10-14 10:27:21 +01:00
Chris Wilson
3eb4bc3757 [pattern] Optimize away fractional translation for NEAREST patterns.
As identified in bug 15479,
  Unpredictable performance of cairo-xlib with non-integer translations of a
  source surface pattern
  (https://bugs.freedesktop.org/show_bug.cgi?id=15479),
source surfaces with a fractional translation hit slow paths for some
drivers, causing seemingly random performance variations. As a work-around
Owen Taylor proposed that cairo could convert non-integer translations on
NEAREST sources patterns to their integer equivalents.

The messy detail involved here is replicating the rounding mode used by
pixman for the sample offset, but otherwise the conversion is fairly
trivial.
2008-10-13 23:34:51 +01:00
Chris Wilson
1d3453eee5 [pattern] Rescale the linear pattern matrix to avoid overflow.
As proof-of-principle, compute a scale factor to avoid overflow when
converting a linear pattern to pixman_fixed_t. Fixes test/huge-pattern,
but the principle should be extended to handle more cases of overflow.
2008-10-12 11:38:42 +01:00
Chris Wilson
6736faba3e [test/any2ppm] Do not attempt to compile PS without spectre
Since CAN_TEST_PS_SURFACE does not currently require spectre, we were
attempting to compile in spectre support for any2ppm even on systems
without libspectre installed. Fix that by adding a separate flag for
CAIRO_HAS_SPECTRE.
2008-10-11 19:01:43 +01:00
Benjamin Otte
b358711162 [test] Add huge pattern.
Add a test case to exercise range overflow during gradient construction.
2008-10-11 18:12:29 +01:00
Chris Wilson
7707027081 [test] Use _POSIX_C_SOURCE for flockfile.
From bug 18010 (https://bugs.freedesktop.org/show_bug.cgi?id=18010),
in order to make flockfile() available we need to set _POSIX_C_SOURCE and
according to the man page, the appropriate feature check is
_POSIX_THREAD_SAFE_FUNCTIONS.
2008-10-11 18:12:28 +01:00
Carlos Garcia Campos
8ac8e8c523 [test] Add ps2png check program using libspectre
Add a simple program to compliment pdf2png and svg2png.
2008-10-09 12:25:08 +01:00
Carlos Garcia Campos
3e6afb353d [test/any2ppm] Enable PS conversion using libspectre.
Complete the vector trilogy using libspectre to provide a similar
interface (to poppler and librsvg) around GhostScript.
2008-10-09 12:25:08 +01:00
Benjamin Otte
c647c0bbca [TEST] make imagediff work again
It seems to have bitrotten
2008-10-09 13:22:01 +02:00
Chris Wilson
96b083d3f0 [test] Exercise degenerate dashes.
Add a test case to capture the current behaviour when a segment ends on
an off/on dash transition.

Originally filed as bug:
  Miter artifacts for dashed strokes
  https://bugs.freedesktop.org/show_bug.cgi?id=17973
2008-10-08 19:04:42 +01:00
Chris Wilson
565c02a37e [svg] Use finer-grained fallbacks for SVG 1.2
The use of fine-grained fallbacks requires the native support of the
SOURCE operator applied to an image on the target surface. SVG 1.2
introduces the "comp-op:src" mode fulfilling this criteria - so we can
enable fine-grained fallbacks for 1.2+.

Update test/fine-grained-fallbacks to exercise this pathway in SVG 1.2 -
as SVG natively supported all the current operations within that test.
This reveals yet another librsvg bug in handling SVG 1.2.
2008-10-08 12:43:35 +01:00
Chris Wilson
308485a3fc [test] Add a test for a reported regression by Michael Natterer.
mitch reported on irc that expose events in the gimp were suffering from
artifacts which he tracked down to a bug with clipping and source
surfaces. This is the cairo test case for that regression.
2008-10-07 20:23:12 +01:00
Chris Wilson
8cf399b944 [test] Add a test to exercise the internal twin font
Although Behdad promises that the rendering is subject to improvement,
introduce a test to check consistency across platforms and update as
required.
2008-10-07 01:45:46 +01:00
Chris Wilson
4aa0991a11 [test] Mark fallback-resolution as XFAIL.
There appears to be no simple solution here, as it seems to be a
fundamental flaw in the design of the meta-surface wrt to replaying into
a fallback image. (I may be wrong, but if Carl found no easy solution then
I feel no shame for my own failure ;-)
2008-10-06 12:02:29 +01:00
Chris Wilson
02a56a4c84 [test/show-glyphs-many] Exercise xlib boundary conditions.
Within _cairo_xlib_surface_emit_glyphs() there are a number of
complications to do with packing as many glyphs as possible into a
single XRenderCompositeGlyph*() call. Essentially these consist of
choosing the right function and packing for the current glyphs, describing
runs of glyphs and ensuring that we do not exceed the maximum request size
within a single call. So we add to the test case we an attempt to show 64k
2-byte glyphs and an attempt to mix 64k 1-byte and 2-byte glyphs, with the
change-over point chosen to overflow the maximum request size, should
_cairo_xlib_surface_emit_glyphs() naively resize the current request.
2008-09-30 15:29:23 +01:00
Chris Wilson
2a347a92b0 [test/show-glyphs-many] Re-enable test to trigger crash in xlib.
Moral of this story is bugs cluster. If we made a mistake, especially in a
complicated bit of code that is interfacing with another library, then we
are likely to make a similar mistake in future. Disabling this test hid a
regression between 1.4 and 1.6.
2008-09-30 15:28:48 +01:00
Chris Wilson
d9f50d7841 [test/filter-nearest-offset] Remove XFAIL status
I swear that when I said that it was a rounding error, I was looking at an
image where the squares were overlapping the lines and had a listing of
all the coordinates used. However, the current output on all the machines
I have to hand is correct so I believe the underlying bug to be fixed.

Update the reference images for the external renderers because (a) GS
exhibits the same bug cairo had and (b) librvsg/PDF do not use NEAREST
when applying surface patterns, so the squares are blurred as a result.
2008-09-30 11:13:21 +01:00
Chris Wilson
7d5e6a18d5 [test/filter-nearest-offset] Paint a grey background
Avoid requiring (an absent!) rgb24 ref image by using an opaque grey
background. Confirm the reference image is identical to the old one
(modulo the background change) using GIMP.
2008-09-30 11:11:51 +01:00
Chris Wilson
41c66a9dfa [test/xlib-surface-source] Fix ill-timed XCloseDisplay
Sigh - finding a crasher in xlib seemed too good to be true. And it was.
The bug is due to the coupling of the XCloseDisplay with the user_data on
the source surface.

This was an externally trigger XCloseDisplay whilst the user had live
surfaces, so I consider this a gross application bug and therefore does
not require graceful handling within cairo-xlib. However, I'm willing to
listen to reason...
2008-09-29 15:33:09 +01:00
Chris Wilson
c23dbc4c61 [test/surface-source] Modify to trigger a crash.
Whilst investigating:
  Bug 7360 painting huge surfaces fails
  https://bugs.freedesktop.org/show_bug.cgi?id=7360
I found a particular combination of operations that cause a crash within
xlib, so I'm committing the test for posterity.
2008-09-29 13:54:12 +01:00
Chris Wilson
3b33d49d37 [test/filter-bilinear-extents] Remove XFAIL.
With the reintroduction of Carl Worth's and Owen Taylor's work to expand
pattern extents as necessary to include extra samples due to the filter
radius, we expect filter-bilinear-extents to PASS. This patch series is
important as it factors out our assumptions about filter radius into a
single function and cleans up the code in its wake.

However, since the external PS/PDF renderers do not necessarily use the same
filter as cairo (and currently they only use NEAREST due to lack of
/Interpolate emission in those backends) we can expect differences in test
output. So add the respective reference images to capture current
expectations and to highlight future changes.

Fixes bugs:
  Bug 15349 - bad clipping with EXTEND_NONE
  [https://bugs.freedesktop.org/show_bug.cgi?id=15349],
  Bug 15367 -Improve filtering handling in cairo-pattern.c
  [https://bugs.freedesktop.org/show_bug.cgi?id=15367]
2008-09-29 09:46:50 +01:00
Carl Worth
7d7057cf88 _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-09-29 09:46:49 +01:00
Chris Wilson
117f643e49 [test/filter-bilinear-extents] Extend testing.
First, explicitly set the filter mode to BILINEAR in case the default should
ever change. And then draw a second pattern with extents that in theory
are larger than the source surface in order to test handling of acquiring
out-of-bounds extents.
2008-09-29 09:46:09 +01:00
Chris Wilson
4f449107af [test/fallback-resolution] Exercise a couple of outstanding bugs.
Use dashes to exercise bugs:
  https://bugs.freedesktop.org/show_bug.cgi?id=9189
  https://bugs.freedesktop.org/show_bug.cgi?id=17223
Note bug 17223 indicates that this is still relevant for win32 printing
where fallbacks are used if the dash offset is non-zero.

And use a pattern to exercise the (fixed) regression:
  https://bugs.launchpad.net/inkscape/+bug/234546
2008-09-28 21:05:36 +01:00
Chris Wilson
9841d9d58e Automate error checking for fallback-resolution.
For this we extend the boilerplate get_image() routines to extract a
single page out of a paginated document and then proceed to manually
check each page of the fallback-resolution test.

(Well that's the theory, in practice SVG doesn't support multiple pages
and so we just generate a new surface for each resolution. But the
infrastructure is in place so that we can automate other tests,
e.g. test/multi-pages.)
2008-09-28 14:57:12 +01:00
Chris Wilson
cca1fc6358 [test] Fix target specific tests for recent SVG/PS version split.
A few tests explicitly checked whether the "ps" or "svg" target was
enabled and this broke because of the name change. So fixup, to run
the generic test if either PS or SVG target is enabled as appropriate.
2008-09-27 21:53:21 +01:00
Chris Wilson
39e4a0bcd0 [test] Update list of REFERENCE_IMAGES
A few typos, deletions and additions from the inclusion of versioned
SVG/PS testing.
2008-09-27 19:33:51 +01:00
Chris Wilson
260362e572 [cairo-test] Fix cairo_test_file_is_older().
It did not even compile, so no longer it wasn't deleting cached results
if you updated the reference images.
2008-09-27 19:16:34 +01:00
Chris Wilson
ffbb67303c [test/gradient-constant-alpha] Remove ps2 reference images.
PostScript level 2 has no support for gradients and so should uses image
fallbacks and hence do not require the GS specific reference images.
2008-09-27 18:54:45 +01:00
Chris Wilson
4fa9f8c060 [test/large-source] Remove stale comment.
Delete a reference to an old limitation of pixman.
2008-09-27 17:42:06 +01:00
Chris Wilson
35f1e2fa4f [test/operator*] Remove XFAIL descriptions.
The tests should now pass, so remove the line claiming that they fail
for unknown reasons.
2008-09-27 17:37:32 +01:00
Chris Wilson
95c3c06932 [surface] Only return early for no traps if the operator is bounded by a mask.
If the operator is unbounded, then its area of effect extends beyond
the definition of the mask by the trapezoids and so we must always perform
the image composition.

Fixes test/operator*.
2008-09-27 17:17:58 +01:00
Adrian Johnson
1e45da48b5 Update ref images in Makefile.am 2008-09-27 14:38:22 +09:30
Adrian Johnson
c0535e8e33 Remove miter-precision from XFAIL
The miter-precision PS output prints correctly on my LaserJet 4050. So
file a Ghostscript bug, supply PS ref images and remove from XFAIL.
2008-09-27 14:31:50 +09:30
Chris Wilson
5b97ee6525 Allow cloning sub-regions of similar surfaces.
Previously the rule for clone_similar() was that the returned surface
had exactly the same size as the original, but only the contents within
the region of interest needed to be copied. This caused failures for very
large images in the xlib-backend (see test/large-source).

The obvious solution to allow cloning only the region of interest seemed
to be to simply set the device offset on the cloned surface. However, this
fails as a) nothing respects the device offset on the surface at that
layer in the compositing stack and b) possibly returning references to the
original source surface provides further confusion by mixing in another
source of device offset.

The second method was to add extra out parameters so that the
device offset could be returned separately and, for example, mixed into
the pattern matrix. Not as elegant, a couple of extra warts to the
interface, but it works - one less XFAIL...
2008-09-27 02:20:42 +01:00
Chris Wilson
e0f2147107 [boilerplate] Add a PS 2 target.
Ensure that we can generate PS2 output when required by creating a PS
level 2 target and using GhostScript for conformance testing.
2008-09-26 17:26:25 +01:00
Chris Wilson
0c030d3b76 [boilerplate] Add svg-1.2 target.
SVG 1.2 is sufficiently different from 1.1 that it has separate code
paths within cairo-svg-surface and so justifies its own boilerplate
target.
2008-09-26 17:11:51 +01:00
Chris Wilson
f2c484d73c [test/any2ppm] Handle short reads/writes.
No excuse other than simple laziness - it manifested itself with random
"error whilst reading" failures.
2008-09-26 13:42:28 +01:00
Adrian Johnson
907f550a1b Fix bitmap-font XFAIL
Images in PDF are scaled to a unit square. In PS we set the
ImageMatrix to do the same. When the image is painted we scale the
graphics state to paint the image at the right size. In the case of
Type 3 fonts consisting of bitmap images we want to paint the images
at their original size so we scale the graphics state by the image
width and height.

The bug was that we were scaling by the width/height in the glyph
metrics. For non rotated fonts this worked. However for rotated fonts
the width/height of the glyph images may be larger than the
width/height in the glyph metrics. This resulted in a Type 3 font
where the glyph images were scaled slightly smaller than they should
have been.
2008-09-26 20:26:55 +09:30
Carl Worth
9a210ab228 Add missing reference images REFERENCE_IMAGES list.
The standard ritual before being able to release.
2008-09-25 15:57:06 -07:00
Carl Worth
e52f0fe8bd Ignore test/png-test.png
Finally, "git status" is clean after "make distcheck".
2008-09-25 14:16:14 -07:00
Jeff Muizelaar
c62b4c7386 [user-font-rescale] Do proper ref-counting of substitute font
The problem showed up on OS X because the freetype backend reuses font_face_t's
which kept the reference count high enough for long enough to avoid the problem.
2008-09-25 16:57:38 -04:00
Carl Worth
cd540dc22e Update text-antialias-subpixel reference image.
Now that we reverted back to cairo's code for sub-pixel
text rendering, we need to update the reference image
to match it.
2008-09-25 13:37:53 -07:00
Carl Worth
3d32e7110b Note that we're using ghostscript 8.62 now for reference images.
As opposed to 8.61.

I had actually forgotten we had documented this. If I had
remembered I could have put more meaningful messages with
some of my recent updates to ps-specific reference images.
2008-09-25 02:58:01 -07:00
Carl Worth
a172d87b4c Make device-offset-scale an XFAIL test due to SVG failure.
It's sad to have to do this. Back with commit 1a9809baa was the
original fix for device-offset-scale, (right after the test was
added), and it fixed it for all backends, including SVG. The fix
involved combining device_transform and CTM into the pattern matrix.

But then, we added the mask-transformed-image and
mask-transformed-similar tests, and commit 20be3182ef for fixing an
SVG-specific bug with masks. That fix involved subtracting away the
pattern matrix when emitting a mask to adhere to SVG semantics.

Unfortunately, this change also made the device-offset-scale test
start failing. A correct fix would probably subtract away only the CTM
portion and not the devive_transform. However, the
_cairo_svg_surface_mask function sees only a pattern matrix and
doesn't know how to separate it into CTM and device_transform pieces.

So fixing this will probably require a change to the surface-backend
interface. And since we're not willing to do that so close to a major
release, we're adding yet another XFAIL.
2008-09-25 02:49:44 -07:00
Carl Worth
36eef09b58 Update pdf-specific reference images for mask test.
Something had changed to introduce some very minor rasterization
details around the circles.
2008-09-25 02:30:00 -07:00
Carl Worth
503506bf0d Add pdf-specific reference image for mask-transformed-similar
Thanks to help from Chris, we fixed the bug that was making this
test fail with the PDF backend. All that was left was differing
treatment of the edges of the image---easy enough to address
with a pdf-specific reference image.
2008-09-25 02:16:47 -07:00
Carl Worth
aae476807c Update ps-specific reference image for rotate-image-surface-paint
The only difference here is a tie-breaker condition for image-
sampling position. While we care about that when it's under our
control, (pixman rasterization), we don't have precise
requirements for ghostscript's sampling. So we can capture the
current result as a reference.
2008-09-25 00:18:23 -07:00
Carl Worth
a501f8f6d8 Mark degenerate-path and miter-precision as XFAIL.
These two tests currently fail only for the PS backend,
but they've done so since before the last major release.
The final image result we're getting is definitely wrong
in both cases, but we have not yet been able to verify
if this is due to bugs in cairo (generating PostScript)
or in ghostscript (interpreting and rasterzing the
PostScript).
2008-09-25 00:14:13 -07:00