Proceed with the layer abstraction work from Michael Howell
This MR picks up @notriddle's work on !779 (closed) after rebasing it on top of the main branch.
-
devel-docs/render_tree.rst
is hopefully more informative now, and provides reasons for this big refactoring. -
Try to resolve more stuff before calling
DrawingCtx::with_discrete_layer
, and put it inStackingCtx
: the current_color and the paint servers for filters. -
Add
layout::Filter
with the collected gunk that filtering requires. -
Add a
Layer::Image()
variant, to complement basic shapes and text thatLayer
already supports. -
NormalizeValues
extracts the font_size fromComputedValues
so that theNormalizeParams
can be computed later, when the viewport is known, so that we can avoid passingComputedValues
all the way down towith_discrete_layer()
. I'm not sure if this is a hack, but it cleans up that function nicely. (This will probably disappear if we move to passing the current viewport as a function argument rather than as mutable state inDrawingCtx
.)
I'll merge this to keep the branch from diverging too much from main; everything is a safe refactor except for get_transform_for_stacking_ctx()
, which I'm not yet 100% sure about, but the tests pass.