summaryrefslogtreecommitdiff
path: root/src/cairo-traps.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-10-24 17:06:04 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2008-10-30 17:52:13 +0000
commit64726ccfb99ba964420f3a840fd707998927e902 (patch)
tree77de01ba7924f28e645fc3aa6cf10ff093503a30 /src/cairo-traps.c
parentd5543005e7b7cc08f97578f301182ef4807a05fe (diff)
downloadcairo-64726ccfb99ba964420f3a840fd707998927e902.tar.gz
[traps] Whitespace.
Fixup whitespace in line with CODING_STYLE and rest of file.
Diffstat (limited to 'src/cairo-traps.c')
-rw-r--r--src/cairo-traps.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/src/cairo-traps.c b/src/cairo-traps.c
index b76e9089c..4fa3656a1 100644
--- a/src/cairo-traps.c
+++ b/src/cairo-traps.c
@@ -615,18 +615,25 @@ _cairo_traps_extract_region (const cairo_traps_t *traps,
int i, box_count;
cairo_int_status_t status;
- for (i = 0; i < traps->num_traps; i++)
- if (!(traps->traps[i].left.p1.x == traps->traps[i].left.p2.x
- && traps->traps[i].right.p1.x == traps->traps[i].right.p2.x
- && _cairo_fixed_is_integer(traps->traps[i].top)
- && _cairo_fixed_is_integer(traps->traps[i].bottom)
- && _cairo_fixed_is_integer(traps->traps[i].left.p1.x)
- && _cairo_fixed_is_integer(traps->traps[i].right.p1.x))) {
+ if (traps->num_traps == 0) {
+ _cairo_region_init (region);
+ return CAIRO_STATUS_SUCCESS;
+ }
+
+ for (i = 0; i < traps->num_traps; i++) {
+ if (traps->traps[i].left.p1.x != traps->traps[i].left.p2.x ||
+ traps->traps[i].right.p1.x != traps->traps[i].right.p2.x ||
+ ! _cairo_fixed_is_integer (traps->traps[i].top) ||
+ ! _cairo_fixed_is_integer (traps->traps[i].bottom) ||
+ ! _cairo_fixed_is_integer (traps->traps[i].left.p1.x) ||
+ ! _cairo_fixed_is_integer (traps->traps[i].right.p1.x))
+ {
return CAIRO_INT_STATUS_UNSUPPORTED;
}
+ }
- if (traps->num_traps > ARRAY_LENGTH(stack_boxes)) {
- boxes = _cairo_malloc_ab (traps->num_traps, sizeof(cairo_box_int_t));
+ if (traps->num_traps > ARRAY_LENGTH (stack_boxes)) {
+ boxes = _cairo_malloc_ab (traps->num_traps, sizeof (cairo_box_int_t));
if (boxes == NULL)
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
@@ -635,10 +642,10 @@ _cairo_traps_extract_region (const cairo_traps_t *traps,
box_count = 0;
for (i = 0; i < traps->num_traps; i++) {
- int x1 = _cairo_fixed_integer_part(traps->traps[i].left.p1.x);
- int y1 = _cairo_fixed_integer_part(traps->traps[i].top);
- int x2 = _cairo_fixed_integer_part(traps->traps[i].right.p1.x);
- int y2 = _cairo_fixed_integer_part(traps->traps[i].bottom);
+ int x1 = _cairo_fixed_integer_part (traps->traps[i].left.p1.x);
+ int y1 = _cairo_fixed_integer_part (traps->traps[i].top);
+ int x2 = _cairo_fixed_integer_part (traps->traps[i].right.p1.x);
+ int y2 = _cairo_fixed_integer_part (traps->traps[i].bottom);
/* XXX: Sometimes we get degenerate trapezoids from the tesellator;
* skip these.