Commit graph

5923 commits

Author SHA1 Message Date
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
Chris Wilson
31ff6c863f [pdf] Explicitly order the sequence of checks when analyzing masks
There is an implicit precedence when analyzing patterns for
compatibilty, in order of descending precedence:
  fatal error
  unsupported
  needs image fallback
  needs meta-surface analysis
  success.

So wehen we have two patterns, we need to check both analysis statuses
simulataneously, in order to correctly report the combined status.
2008-09-25 02:09:44 -07:00
Carl Worth
69635bc054 Fix the analysis of mask operations (fixing mask-transformed-similar test case)
The primary bug here was some missing braces. The code was conditionally
assigning to backend_status, but then unconditionally checking for the
value assigned. The result was the leaking of an internal status value
(CAIRO_INT_STATUS_ANALYZE_META_SURFACE) which finally resulted in
an incomplete PDF file in the mask-transformed-similar test case.

While fixing this, also avoid re-using the backend_status variable so
much so that the code is more readable.
2008-09-25 02:09:40 -07:00
Carl Worth
5599b08dfa Drop _cairo_analysis_surface prefix from some static functions
Since these functions are static we don't really need the full
name. And these two functions were both so long that they were
causing some serious line-wrap issues.
2008-09-25 01:42:03 -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
Carl Worth
e279eeb7dd Make the bitmap-font an XFAIL.
We've had these PDF and PS failures here for a *long* time,
(before the last major release for sure). It's a bug, but
we expect it to be there, so advertise it that way.
2008-09-25 00:08:03 -07:00
Carl Worth
261dd83b31 Eliminate paranoid check for PNG_INTERLACE_NONE.
Commit 20b1b33c0f added some "paranoid checks" to our png
loading code. One of these was checking that if png_get_IHDR
first reports an interlace value other than PNG_INTERLACE_NONE
that after we call png_set_interlace_handling then we do
get PNG_INTERLACE_NONE from the next call to png_get_IHDR.

However, libpng doesn't seem to actually have that behavior.
When testing cairo_image_surface_create_from_png with an
interlanced PNG file, (which the test suite happens not to
do---even now), the call to png_set_interlace_handling is
doing the trick, but the check for PNG_INTERLACE_NONE is
failing.

So, with the check in place, loading an interlaced PNG image
fails with CAIRO_STATUS_READ_ERROR. By simply removing
that check, an interlaced image loads just fine.
2008-09-24 21:55:53 -07:00
Carl Worth
94d2820c6f Update ps-specific reference image for ft-text-vertical-layout-type3
Something, (gs interpreter version?), changed and caused a
very minor rasterization change.
2008-09-24 18:38:21 -07:00
Carl Worth
8a49cfa03a Update all reference images for ft-text-vertical-layout-type1.
This is one of those chronically fragile tests. I'm assuming
some font changed or something, because the glyph positions
shifted (consistently) across all the backend. Doesn't look
like a bug.

We'll really need to do proper bundling of all font data to
avoid issues like this.
2008-09-24 18:34:43 -07:00
Carl Worth
3ae894a9fd Update reference image for smask-text test.
Very minor rasterization differences crept in here
from somewhere. Of course, it would be easier to
identify from *where* if we documented all the versions
of the various external libraries used in creating
reference images. But for now, the versions on the
machine of the person making the release win.
2008-09-24 18:29:00 -07:00
Carl Worth
ab406eeac1 Add svg-specific reference image for user-font-rescale.
The difference here was just edge effects, (the kind of
thing that looks like glyph rasterization differences
but might in fact be due to minor rounding differences
in glyph positions). Either way, there's no problem
with respect to what the test is exercising.
2008-09-24 18:26:56 -07:00
Chris Wilson
453443d77a [test] Write the OUTPUT filename to the log if we match the vector surface.
If the vector surface matches the output from last time, then the
rasterisation is skipped - but we need to write the expected OUTPUT
filename to the log so that the image is referenced from index.html.
2008-09-25 01:11:50 +01:00
Behdad Esfahbod
e84ef3c54e [.gitignore] Remove Makefile.*.config
I renamed those generated files to Makefile.*.features but forgot to
update ignore lists.  Carl already added the new ones, but didn't
remove the old ones.
2008-09-24 20:00:30 -04:00
Carl Worth
62107b8015 Mark several new tests added during 1.7 as XFAIL.
The following tests were added during the 1.7 cycle to
demonstrate bugs:

	alpha-similar operator operator-alpha self-copy-overlap

In all cases, the identical bug existed in the last major
release, (1.6.4), so these are not new regressions, but merely
bugs that we're now aware of. The correct way to handle bugs
such as these is to mark them as expected failures (XFAIL).
2008-09-24 16:51:44 -07:00
Carl Worth
c3750cf218 Remove the device-offset testing (-25 cases) for the release.
The reasoning behind the -25 testing is that we want to ensure
that cairo provides translation invariance. However, for
many vector backends we use external rasterizers that don't
necessarily provide that translation invariance.

So this testing makes a bunch of failures appear that we don't
really care about, (and we don't even have a mechanism to turn
them off with custom reference images). For the release, I'm
just turning this off.

After the release, I plan to turn this back on, and then we could
fix this by ensuring that the vector output itself is unaffected
by a device offset, or by moving away from external rasterizers,
(see Chris's micro-gs work to test PostScript with cairo-based
rasterization).
2008-09-24 16:32:58 -07:00
Carl Worth
ea4d0bafb3 Add svg-specific reference image for mask-transformed-similar.
The only difference in this case is whether there is blurring
of the image around the edges. That's a rasterization issue
that we don't care about, (we're testing that the correct
transformation is applied).
2008-09-24 16:25:38 -07:00
Carl Worth
f939e46304 Add pdf-specific reference images for gradient-constant-alpha.
Like many other gradient tests, we're just capturing the buggy
output of poppler here, (though this time I *did* verify with
Adobe acroread that our PDF output seems to be correct).
2008-09-24 16:21:57 -07:00
Carl Worth
9335ad313f Ignore generated files.
I know that I didn't create these Makefile.win32.features files,
so I assume that they are the result of Behdad's build magic and
that he just forgot to add them to .gitignore.
2008-09-24 16:20:35 -07:00
Carl Worth
06594abc6b Add pdf-specific reference images for fill-alpha-pattern.
These capture the current poppler output, (rather than the
ideal output). We're still waiting for poppler to start
using cairo gradients before this test will run through
cleanly. And even with these new reference images, there's
still some translation variance, so the -25 tests still
fail.
2008-09-24 16:11:10 -07:00
Carl Worth
64541a58ae Add pdf- and ps-specific reference images for device-offset-fractional
We don't care about the specifics of rasterization in the viewer
here, (though it still might be worth being more careful about
how we set /Interpolate---but that's not the point of this test).
2008-09-24 16:11:09 -07:00
Chris Wilson
ba7ef8b40e [configure.ac] Bump poppler dependency to 0.9.2
poppler-0.9.2 is required for replaying user-fonts correctly.
2008-09-24 22:37:08 +01:00
Chris Wilson
dfe9f7093f Revert "[pdf] Tweak the mask analysis to avoid an assertion failure."
This reverts commit c9ec82f3a8, which
notably caused regresions in the mask and clip-operator tests.

Obviously I'm not smart enough to fix bugs. Since the computer found the
assertion failure, I need to train the computer to fix the bugs as well.
2008-09-24 22:37:08 +01:00
Behdad Esfahbod
ab682a6ff2 Add README.win32, courtesy of Damian Frank 2008-09-24 17:23:28 -04:00
Behdad Esfahbod
5a06ca852c [Makefile.win32] Also report installing cairo-version.h and cairo-features.h
Those two files needs special care and hence are not listed in
enabled_cairo_sources.
2008-09-24 17:23:28 -04:00
Behdad Esfahbod
a91101df31 [Makefile.sources] Remove mention of cairo-features-win32.h
That file is not generated anymore.  Instead, cairo-features.h is
generated from Makefile.win32 on the fly.
2008-09-24 17:23:28 -04:00
M Joonas Pihlaja
55e06745a6 [perf-suite] Explicitly read the results of rdtsc from edx:eax.
The =A format used to read a 64 bit result from rdtsc works on x86,
but not on x86-64.
2008-09-25 00:17:57 +03:00
Behdad Esfahbod
2fb59b3ebd [Makefile.win32] Report which files to install
The win32 build system has no way to install anything, but it has
full knowledge of what needs to be installed (which headers).  So
we now report files to be installed at the end of the build.
2008-09-24 17:09:54 -04:00
Behdad Esfahbod
6eee90784e Enable CAIRO_HAS_UTF8_TO_UTF16 if PDF_OPERATORS is enabled
We are being cheap and don't define the cairo_utf8_to_utf16 function
if no one is using it.  Previously PS surface was not using it, but
after the pdf-operators merge, it was.

Before this commit, building with PS but without PDF failed.  Fixing.
2008-09-24 15:04:11 -04:00
Behdad Esfahbod
bb125689d3 Simplify preprocessor conditional syntax
We never do #ifdef-type conditions on CAIRO_HAS_* macros, because we
want to allow setting them to zero.  Then if we need to enable a feature
if either of PS or PDF is enabled, the proper syntax is:

	#if CAIRO_HAS_PS_SURFACE || CAIRO_HAS_PDF_SURFACE

This works because the preprocessor replaces any unknown identifiers with
zero.  Some versions of gcc had a bug that got them very confused with
complex versions of the above.  As a workaround for that I have been using
the uglier version:

	#if CAIRO_HAS_PS_SURFACE+0 || CAIRO_HAS_PDF_SURFACE+0

which magically worked around that bug.  Or more recently replacing that
with the duplicated version:

	#if CAIRO_HAS_PS_SURFACE
	...
	#endif
	#if CAIRO_HAS_PDF_SURFACE
	...
	#endif

Both are uglier than the original.  Since the gcc bug was very short lived
and there's lots of software out there relying on the original form to work,
moving back to the simple version seems harmless.
2008-09-24 15:04:11 -04:00
Chris Wilson
adece69ae3 [test] Add a test case to question the mutability of sources.
Are patterns mutable? The image backend is quite happy to write and read
from the same surface, whereas the vector targets create snapshots... This
test case exploits that inconsistency.

Also the interested reader will note that not only does this demonstrate
translational invariance, but a discrepancy with similar surfaces.
2008-09-24 19:22:22 +01:00
Chris Wilson
88188eabab [test] Memleak in new mask-ctm-* tests.
Add the forgotten cairo_surface_destroy().
2008-09-24 17:32:45 +01:00
Chris Wilson
8f15730368 [test] Rename mask-ctm-* to avoid conflict with mask-ctm.
Using mask-ctm-image as a test name was causing a naming conflict with
mask-ctm, so rename the new tests.
2008-09-24 18:41:24 +01:00
Chris Wilson
444d44acde [stroke] Cap trailing segment when skipping invisible segments.
If we do not maintain the current_face even for invisible dashed segments,
then we will generate spurious line segments when attempting to close the
path (ala leaky-dashed-rectangle).

This fixes the long standing regression introduced just prior to 1.6 and
captured in these bug reports:
http://lists.cairographics.org/archives/cairo/2008-April/013912.html
http://bugs.freedesktop.org/show_bug.cgi?id=17177
2008-09-24 18:41:24 +01:00
Behdad Esfahbod
9fc745ae9f Revert "[build] Use mkdir -p portability macros"
This reverts commit 03c37f56b2.

The AC_PROG_MKDIR_P is also one of those autoconf macros defined
in newer versions only.  Since we use mkdir -p in releasing scripts
only, it's not a big deal if it's not portable.
2008-09-24 13:18:12 -04:00
M Joonas Pihlaja
b5b1134c2c [tessellator] Skip edges that lie outside the region of interest.
We don't need to tessellate edges strictly above or below the
the limits of the traps.
2008-09-24 17:54:53 +01:00
M Joonas Pihlaja
018a64bf7f [traps] Impose limits on traps for cairo_in_(fill|stroke)
We don't need to tessellate edges strictly above or below the
hit-test point.

(Patch split and modified by Chris Wilson to apply to cairo_in_stroke()
as well - all bugs are his alone.)
2008-09-24 17:54:50 +01:00
Chris Wilson
8c0ff8b585 [cairo] Define min-tolerance in terms of cairo_fixed_t
By using the cairo_fixed_t macros we can compute the correct minimum
tolerance for any configuration.
2008-09-24 17:05:08 +01:00
Chris Wilson
c9ec82f3a8 [pdf] Tweak the mask analysis to avoid an assertion failure.
Both the source and mask need to be analyzed and checked for an
UNSUPPORTED operation before determining the best course of action.
As before this is simply decided based on the requirements of the
source.
2008-09-24 15:05:23 +01:00
Chris Wilson
b9c92842d9 [trap] Trivial reject if trapezoid is entirely above or below
Also check whether is vertically within limits.
2008-09-24 11:45:51 +01:00
Chris Wilson
911d5f1a25 [traps] Adjust lines if either point is on the boundary.
If either point lies on the limit and the other outside, adjust the line
to be parallel to the boundary. This adjusts the previous test where both
points needed to be entirely outside.
2008-09-24 11:45:40 +01:00
Chris Wilson
7357e80054 [clip] Limit traps.
Apply prior knowledge to limit the traps during clipping to avoid
generating extra work.
2008-09-24 11:45:26 +01:00
Chris Wilson
c36a242303 [traps] Replace open-coding of box->rectangle->box
Use the utility functions _cairo_box_from_rectangle and
_cairo_box_round_to_rectangle() instead of open-coding. Simultaneously
tweak the whitespace so that all users of traps look similar.
2008-09-24 11:45:13 +01:00
Chris Wilson
49b9a21e0b [test/any2ppm] Handle filenames with multiple-dots.
Use strrchr() to find the extension, as strchr() is fooled too easily.

As spotted by Carlos Garcia Campos.
2008-09-24 02:03:10 +01:00
Chris Wilson
651c6598c9 [traps] Limit extents to imposed constraints.
When reporting the extents of the traps, constrain them to the imposed
limits. This is relied upon in the analysis-surface which sets the
limits on the traps (based on clip/surface extents) and then reports the
extents of the traps as the region of the operation.
2008-09-24 01:02:48 +01:00
Behdad Esfahbod
0baf12f450 [scaled-font] Another typo fix in the comments
Both this and previous one kindly pointed out by Carl.
2008-09-23 19:18:00 -04:00
Behdad Esfahbod
70207aadfd [mutex] Fix typo in comments 2008-09-23 19:11:31 -04:00
Chris Wilson
0a4a6213e2 [fill] Check for the most common rectilinear case first.
Avoid the iterative search for the extreme points by first checking the
most likely arrangement (as produced by cairo_rectangle() under no
transformation).
2008-09-23 23:55:38 +01:00
Chris Wilson
8f51ea4657 [pattern] Beware unsigned wrap-around with pathological surface patterns.
A surface pattern under an extreme transformation could lie entirely in
the negative quadrant. This would trigger the fixup such that it's lower
left corner was clamped to the origin, but the upper right corner was left
unchecked. This could result in the width,height being negative and
wrapping around to large values instead of being clamped to 0.
2008-09-23 23:35:53 +01:00