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.
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.
Avoid the iterative search for the extreme points by first checking the
most likely arrangement (as produced by cairo_rectangle() under no
transformation).
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.
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.
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!
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.
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.
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.
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>).
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.
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.
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.
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.
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.
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.
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.
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.
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.