Skip to content

filters: simplify code to render filters

Paolo Borelli requested to merge pborelli/librsvg:filters into master

Instead of using owning_ref, we define an as_filter method on the NodeTrait that returns None for other nodes and returns the Filter trait for filter primitives.

I am not super happy with this, so if you have any suggestion on how to improve this I would be happy to hear... I tried to use blanket implementations etc to avoid the manual impl macro, but until "specialization" is available I did not find a cleaner way.

Overall however still seems better than trying to downcast in a loop :)

Merge request reports