Skip to content

Proceed with the layer abstraction work from Michael Howell

Federico Mena Quintero requested to merge federico/librsvg:layer into main

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 in StackingCtx: 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 that Layer already supports.

  • NormalizeValues extracts the font_size from ComputedValues so that the NormalizeParams can be computed later, when the viewport is known, so that we can avoid passing ComputedValues all the way down to with_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 in DrawingCtx.)

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.

Merge request reports