int bytes = count_y * sizeof(i_int_hline_entry *);
if (bytes / count_y != sizeof(i_int_hline_entry *)) {
- m_fatal(3, "integer overflow calculating memory allocation\n");
+ i_fatal(3, "integer overflow calculating memory allocation\n");
}
hlines->start_y = start_y;
int x_limit = x + width;
if (width < 0) {
- m_fatal(3, "negative width %d passed to i_int_hlines_add\n", width);
+ i_fatal(3, "negative width %d passed to i_int_hlines_add\n", width);
}
/* just return if out of range */
*/
void
i_int_hlines_fill_fill(i_img *im, i_int_hlines *hlines, i_fill_t *fill) {
+ i_render r;
int y, i;
+ i_render_init(&r, im, im->xsize);
+
+ for (y = hlines->start_y; y < hlines->limit_y; ++y) {
+ i_int_hline_entry *entry = hlines->entries[y - hlines->start_y];
+ if (entry) {
+ for (i = 0; i < entry->count; ++i) {
+ i_int_hline_seg *seg = entry->segs + i;
+ int width = seg->x_limit-seg->minx;
+
+ i_render_fill(&r, seg->minx, y, width, NULL, fill);
+ }
+ }
+ }
+ i_render_done(&r);
+
+#if 1
+#else
if (im->bits == i_8_bits && fill->fill_with_color) {
i_color *line = mymalloc(sizeof(i_color) * im->xsize);
i_color *work = NULL;
if (work)
myfree(work);
}
+#endif
}
/*