From c913346e082d8b7cbd280196e046e1731a6a2438 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sat, 13 Nov 2010 16:24:06 +0100 Subject: [PATCH 3/4] cairo-image-surface.c: Check the result of pixman_fill with an assertion This will reveal issues with CAIRO_FORMAT_A1 surfaces in cairo. --- src/cairo-image-surface.c | 32 +++++++++++++++++++------------- 1 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/cairo-image-surface.c b/src/cairo-image-surface.c index 09248f8..fc17d36 100644 --- a/src/cairo-image-surface.c +++ b/src/cairo-image-surface.c @@ -1801,6 +1801,7 @@ _cairo_image_surface_fixup_unbounded_boxes (cairo_image_surface_t *dst, cairo_status_t status; struct _cairo_boxes_chunk *chunk; int i; + int rc; if (boxes->num_boxes <= 1 && clip_region == NULL) return _cairo_image_surface_fixup_unbounded (dst, extents, NULL); @@ -1860,10 +1861,11 @@ _cairo_image_surface_fixup_unbounded_boxes (cairo_image_surface_t *dst, int x2 = _cairo_fixed_integer_part (chunk->base[i].p2.x); int y2 = _cairo_fixed_integer_part (chunk->base[i].p2.y); - pixman_fill ((uint32_t *) dst->data, dst->stride / sizeof (uint32_t), - PIXMAN_FORMAT_BPP (dst->pixman_format), - x1, y1, x2 - x1, y2 - y1, - 0); + rc = pixman_fill ((uint32_t *) dst->data, dst->stride / sizeof (uint32_t), + PIXMAN_FORMAT_BPP (dst->pixman_format), + x1, y1, x2 - x1, y2 - y1, + 0); + assert(rc == TRUE); } } } @@ -2631,6 +2633,7 @@ _fill_unaligned_boxes (cairo_image_surface_t *dst, const struct _cairo_boxes_chunk *chunk; cairo_status_t status; int i; + int rc; /* XXX * using composite for fill: @@ -2686,11 +2689,12 @@ _fill_unaligned_boxes (cairo_image_surface_t *dst, if (x2 > x1 && y2 > y1) { cairo_box_t b; - pixman_fill ((uint32_t *) dst->data, - dst->stride / sizeof (uint32_t), - PIXMAN_FORMAT_BPP (dst->pixman_format), - x1, y1, x2 - x1, y2 - y1, - pixel); + rc = pixman_fill ((uint32_t *) dst->data, + dst->stride / sizeof (uint32_t), + PIXMAN_FORMAT_BPP (dst->pixman_format), + x1, y1, x2 - x1, y2 - y1, + pixel); + assert(rc == TRUE); /* top */ if (! _cairo_fixed_is_integer (box[i].p1.y)) { @@ -2896,6 +2900,7 @@ _composite_boxes (cairo_image_surface_t *dst, struct _cairo_boxes_chunk *chunk; uint32_t pixel; int i; + int rc; if (clip != NULL) { status = _cairo_clip_get_region (clip, &clip_region); @@ -2944,10 +2949,11 @@ _composite_boxes (cairo_image_surface_t *dst, if (x2 == x1 || y2 == y1) continue; - pixman_fill ((uint32_t *) dst->data, dst->stride / sizeof (uint32_t), - PIXMAN_FORMAT_BPP (dst->pixman_format), - x1, y1, x2 - x1, y2 - y1, - pixel); + rc = pixman_fill ((uint32_t *) dst->data, dst->stride / sizeof (uint32_t), + PIXMAN_FORMAT_BPP (dst->pixman_format), + x1, y1, x2 - x1, y2 - y1, + pixel); + assert(rc == TRUE); } } } -- 1.7.3.2