[bo-rectangular] Fix assertion failure with insertion sort

We remember the location of the last insert as the next edge is likely to
be nearby. However, we need to be careful when the pointer rests upon the
HEAD and ensure that we begin the search from the appropriate end.
This commit is contained in:
Chris Wilson 2009-08-30 10:09:51 +01:00
parent 19ebf83b67
commit a6bcb6260e

View file

@ -570,6 +570,8 @@ _cairo_bo_sweep_line_insert (cairo_bo_sweep_line_t *sweep_line,
/* right edge */
pos = sweep_line->current_right;
if (pos == &sweep_line->sweep)
pos = sweep_line->sweep.prev;
if (pos != &sweep_line->sweep) {
int cmp;
@ -596,6 +598,8 @@ _cairo_bo_sweep_line_insert (cairo_bo_sweep_line_t *sweep_line,
/* left edge */
pos = sweep_line->current_left;
if (pos == &sweep_line->sweep)
pos = sweep_line->sweep.next;
if (pos != &sweep_line->sweep) {
int cmp;