summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-05-18 15:19:00 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-05-18 15:39:32 +0100
commitee073d613bba38f90951405d5ecddfcf3ac5e043 (patch)
tree0498b253a550a1d7b42324987f60eb463188f5d8 /src
parent8ba800c63906fb29d34f40b9437092a665bffb14 (diff)
sna/traps: Fix processing of full-steps
A missing factor of Y-height caused the computation of coverage for the spans to be completely wrong. This affects the vertical segments of rounded rectangles, for instance. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna_trapezoids.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c
index 357c4c49..c0565fa1 100644
--- a/src/sna/sna_trapezoids.c
+++ b/src/sna/sna_trapezoids.c
@@ -607,14 +607,14 @@ cell_list_add_span(struct cell_list *cells,
cell = cell_list_find(cells, ix1);
if (ix1 != ix2) {
- cell->uncovered_area += 2*fx1;
+ cell->uncovered_area += 2*fx1*FAST_SAMPLES_Y;
cell->covered_height += FAST_SAMPLES_Y;
cell = cell_list_find(cells, ix2);
- cell->uncovered_area -= 2*fx2;
+ cell->uncovered_area -= 2*fx2*FAST_SAMPLES_Y;
cell->covered_height -= FAST_SAMPLES_Y;
} else
- cell->uncovered_area += 2*(fx1-fx2);
+ cell->uncovered_area += 2*(fx1-fx2)*FAST_SAMPLES_Y;
}
static void
@@ -1025,6 +1025,7 @@ nonzero_subrow(struct active_list *active, struct cell_list *coverages)
} else {
edge->prev->next = next;
next->prev = edge->prev;
+ active->min_height = -1;
}
edge = next;
@@ -1718,7 +1719,7 @@ tor_inplace(struct tor *converter, PixmapPtr scratch, int mono, uint8_t *buf)
int stride = scratch->devKind;
int width = scratch->drawable.width;
- __DBG(("%s: mono=%d, buf=%d\n", __FUNCTION__, mono, buf));
+ __DBG(("%s: mono=%d, buf?=%d\n", __FUNCTION__, mono, buf != NULL));
assert(!mono);
assert(converter->ymin == 0);
assert(converter->xmin == 0);
@@ -1750,9 +1751,9 @@ tor_inplace(struct tor *converter, PixmapPtr scratch, int mono, uint8_t *buf)
do_full_step = can_full_step(active);
}
- __DBG(("%s: y=%d [%d], do_full_step=%d, new edges=%d, min_height=%d, vertical=%d\n",
+ __DBG(("%s: y=%d, do_full_step=%d, new edges=%d, min_height=%d, vertical=%d\n",
__FUNCTION__,
- i, i+ymin, do_full_step,
+ i, do_full_step,
polygon->y_buckets[i] != NULL,
active->min_height,
active->is_vertical));