On 2013-03-03 12:26 +0100, Tavmjong Bah wrote:
On Sun, 2013-03-03 at 02:26 -0800, Yale Zhang wrote:
The cost is absolutely dominated by ink_cairo_surface_srgb_to_linear() and ink_cairo_surface_linear_to_srgb(). My first instinct was to optimize those 2 functions, but then I thought why are those even being called every time I scroll through the image? Why not convert the images up front to linear and stay that way in memory?
You should be able to avoid the conversion to and from linearRGB by setting the attribute color-interpolation-filters to sRGB. There is no UI for setting this other than using the XML editor. I thought, that by default, Inkscape created filters already set this to sRGB.
Apparently this does not happen in recent trunk when adding the blur via 'Fill&Stroke', see also (otherwise not related) regression reported in
- Bug #1127103 “Colour change on blurred elements with a transform” https://bugs.launchpad.net/inkscape/+bug/1127103
(a workaround for that bug - not a fix though AFAIU - is to manually edit the file in an external editor and add style="color-interpolation-filters:sRGB" to the blur filter definition which had been created via Fill&Stroke)