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 makingPath
andSubPath
conveniently iterable. -
Only
drawing_ctx.rs
deals with Cairo matrixes, so move the conversions toTransform
there. -
ImageSurface::compose()
used to take acairo::Operator
; now we have our ownshared_surface::Operator
instead. This converts tocairo::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.