LineArt: Remove duplicated edge-boundbox linking.

The edge is linked twice from differen calls during line art calculation
Probably caused by a merge and both calls stayed for some reason.
This would lead to edge link overflowing its limit of 2^16 items.
This commit is contained in:
YimingWu 2021-12-27 14:21:12 +08:00
parent 20b438d523
commit 52585b39a1
1 changed files with 1 additions and 15 deletions

View File

@ -2930,15 +2930,7 @@ static LineartEdge *lineart_triangle_intersect(LineartRenderBuffer *rb,
result->intersection_mask = (tri->intersection_mask | testing->intersection_mask);
lineart_prepend_edge_direct(&rb->intersection.first, result);
int r1, r2, c1, c2, row, col;
if (lineart_get_edge_bounding_areas(rb, result, &r1, &r2, &c1, &c2)) {
for (row = r1; row != r2 + 1; row++) {
for (col = c1; col != c2 + 1; col++) {
lineart_bounding_area_link_edge(
rb, &rb->initial_bounding_areas[row * LRT_BA_ROWS + col], result);
}
}
}
return result;
}
@ -3409,7 +3401,6 @@ static void lineart_bounding_area_split(LineartRenderBuffer *rb,
LineartBoundingArea *ba = lineart_mem_acquire(&rb->render_data_pool,
sizeof(LineartBoundingArea) * 4);
LineartTriangle *tri;
LineartEdge *e;
ba[0].l = root->cx;
ba[0].r = root->r;
@ -3475,11 +3466,6 @@ static void lineart_bounding_area_split(LineartRenderBuffer *rb,
}
}
for (int i = 0; i < root->line_count; i++) {
e = root->linked_lines[i];
lineart_bounding_area_link_edge(rb, root, e);
}
rb->bounding_area_count += 3;
}