From 4a8f638c9a7772e9e8eaa7246b892eedb1d784d9 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 31 Jul 2011 21:48:47 +0100 Subject: [PATCH] tor: Suppress repeated spans Under certain circumstances we will emit identical spans for when the edge covers the entire pixel and then for the subsequent pixels. These can be squashed into a single span. Signed-off-by: Chris Wilson --- src/cairo-tor-scan-converter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cairo-tor-scan-converter.c b/src/cairo-tor-scan-converter.c index 32a62930a..954c51430 100644 --- a/src/cairo-tor-scan-converter.c +++ b/src/cairo-tor-scan-converter.c @@ -1816,7 +1816,7 @@ blit_with_span_renderer (struct cell_list *cells, { struct cell *cell = cells->head.next; int prev_x = xmin, last_x = -1; - int cover = 0, last_cover = -1; + int cover = 0, last_cover = 0; cairo_half_open_span_t *spans; unsigned num_spans; @@ -1851,7 +1851,7 @@ blit_with_span_renderer (struct cell_list *cells, int x = cell->x; int area; - if (x > prev_x) { + if (x > prev_x && cover != last_cover) { spans[num_spans].x = prev_x; spans[num_spans].coverage = GRID_AREA_TO_ALPHA (cover); last_cover = cover;