diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-01-19 18:36:20 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-01-22 23:01:51 +0000 |
commit | e49855497e7214c21c85b03d7ab94e9e008f821b (patch) | |
tree | b82a993b756b62720ea465889dc0d5015aa164d1 /src/cairo-compiler-private.h | |
parent | 424dcf296378a107286a164aaf135a34e40c42ac (diff) | |
download | cairo-e49855497e7214c21c85b03d7ab94e9e008f821b.tar.gz |
spans: Add a Bentley-Ottmann variant on the Tor scan converter
This variant uses the Bentley-Ottmann algorithm to only maintain the
active edge list upon edge events and so can efficiently skip areas
where no change occurs. This means that it can be much quicker than the
Tor algorithm (which is still used to compute the coverages from the
active edges) for geometries consisting of long straight lines with few
intersections. However due to the computational overhead of the
Bentley-Ottmann event processing, for dense curvy paths, simply updating
the active edge list in sync with computing the coverages is a win. Due
to advantageous adaptive step size, the scan converter can be run at a
much higher subsampling with little extra overhead compared with Tor,
currently it uses a 256x256 subsampling grid to avoid any impedance
mismatch with path precision.
Given the current status of implementations, this scan converter [botor]
is likely to be advantage where detecting large regions of unchanged
span data will result in improved performance, for instance the drm
backends which convert the scan data into rectangles.
Diffstat (limited to 'src/cairo-compiler-private.h')
-rw-r--r-- | src/cairo-compiler-private.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/cairo-compiler-private.h b/src/cairo-compiler-private.h index 403c3f7a1..34da73cd1 100644 --- a/src/cairo-compiler-private.h +++ b/src/cairo-compiler-private.h @@ -44,6 +44,15 @@ #include "config.h" #endif +/* Size in bytes of buffer to use off the stack per functions. + * Mostly used by text functions. For larger allocations, they'll + * malloc(). */ +#ifndef CAIRO_STACK_BUFFER_SIZE +#define CAIRO_STACK_BUFFER_SIZE (512 * sizeof (int)) +#endif + +#define CAIRO_STACK_ARRAY_LENGTH(T) (CAIRO_STACK_BUFFER_SIZE / sizeof(T)) + #if __GNUC__ >= 3 && defined(__ELF__) && !defined(__sun) # define slim_hidden_proto(name) slim_hidden_proto1(name, slim_hidden_int_name(name)) cairo_private # define slim_hidden_proto_no_warn(name) slim_hidden_proto1(name, slim_hidden_int_name(name)) cairo_private_no_warn @@ -134,9 +143,11 @@ #if __GNUC__ >= 3 #define cairo_pure __attribute__((pure)) #define cairo_const __attribute__((const)) +#define always_inline inline __attribute__((always_inline)) #else #define cairo_pure #define cairo_const +#define always_inline inline #endif #if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__) |