summaryrefslogtreecommitdiff
path: root/src/cairo-traps.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-09-24 11:38:21 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2008-09-24 11:45:51 +0100
commitb9c92842d9c091e34738d14f7baf6f357a1f085c (patch)
treefc906920fca39816b90a7d2314c3bab980076ed9 /src/cairo-traps.c
parent911d5f1a254f800fe18f4554b738006aa0a693a2 (diff)
downloadcairo-b9c92842d9c091e34738d14f7baf6f357a1f085c.tar.gz
[trap] Trivial reject if trapezoid is entirely above or below
Also check whether is vertically within limits.
Diffstat (limited to 'src/cairo-traps.c')
-rw-r--r--src/cairo-traps.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cairo-traps.c b/src/cairo-traps.c
index 40bc21487..3a38c6933 100644
--- a/src/cairo-traps.c
+++ b/src/cairo-traps.c
@@ -183,6 +183,10 @@ _cairo_traps_add_trap (cairo_traps_t *traps,
return;
}
+ /* And reject if the trapezoid is entirely above or below */
+ if (top > traps->limits.p2.y || bottom < traps->limits.p1.y)
+ return;
+
/* Otherwise, clip the trapezoid to the limits. We only clip
* where an edge is entirely outside the limits. If we wanted
* to be more clever, we could handle cases where a trapezoid