+ Rect bounds(CPURenderBounds(objects.bounds[m_indexes[i]], view, target));
+ PixelBounds pix_bounds(bounds);
+ Path & path = objects.paths[objects.data_indices[m_indexes[i]]];
+
+ if (view.ShowingFillPoints())
+ {
+
+ PixelPoint start(CPUPointLocation((path.m_top+path.m_left+path.m_right+path.m_bottom)/4, view, target));
+ for (unsigned f = 0; f < path.m_fill_points.size(); ++f)
+ {
+ PixelPoint end(CPUPointLocation(path.m_fill_points[f], view, target));
+ RenderLineOnCPU(start.first, start.second, end.first, end.second, target, Colour(0,0,255,0));
+ }
+ }
+
+ if (!view.PerformingShading())
+ continue;
+
+ for (unsigned b = path.m_start; b <= path.m_end; ++b)
+ {
+ BezierRenderer::RenderBezierOnCPU(b,objects,view,target,path.m_stroke);
+ }
+
+ if (pix_bounds.w*pix_bounds.h > 100)
+ {
+ vector<Vec2> & fill_points = path.FillPoints(objects, view);
+ Debug("High resolution; use fill points %u,%u", pix_bounds.w, pix_bounds.h);
+ for (unsigned f = 0; f < fill_points.size(); ++f)
+ {
+ PixelPoint fill_point(CPUPointLocation(fill_points[f], view, target));
+
+ FloodFillOnCPU(fill_point.first, fill_point.second, pix_bounds, target, path.m_fill, path.m_stroke);
+ }
+ }
+ else
+ {
+ Debug("Low resolution; use brute force %u,%u",pix_bounds.w, pix_bounds.h);
+ int64_t y_min = max((int64_t)0, pix_bounds.y);
+ int64_t y_max = min(pix_bounds.y+pix_bounds.h, target.h);
+ int64_t x_min = max((int64_t)0, pix_bounds.x);
+ int64_t x_max = min(pix_bounds.x+pix_bounds.w, target.w);
+ for (int64_t y = y_min; y < y_max; ++y)
+ {
+ for (int64_t x = x_min; x < x_max; ++x)
+ {
+ Rect pb(path.SolveBounds(objects));
+ Vec2 pt(pb.x + (Real(x-pix_bounds.x)/Real(pix_bounds.w))*pb.w,
+ pb.y + (Real(y-pix_bounds.y)/Real(pix_bounds.h))*pb.h);
+ if (path.PointInside(objects, pt))
+ {
+ FloodFillOnCPU(x, y, pix_bounds, target, path.m_fill, path.m_stroke);
+ }
+ }
+ }
+ }