Skip to content

Move remaining usage of Cairo to drawing_ctx.rs

Except for the public API, which takes Cairo types, this makes the library internals have no Cairo usage except for the little monster that is drawing_ctx.rs, and errors (see below).

  • The cairo-ism about having to create a stroke-sized square for 0-length paths is now in drawing_ctx.rs, by making Path and SubPath conveniently iterable.

  • Only drawing_ctx.rs deals with Cairo matrixes, so move the conversions to Transform there.

  • ImageSurface::compose() used to take a cairo::Operator; now we have our own shared_surface::Operator instead. This converts to cairo::Operator as an implementation detail, but is not visible in the shared_surface API.

To fully de-cairoize the rest of the code, I think we just need to handle cairo::Error and convert it into a librsvg error as low as possible.

Merge request reports