summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2012-10-09 04:00:31 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2013-04-05 14:08:13 -0400
commit2916edda32f6ad69f04e5e3e68970ed69610bfd8 (patch)
tree2783a8d86767d475529db66a00bade33d8d13e91
parent7c7c2b42d9542568d5e14c2c7fd268a00f5c3bcf (diff)
Coalesce some horizontal boxes when walking active listvspans
-rw-r--r--pixman/pixman-region32.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/pixman/pixman-region32.c b/pixman/pixman-region32.c
index 3b20e33a..73b0f638 100644
--- a/pixman/pixman-region32.c
+++ b/pixman/pixman-region32.c
@@ -401,18 +401,30 @@ pixman_region32_init_vspans (pixman_region32_t *region,
if (new_y > y)
{
+ const pixman_vspan32_t *begin;
int winding = 0;
- for (span = first_active; span != first_top - 1; ++span)
+ begin = NULL;
+ for (span = first_active; span != first_top; ++span)
{
winding += (*span)->direction;
if (winding & winding_mask)
{
- if (!region_builder_add_box (
- &builder, (*span)->x, y, (*(span + 1))->x, new_y))
+ if (!begin)
+ begin = *span;
+ }
+ else
+ {
+ if (begin)
{
- goto out;
+ if (!region_builder_add_box (
+ &builder, begin->x, y, (*span)->x, new_y))
+ {
+ goto out;
+ }
+
+ begin = NULL;
}
}
}