diff options
author | Søren Sandmann Pedersen <sandmann@daimi.au.dk> | 2009-02-18 08:01:19 -0500 |
---|---|---|
committer | Søren Sandmann Pedersen <sandmann@daimi.au.dk> | 2009-03-28 18:02:57 -0400 |
commit | bf6d9bc1758ac1971485b6565d29934d6b06bef2 (patch) | |
tree | e42df01c3c449819ae60966cebafa7a2569c7e22 /src/cairo-region.c | |
parent | e6d82afcab01cc91b88185abc8d1bfb9df5c2c19 (diff) |
[region] Delete cairo_region_create_rectangles()
It was only used in _cairo_traps_extract_region() which could be
simplified significantly by calling cairo_region_union_rect()
repeatedly instead.
Diffstat (limited to 'src/cairo-region.c')
-rw-r--r-- | src/cairo-region.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/src/cairo-region.c b/src/cairo-region.c index 5d01d370..bc6598ac 100644 --- a/src/cairo-region.c +++ b/src/cairo-region.c @@ -74,50 +74,6 @@ cairo_region_create_rect (cairo_rectangle_int_t *rect) return region; } -cairo_region_t * -cairo_region_create_rectangles (cairo_rectangle_int_t *rects, - int count) -{ - pixman_box32_t stack_pboxes[CAIRO_STACK_ARRAY_LENGTH (pixman_box32_t)]; - pixman_box32_t *pboxes = stack_pboxes; - cairo_region_t *region; - int i; - - region = _cairo_malloc (sizeof (cairo_region_t)); - - if (!region) - return (cairo_region_t *)&_cairo_region_nil; - - region->status = CAIRO_STATUS_SUCCESS; - - if (count > ARRAY_LENGTH (stack_pboxes)) { - pboxes = _cairo_malloc_ab (count, sizeof (pixman_box32_t)); - - if (unlikely (pboxes == NULL)) { - free (region); - return (cairo_region_t *)&_cairo_region_nil; - } - } - - for (i = 0; i < count; i++) { - pboxes[i].x1 = rects[i].x; - pboxes[i].y1 = rects[i].y; - pboxes[i].x2 = rects[i].x + rects[i].width; - pboxes[i].y2 = rects[i].y + rects[i].height; - } - - if (! pixman_region32_init_rects (®ion->rgn, pboxes, count)) { - free (region); - - region = (cairo_region_t *)&_cairo_region_nil; - } - - if (pboxes != stack_pboxes) - free (pboxes); - - return region; -} - void cairo_region_destroy (cairo_region_t *region) { |