Skip to content

Filter-related refactoring and color-interpolation-filters support

Ivan Molodetskikh requested to merge YaLTeR/librsvg:filters-to-rust-6 into master
  • Replaced stuff in filters::iterators with surface_utils which includes SharedImageSurface, a wrapper providing safe shared access (hopefully this time). As far as I can tell with this wrapper you can't modify the image surface while it's being accessed read-only from potentially multiple places at once. (Unless you set_as_source_surface() and then somehow extract the image surface from get_source(), which I'm not sure is possible, but if it is set_as_source_surface() needs to be marked as unsafe with a note saying you shouldn't do that).
  • Added support for color-interpolation-filters property.
  • Refactored {un,}linearization to happen pretty much transparently to filter primitives removing some boilerplate and room for error.
  • The previous point applied to the remaining C filters revealed a bug in bounds computation which was fixed.
  • Turns out feComposite does indeed need to linearize the second surface, and composite-04 and 05 are giving different results due to <image> and feImage loading the bird image with darker colors than other SVG viewers. It's a little strange because opening the bird image in GIMP seems to give the same darker colors as I get with librsvg which suggests that <image> is loading it correctly, but the SVG test reference image and Chromium + Firefox display that bird image in lighter colors. The other test images seem to be unaffected by this.

Merge request reports