- int64_t x = min_x;
- while (x <= max_x)
- {
- bool start_black = IsBlack(target.pixels, 4*(x+yy));
- bool black = start_black;
- segments.push_back({x,x,start_black});
- while (black == start_black && ++x <= max_x)
- {
- black = IsBlack(target.pixels, 4*(x+yy));
- }
- segments.back().second = x-1;
- }
-
- // Keep only the interior segments
- list<Segment>::iterator j = segments.begin();
- //TODO: Magically delete unneeded segments here...
-
- // Fill in remaining segments
- for (j=segments.begin(); j != segments.end(); ++j)
- {
- Colour c(group.m_fill);
- if (j->all_black)
- {
- c.r = 1;//1; // Change to debug the outline scanning
- c.g = 0;
- c.b = 0;
- c.a = 1;
- }
- for (x = max(min_x, j->first); x <= min(max_x, j->second); ++x)
- {
- int64_t index = 4*(x+yy);
- target.pixels[index+0] = 255*c.r;
- target.pixels[index+1] = 255*c.g;
- target.pixels[index+2] = 255*c.b;
- target.pixels[index+3] = 255*c.a;
- }
- }
- }
- //#endif //SHADING_DUMB
+
+ pair<int64_t,int64_t> top(CPUPointLocation(path.m_top, view, target));
+ pair<int64_t,int64_t> bottom(CPUPointLocation(path.m_bottom, view, target));
+ pair<int64_t,int64_t> left(CPUPointLocation(path.m_left, view, target));
+ pair<int64_t,int64_t> right(CPUPointLocation(path.m_right, view, target));
+ FloodFillOnCPU(top.first, top.second+1, pix_bounds, target, path.m_fill);
+ FloodFillOnCPU(bottom.first, bottom.second-1, pix_bounds, target, path.m_fill);
+ FloodFillOnCPU(left.first+1, left.second, pix_bounds, target, path.m_fill);
+ FloodFillOnCPU(right.first-1, right.second, pix_bounds, target, path.m_fill);
+