From 4412e32218c73f3f6637e40417f7823ab96ecdb5 Mon Sep 17 00:00:00 2001 From: johncoswell Date: Fri, 18 Apr 2008 01:31:11 +0000 Subject: [PATCH] Small Paint Bucket optimization for creating GrayMap --- src/flood-context.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/flood-context.cpp b/src/flood-context.cpp index f58ab0830..ee7f1b0da 100644 --- a/src/flood-context.cpp +++ b/src/flood-context.cpp @@ -410,9 +410,12 @@ static void do_trace(bitmap_coords_info bci, guchar *trace_px, SPDesktop *deskto GrayMap *gray_map = GrayMapCreate(bci.width, bci.height); for (unsigned int y = 0; y < bci.height ; y++) { + unsigned long *gray_map_t = gray_map->rows[y]; + trace_t = get_pixel(trace_px, 0, y, bci.width); for (unsigned int x = 0; x < bci.width ; x++) { - gray_map->setPixel(gray_map, x, y, is_pixel_colored(trace_t) ? GRAYMAP_BLACK : GRAYMAP_WHITE); + *gray_map_t = is_pixel_colored(trace_t) ? GRAYMAP_BLACK : GRAYMAP_WHITE; + gray_map_t++; trace_t += 4; } } -- 2.30.2