diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-07-31 21:48:47 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-08-01 12:08:55 +0100 |
commit | 4a8f638c9a7772e9e8eaa7246b892eedb1d784d9 (patch) | |
tree | 30702b1eb9b6f9485e88727f78309d89299dff53 /src/cairo-tor-scan-converter.c | |
parent | c0407e84e919bca08f8cd2e1e350e54f36122968 (diff) | |
download | cairo-4a8f638c9a7772e9e8eaa7246b892eedb1d784d9.tar.gz |
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 <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/cairo-tor-scan-converter.c')
-rw-r--r-- | src/cairo-tor-scan-converter.c | 4 |
1 files 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; |