Skip to content

Implement {Fill,Stroke}Paint, fix <image>, port feBlend, feFlood and feComponentTransfer

Ivan Molodetskikh requested to merge YaLTeR/librsvg:filters-to-rust-5 into master
  • Implemented FillPaint and StrokePaint inputs for filters which work at least for the tested simple solid fill cases. Resolves #169 (closed).
  • Ported feBlend, feComponentTransfer, feFlood.
  • Fixed scaling, or, particularly, extends, in <image>.
  • Refactored srgb::{un,}linearize_surface() to use the pixel iterators.
  • Made ImageSurfaceDataShared use u32 for reading pixels, making it behave exactly as stated in the Cairo docs (it was in the wrong order before). I believe this renders channelmap unneeded?
  • Made creating ImageSurfaceDataShared unsafe because it's easily possible to invoke undefined behavior by cloning an image surface after creating an ImageSurfaceDataShared, and then modifying it through a cairo::Context. I have do ideas on how to make a safe interface for this, I'll implement them afterwards.
  • Changed feOffset to work via Cairo's pixel copying functions which are optimized.
  • Added unbounded number_list() parsing because it was needed for component transfer.
  • Removed leftover rsvg_filter_render definition in rsvg-filter.h.

Component transfer code is interesting and contains impl Trait, but if we aren't moving to 1.26 yet I can try to remove it.

Merge request reports