summaryrefslogtreecommitdiff
path: root/src/cairo-slope.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-12-17 09:32:16 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2009-08-29 08:08:28 +0100
commitf8bb3617c3a7ec598c42eff1f8562e3ccc95127f (patch)
treef6c8f949ab44ca126053fb5cea2b9b88a4748cb8 /src/cairo-slope.c
parent7c499db8afe8a7cf8c512ec166fe7dbf11a25c02 (diff)
Eliminate self-intersecting strokes.
We refactor the surface fallbacks to convert full strokes and fills to the intermediate polygon representation (as opposed to before where we returned the trapezoidal representation). This allow greater flexibility to choose how then to rasterize the polygon. Where possible we use the local spans rasteriser for its increased performance, but still have the option to use the tessellator instead (for example, with the current Render protocol which does not yet have a polygon image). In order to accommodate this, the spans interface is tweaked to accept whole polygons instead of a path and the tessellator is tweaked for speed. Performance Impact ================== ... Still measuring, expecting some severe regressions. ...
Diffstat (limited to 'src/cairo-slope.c')
-rw-r--r--src/cairo-slope.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/cairo-slope.c b/src/cairo-slope.c
index 35c537221..15685b789 100644
--- a/src/cairo-slope.c
+++ b/src/cairo-slope.c
@@ -94,9 +94,7 @@ _cairo_slope_compare (const cairo_slope_t *a, const cairo_slope_t *b)
* of b by an infinitesimally small amount, (that is, 'a' will
* always be considered less than 'b').
*/
- if (((a->dx > 0) != (b->dx > 0)) ||
- ((a->dy > 0) != (b->dy > 0)))
- {
+ if ((a->dx ^ b->dx) < 0 || (a->dy ^ b->dy) < 0) {
if (a->dx > 0 || (a->dx == 0 && a->dy > 0))
return +1;
else