Commit graph

3556 commits

Author SHA1 Message Date
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
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
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
fee72c26af Make sure feature macros are checked using #if, not #ifdef; add a test for it
This is more robust to cases where people want to assign 0 to those variables.
(win32/alternate build systems, etc)
2008-09-20 17:20:36 -04:00
Behdad Esfahbod
e00565fa3c [src/check-includes.sh] Check that there is no #include <cairo.*.h>
The correct syntax to include cairo headers from other cairo headers and
sources is using "...", not <...>.  Check that.
2008-09-20 15:38:29 -04:00
Behdad Esfahbod
9c36a5f3f1 [src/Makefile.am.analysis] Check that all headers can be compiled standalone
This ensures that each header includes all headers it depends on.
This is now enforced by "make check".
2008-09-19 18:51:03 -04:00
Behdad Esfahbod
2dd90a6c94 [cairo-mutex] Move semicolons out of cairo-mutex-list-private.h
Previously cairo-mutex-list-private.h assumed that every use of the file
will produce a statement for each mutex by including a semicolon after
each.  But some uses (like enumerating all static mutexes  in an array
for example, can't be implemented with the semicolon in place.  So, move
the semicolon out to the users of the header file.
2008-09-19 18:45:44 -04:00
Behdad Esfahbod
d84752605a Make sure (and check) that all private headers include some cairo header first
The macros CAIRO_BEGIN_DECLS and CAIRO_END_DECLS are declared in two
places: config.h and cairo.h.  On Win32 build there is no config.h.  So,
we can't rely on pulling CAIRO_BEGIN_DECLS from there.  Hence, we now:

  * Not add those declarations to config.h anymore,

  * Test that every cairo private header includes some other cairo
    header before any other includes.

These two are fairly enough to ensure that cairo.h is seen from all
private headers.  There's still the case of headers not including
any header file at all.  I'll fix that later.
2008-09-19 17:19:10 -04:00
Behdad Esfahbod
eb89bf049a Check for _MSC_VER in mutex implementation code
Previously I made the mutex implementation code to use Windows mutexes
conditional on HAVE_WINDOWS_H.  This was suppposed to be a more wine-friendly
version of checking for a Windows platform.  However, it also meant that
when compiling without config.h, one had to stuff a #define for HAVE_WINDOWS_H
somewhere.  Traditionally it was put in cairo-features-win32.h, and that
practice was carried over even after my build system rewrite.

Somewhere along the road I also decided that the mutex implementation header
does not need to include anything other than config.h.  So the hacked up
HAVE_WINDOWS_H in cairo-features-win32.h was not being seen by its lone
user.

We now condition on any of HAVE_WINDOWS_H and _MSC_VER.  So the hack can be
removed altogether.
2008-09-19 16:57:42 -04:00
Behdad Esfahbod
33b6d2b5eb [src/check-cairoint.sh] Escape dot in regexp
No why, just that it's more robust :).
2008-09-19 16:57:42 -04:00
Behdad Esfahbod
d635c941b2 [image] Check for PACKAGE_BUGREPORT availability
Building using win32, there is no config.h.  So PACKAGE_BUGREPORT may
not be defined.
2008-09-19 16:57:42 -04:00
Chris Wilson
a6c0ebee7a [tessellator] Only run sweep-line validator when debugging
The tessellator is well-proven now. However, the sweep-line validator
consumes around 50% of the total time required to draw the fractal
Pythagoras tree (the leaves are sub-pixel rectangles, so lots of edges
to sweep through). So disable the validator, but keep it available for
debugging.
2008-09-19 16:59:51 +01:00
Chris Wilson
91f0b8b1ea [fill] Construct trap using rectangle directly.
Avoid the overhead in sorting the edges within
_cairo_traps_tessellate_convex_quad() by using our prior knowledge that we
have a simple rectangle and construct the trap from the extreme points.
2008-09-19 16:59:51 +01:00
Chris Wilson
d5cd7ee74f [stroke] Optimise rectilinear strokes.
Avoid the overhead of sorting the rectangle in
_cairo_traps_tessellate_convex_quad() by constructing the trap directly
from the line segment. This also has secondary effects in only passing
 the non-degenerate trap to _cairo_traps_add_trap().

For rectilinear Hilbert curves this makes the rectilinear stoker over 4x
faster.
2008-09-19 16:59:25 +01:00
Chris Wilson
9930eefbbd Simple perf tweaks for a rectilinear Hilbert curve.
Some tweaks to avoid stack copies and branches that save ~25% in
_cairo_traps_tessellate_convex_quad().
2008-09-19 14:31:33 +01:00
Chris Wilson
27ee8dd9c6 [trap] Fixup a double _cairo_traps_fini().
The rectilinear stroke finalized the cairo_traps_t passed to it - which
was then subsequently used without re-initialized. So instead of
finalizing the structure, just remove any traps that we may have added
(leaving the limits and memory intact).
2008-09-19 14:31:33 +01:00
Behdad Esfahbod
005dd8499b [src/Makefile.win32] Remove recursive cairo_headers var
The cairo_headers variable in Makefile.win32 was unused and
from before the new build system was put in place.  One can
use enabled_cairo_headers if need be.
2008-09-18 16:39:23 -04:00
Behdad Esfahbod
567be443a2 [configure.ac] Make sure version information do not end up in config.h
By introducing $(top_srcdir)/cairo-version.h I tried to make it
unnecessary to rebuild the entire library when the version changes.
That comes handy around releases and when bisecting.

However this was not working as the version info was also ending
up in config.h and hence forcing a full rebuild upon change.
I now undefine the PACKAGE_VERSION* macros that autoconf defines,
so config.h does not change when cairo-version.h changes.
2008-09-18 16:27:02 -04:00
Behdad Esfahbod
73c70488f3 [src/check-*.sh] Use computed list of source files instead of running "find"
When the lists are available use them.  They will be available to test
programs by make.
2008-09-18 15:56:53 -04:00
Behdad Esfahbod
1ee675d6a0 [src/check-doc/syntax.sh] Fix test for out-of-tree build
Now that our build system can compute a list of all cairo files,
we prefer to use that in the tests instead of running "find".
However, we were not switching to $(srcdir) so the test was not
finding source files in out-of-tree builds.  Noticed that from
the grep error in distcheck.
2008-09-18 15:56:34 -04:00
Carl Worth
1b42bc8033 Make the lcd_filter API private
During the cairo summit it was decided that this API is to freetype-
specific to be in the general cairo interface for now. This will
likely come back again soon as a cairo_ft-specific interface.
2008-09-18 07:56:43 -07:00
Chris Wilson
0ab14a6b21 [polygon] Reduce number of branches.
Minimise the number of conditionals taken whilst constructing the polygon.
2008-09-18 09:06:29 +01:00
Behdad Esfahbod
1fe7088a11 [show_text_glyphs] Replace the bool backward with cairo_text_cluster_flags
Chris rightfully complained that having a boolean function argument is
new in cairo_show_text_glyphs, and indeed avoiding them has been one
of the API design criteria for cairo.  Trying to come up with alternatives,
Owen suggested using a flag type which nicely solves the problem AND
future-proofs such a complex API.

Please welcome _flags_t APIs to cairo.h
2008-09-18 00:26:07 -04:00
Chris Wilson
e55d5a76d7 [ps] Silence compiler warning. 2008-09-17 22:25:16 +01:00
Chris Wilson
d83a4d9905 [svg] Emit user-fonts.
Iterate over the user fonts subsets and emit the scaled glyphs.
2008-09-17 21:19:48 +01:00
Chris Wilson
eb39151fdc [scaled-fonts] Correct the order of scaled/user arguments. 2008-09-17 21:19:13 +01:00
Søren Sandmann Pedersen
86485e76b7 [xlib] Use _cairo_matrix_to_pixman_matrix() to compute the XTransform
The adjustments done to the pixman matrix also need to be done for
XTransform. Since an XTransform is just a pixman_transform_t with
another name, we can reuse the conversion function.
2008-09-17 15:18:55 -04:00
Chris Wilson
dbb692325b [ps] Consume dictionary after where.
where either pushes 'dict true' or 'false' so the true procedure needs to
consume the dictionary as well - for our purposes we just pop it off the
operand stack.
2008-09-17 19:09:16 +01:00
Behdad Esfahbod
1de35c04e0 Revert "[Makefile.am] Add CAIRO_LIBS to check-link."
This reverts commit a341cb5a98.
The change introduced in that commit should not be needed and libtool
should just do the right thing.  I cannot reproduce the problem
Chris was having no matter how hard I tried.
2008-09-17 02:11:38 -04:00
Chris Wilson
a341cb5a98 [Makefile.am] Add CAIRO_LIBS to check-link.
With --enable-gcov, make check aborts with gcov errors on check-link - it
appears that -lgcov is magic and requires explicit invovation on the
command-line.
2008-09-16 23:06:53 +01:00
Behdad Esfahbod
840218e0a0 [src/Makefile.am.analysis] Fix typos and improve scripts 2008-09-16 03:58:22 -04:00
Behdad Esfahbod
49c8c62040 [src/Makefile.am.analysis] Split off from src/Makefile.am 2008-09-16 03:58:21 -04:00
Behdad Esfahbod
eb749d7563 [.gitignore] Update 2008-09-16 03:58:21 -04:00
Behdad Esfahbod
a908fc04a7 [boilerplate/Makefile.am] Distribute Makefile.win32.config 2008-09-16 03:58:21 -04:00
Behdad Esfahbod
8151c50670 [*/Makefile.win32] Use Makefile.win32.config 2008-09-16 03:58:21 -04:00
Behdad Esfahbod
6892daf77c Create cairo-features-win32.h 2008-09-16 03:58:20 -04:00
Chris Wilson
60ab0f79f8 [pdf] Kill a compiler warning.
Older versions of gcc complain about the use of a guard variable, and warn
that solid_color may be used uninitialized. As it happens the guard
variable is redundant and we can just use solid_color directly.
2008-09-16 02:08:47 +01:00
Chris Wilson
87094e8c78 [Makefile] Amend checks for horrible msys environment.
automake-1.8 requires $(EXEEXT) for TESTS and feeds lt-check-*.c to
check-cairoint.h. Workaround both misfeatures.
2008-09-16 01:50:29 +01:00
Adrian Johnson
7880ddd101 Fix scaling of glyphs in type3 subset glyphs 2008-09-16 10:04:34 +09:30
Behdad Esfahbod
4619c76d2f [scaled_font] Improve readability 2008-09-15 18:51:50 -04:00
Behdad Esfahbod
e079ec03cb [scaled-font] Fix bug unlocking the wrong mutex (#16819) 2008-09-15 18:51:24 -04:00
Behdad Esfahbod
096408d80e [scaled-font] Improve comment 2008-09-15 18:51:04 -04:00
Behdad Esfahbod
e4753c82ff [src/README] s/Source.mk/Makefile.sources/ 2008-09-15 14:50:29 -04:00
Behdad Esfahbod
50f45d7768 [src/Makefile.am] Add comment referring to Makefile.sources 2008-09-15 14:50:07 -04:00
Chris Wilson
34f2506432 [surface] Trivial rejection of fill/stroke if clip extents is zero
Avoid tessellating the path if we know that the target extents is zero.
Besides the rare occurrence when everything is clipped out, a zero-sized
surface is often intended as a no-op surface for benchmarking.
2008-09-15 16:28:59 +01:00
Behdad Esfahbod
93325a3f08 [configure.ac.enable] Cleanup Makefile.*.config generation 2008-09-11 19:12:31 -04:00
Behdad Esfahbod
66d6cb642c [Makefile.am.common] Unify more common rules 2008-09-11 18:06:57 -04:00
Behdad Esfahbod
de5b8bce37 Makefile.am cleanup
Use a common build/Makefile.am.common file.
2008-09-11 15:49:09 -04:00