diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-09-14 18:39:37 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-09-14 18:38:57 +0100 |
commit | 544a4167c156eac7b630f90ddef30a6f00829835 (patch) | |
tree | bff419c96e4afb688d0b6831cf90ed8c5304ba8d /src/sna/sna_trapezoids.c | |
parent | 3565c48c4bb77c836d817de75d098791dbb529d3 (diff) |
sna/trapezoids: Amalgamate adjacent mono spans
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_trapezoids.c')
-rw-r--r-- | src/sna/sna_trapezoids.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c index 9739c95d..ef3cd041 100644 --- a/src/sna/sna_trapezoids.c +++ b/src/sna/sna_trapezoids.c @@ -1490,8 +1490,8 @@ mono_add_line(struct mono *mono, DBG(("%s: top=%d, bottom=%d, line=(%d, %d), (%d, %d) delta=%dx%d, dir=%d\n", __FUNCTION__, - top, bottom, - p1->x, p1->y, p2->x, p2->y, + (int)top, (int)bottom, + (int)p1->x, (int)p1->y, (int)p2->x, (int)p2->y, dst_x, dst_y, dir)); @@ -1661,6 +1661,8 @@ mono_span (struct mono *c, int x1, int x2, BoxPtr box) if (x2 <= x1) return; + DBG(("%s [%d, %d]\n", __FUNCTION__, x1, x2)); + box->x1 = x1; box->x2 = x2; @@ -1725,7 +1727,8 @@ mono_row(struct mono *c, int16_t y, int16_t h) winding += edge->dir; if (winding == 0) { - if (I(next->x.quo) != xend) { + assert(I(next->x.quo) >= xend); + if (I(next->x.quo) > xend + 1) { mono_span(c, xstart, xend, &box); xstart = INT16_MIN; } @@ -1744,12 +1747,12 @@ mono_init(struct mono *c, int num_edges) c->head.vertical = 1; c->head.height_left = INT_MAX; - c->head.x.quo = INT_MIN; + c->head.x.quo = INT16_MIN << 16; c->head.prev = NULL; c->head.next = &c->tail; c->tail.prev = &c->head; c->tail.next = NULL; - c->tail.x.quo = INT_MAX; + c->tail.x.quo = INT16_MAX << 16; c->tail.height_left = INT_MAX; c->tail.vertical = 1; |