diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-04-06 09:12:08 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-04-06 09:12:08 +0100 |
commit | 1ae6328c57eb496072f0d0e27440f5d0901633b0 (patch) | |
tree | ffa97c032468a55c936eb9282f2a132c52af5468 /src/sna | |
parent | 51b9202d27db3d98c6d82ba224bd8eb218533dd9 (diff) |
sna: Remove redundant check from tor_inplace()
We only execute full-steps for vertical edges so we do not need the
second check.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r-- | src/sna/sna_trapezoids.c | 55 |
1 files changed, 27 insertions, 28 deletions
diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c index 2b4b2dbb..9000f82f 100644 --- a/src/sna/sna_trapezoids.c +++ b/src/sna/sna_trapezoids.c @@ -1383,22 +1383,21 @@ tor_render(struct sna *sna, active->min_height, active->is_vertical)); if (do_full_step) { + assert(active->is_vertical); nonzero_row(active, coverages); - if (active->is_vertical) { - while (j < h && - polygon->y_buckets[j] == NULL && - active->min_height >= 2*FAST_SAMPLES_Y) - { - active->min_height -= FAST_SAMPLES_Y; - j++; - } - if (j != i + 1) - step_edges(active, j - (i + 1)); - - __DBG(("%s: vertical edges, full step (%d, %d)\n", - __FUNCTION__, i, j)); + while (j < h && + polygon->y_buckets[j] == NULL && + active->min_height >= 2*FAST_SAMPLES_Y) + { + active->min_height -= FAST_SAMPLES_Y; + j++; } + if (j != i + 1) + step_edges(active, j - (i + 1)); + + __DBG(("%s: vertical edges, full step (%d, %d)\n", + __FUNCTION__, i, j)); } else { grid_scaled_y_t suby; @@ -1748,27 +1747,27 @@ tor_inplace(struct tor *converter, PixmapPtr scratch, int mono, uint8_t *buf) active->min_height, active->is_vertical)); if (do_full_step) { + assert(active->is_vertical); + memset(ptr, 0, width); inplace_row(active, ptr, width); if (row != ptr) memcpy(row, ptr, width); - if (active->is_vertical) { - while (j < h && - polygon->y_buckets[j] == NULL && - active->min_height >= 2*FAST_SAMPLES_Y) - { - active->min_height -= FAST_SAMPLES_Y; - row += stride; - memcpy(row, ptr, width); - j++; - } - if (j != i + 1) - step_edges(active, j - (i + 1)); - - __DBG(("%s: vertical edges, full step (%d, %d)\n", - __FUNCTION__, i, j)); + while (j < h && + polygon->y_buckets[j] == NULL && + active->min_height >= 2*FAST_SAMPLES_Y) + { + active->min_height -= FAST_SAMPLES_Y; + row += stride; + memcpy(row, ptr, width); + j++; } + if (j != i + 1) + step_edges(active, j - (i + 1)); + + __DBG(("%s: vertical edges, full step (%d, %d)\n", + __FUNCTION__, i, j)); } else { grid_scaled_y_t suby; int min = width, max = 0; |