Now that blurring works fine, I think next up is some rearchitecturing
in your part. You are creating and deleting the filter object twice
per each call to nr_arena_item_render, once to get the extent from it
and then to do the actual render. This is inefficient. I think filter
object must be a property of NRArenaItem, created upon demand (i.e. on
first render) and then reused for all subsequent renders of that item.
Similarly, gaussian blur filter should create its x and y kernels on
demand and not regenerate them upon each render.
However, we need to update the filter if some of its parameters
change, and we need to get the list of filter primitives and their
parameters to create it in the first place. All you have at the
NRArena level is a (copy of) object's SPStyle - it's in the subclasses
of arena item (shape and glyphs), but to get from the href in the
filter property to the actual structure and values, you need some
additional interfaces. Hugo & Niko, did you give any thought to it?
Did you study how this is solved for gradients? Niko, did you check
out Hugo's initial SPFilter code? Please share your thoughts.
Inkscape. Draw Freely.