Draft: start a render tree
Okay, not quite. But this is the beginning, hopefully.
-
Start a
Stroke
struct which is intended to have all the stroke parameters in user-space coordinates. I couldn't put thepaint_source
in there, since creating aUserSpacePaintSource
first needs thebbox
of the path/shape in question. -
Remove the
DrawingCtx.push_cairo_context/pop_cairo_context/with_cairo_context
hacks; replace them withDrawingCtx.nested()
.
The first point goes along with the idea of normalizing everything to user-space coordinates early as possible. I'm starting to feel like BoundingBox
needs to be split again; we only need the objectBoundingBox / cairo_path_extents() here, not the ink_rect.
(Alternative: start looking into Rust crates to compute path extents and such. The kurbo crate can do it.)
I'd like to end up with something like
struct Shape {
path: Path,
fill: Fill,
stroke: Stroke,
paint_order: ...,
opacity / filters / mask: ...,
}
all in user-space coordinates, for the leaf nodes of the render tree.
Comments appreciated :)