[cairo] GSoC: Scan converting rasteriser update

Jeff Muizelaar jeff at infidigm.net
Wed Oct 1 12:19:04 PDT 2008


On Fri, Aug 29, 2008 at 02:29:07AM +0300, M Joonas Pihlaja wrote:
> So yeah, please check out the code and come complain to me.  The
> code is available, as always, in the spans branch of
> http://gitweb.freedesktop.org/?p=users/joonas/cairo

Here are some comments based on a look though some of the new code a while ago:

Overall comments:
- I don't really like the make_span_renderer interface. It might be better if
  instead of relying on the fallback surface, we had helpers that would be called from
  the image surface's fill and stroke methods.

  e.g.
  image_surface_fill() {
    mask = span_rasterize_path_to_mask()
    composite_surface_with_mask(mask)
  }

  image_surface_stroke() {
    poly = stroke_to_polygon()
    image_surface_fill(poly)
  }

Performance:
- we seem to iterate over the path a number of times. It would be nice to avoid this
  by perhaps merging passes or at least make it more clear when we are doing them.

- on a related note: it would be nice to avoid having to convert to a polygon before calling
  _cairo_polygon_fill_to_scan_converter. i.e. build the edge list directly
  from the fixed path

Style:
- reversed conditions in cairo-surface-fallback.c:
	e.g. 'status == CAIRO_STATUS_SUCCESS' is prefered over 'CAIRO_STATUS_SUCCESS == status'
- _cairo_polygon_fill_to_scan_converter has an unnecessary:
        if (status)
                goto unwind
  as does
  cairo_path_fixed_fill_to_span_renderer
  and
  cairo_path_fixed_stroke_to_span_renderer

- cairo-alpha-spans.c:get_row() weird cosmetics

Other comments:
- _cairo_polygon_fill_to_span_renderer has no callers
- it feels like there might be more code that isn't useda

I'll probably have more comments but let's start with these.

-Jeff


More information about the cairo mailing list