Commit graph

5895 commits

Author SHA1 Message Date
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
Chris Wilson
3c6d3684e9 [test] Add a test case for create_similar(CONTENT_ALPHA)
Application of a pure-alpha similar source is inconsistently handled
across the backends. The PDF/PS backends allow the rgb channels to bleed
through and the SVG backend mixes in pure white.
2008-09-23 23:35:53 +01:00
Chris Wilson
5e54084126 [test-meta] Use real meta-surface snapshot.
The meta-surface workaround an old bug, which is no longer present in the
tree and open-coded the surface snapshot. However, the workaround itself
was buggy (not respecting the surface content). The lesson to take away
from this is not to add workarounds in test code for bugs in the library!
2008-09-23 23:35:53 +01:00
Behdad Esfahbod
03c37f56b2 [build] Use mkdir -p portability macros 2008-09-23 17:15:07 -04:00
Chris Wilson
ae0511fbbe [pdf] Do not modify the dashes in-place.
As PS has different semantics regarding a zero-length dash, we need to
adjust the dash array before emitting. However, we need to modify a copy
of the dash array since the same array may be used by the meta-surface
when replaying to an image fallback.
2008-09-23 20:08:38 +01:00
Chris Wilson
b7ab1fc791 Return the real error status for set_user_data()
Instead of returning a new NO_MEMORY error, return the status from the
error object.
2008-09-23 20:08:30 +01:00
Adrian Johnson
0204d2f4e2 Replace two boolean args with one enum arg
The use of multiple booleans in a function call can make it easy to
mix up the parameters.
2008-09-23 22:38:55 +09:30
Behdad Esfahbod
5a3f03623c [Makefile.win32] Add comments about where to edit for customization 2008-09-23 04:11:48 -04:00
Behdad Esfahbod
afb32c7f07 [src/Makefile.am.analysis] Fix out-of-tree build 2008-09-23 03:58:17 -04:00
Behdad Esfahbod
fba0211ed6 [Makefile.win32] Add makefile rules to generate cairo-features.h 2008-09-22 23:41:07 -04:00
Behdad Esfahbod
0bedbe78fe [Makefile.win32] Misc cleanup 2008-09-22 22:46:05 -04:00
Behdad Esfahbod
ebb5eb57b7 Generate build/Makefile.win32.features 2008-09-22 22:24:38 -04:00
Behdad Esfahbod
fd5cef50a7 [aclocal] Add support for automake-only or win32-only makefiles 2008-09-22 20:48:14 -04:00
Behdad Esfahbod
42e4103015 [aclocal] Don't do automake conditionals for builtin features 2008-09-22 20:33:23 -04:00
Behdad Esfahbod
79bc967a0d [build] Make including Makefile.win32.features files more robust
By using top_srcdir if available.  Make's include is relative to
current dir, not the Makefile being processed.  That makes it hard
to include Makefile's relatively.
2008-09-22 20:20:02 -04:00
Behdad Esfahbod
e686a00da8 [build] Add CAIRO_CONFIG_MAKEFILE_PRIVATE 2008-09-22 20:11:39 -04:00
Behdad Esfahbod
0ac7a242f8 [build] Add Makefile.win32.common 2008-09-22 20:11:38 -04:00
Behdad Esfahbod
984320dff1 [build] Don't define feature variables in Makefile.win32.features
This is not the right place to do that as one also needs to adjust
cairo-features.h.  Working on a proper fix.
2008-09-22 20:11:32 -04:00
Behdad Esfahbod
eb9ce58059 [build] Don't generate Makefile conditionals for default=always features 2008-09-22 19:23:41 -04:00
Behdad Esfahbod
caa3dbd61b [build] Make Makefile.*.features files more readable
By inserting a new line before each feature entry.
2008-09-22 19:15:05 -04:00
Behdad Esfahbod
23b9767bb3 Rename Makefile.*.config to Makefile.*.features as they should not be modified
The .config naming was giving people the impression that they can modify it.
That's not the case.
2008-09-22 17:34:36 -04:00
Kai-Uwe Behrmann
20be3182ef [svg] Counteract application of object matrix to mask.
The expected behaviour for masking in Cairo is to set the mask according
to the current active matrix and apply unchanged to the masked surface.

In SVG, the mask element is bound to the masked object and thus the local
matrix from that image object applies to the nested mask as well.

Attached is a small patch for substracting the matrix of a image
surface from the matrix of the mask to comply to Cairo's behaviour.
I did not test for other stuff like vectors or text and would expect this
part is incomplete.
2008-09-22 12:01:11 +01:00
Chris Wilson
223e7b9ed0 [test] Add an exercise for masking an image using the ctm.
Quote Kai-Uwe Behrmann:
"The expected behaviour for masking in Cairo is to set the mask according
to the current active matrix and apply unchanged to a to be masked
surface.

In SVG the mask element is bound to the masked object and thus the local
matrix from that image object applies to the nested mask as well."

This is a test case to exercise applying a mask to an image under
separate transformations.

Original patch by Kai-Uwe Behrmann, altered to run the test against all
backends (where it causes poppler to crash on my machine <evil grin>).
2008-09-22 09:55:15 +01:00
Behdad Esfahbod
3a45ff0e2f Make checks happy again
Minor syntax changes and improved check regexps.
2008-09-20 18:35:10 -04:00
Behdad Esfahbod
9084f6baf6 [Makefile.win32] Fix various issues reported by Damian Frank
We now compile cairo-system.c twice when building static library, but
that's fine because cairo-systemc. includes no other code.  Indeed
that's why cairo-system.c was born in the first place.
2008-09-20 18:26:27 -04:00
Behdad Esfahbod
45609d8400 Add cairo-system.c for platform system-specific code
This is where DLL initialization/finalization should be done for example.
Moved the one for win32.  For OS/2 just left a comment as the code needs
more work.

This change simplifies building shared and static libraries in the win32
makefiles.
2008-09-20 18:26:27 -04:00
Behdad Esfahbod
9c27323959 [aclocal] In generated Makefile.win32.config, don't overwrite feature vars
When I designed this first I thought people can define make vars on the
command line to override default features.  That works.  However, it's
natural to want to define the list of features in the toplevel Makefile
and not on command line.  So, we don't override user's var now.  They
can set a make feature var to 0 to disable it.
2008-09-20 18:26:19 -04:00
Behdad Esfahbod
6d0d5e7ba0 Define cairo_public correctly for win32
I'm conditioning on _MSC_VER.  Is this accurate?
Note that we never overwrite cairo_public.  So one can define it to
something else.
2008-09-20 17:52:19 -04:00
Behdad Esfahbod
11e96487d8 [Makefile.win32] Remove a few unused macro declarations
An undefined PACKAGE_BUGREPORT is not properly handled where it's used.
The other two were not being used after build system revamp.
2008-09-20 17:51:24 -04:00