SharedImageSurface refactors and performance improvements
- Unified
BadIntermediateSurfaceState
andIntermediateSurfaceCreation
inFilterError
. This allows refactoringSharedImageSurface
methods to createSharedImageSurface
-s in them (since there's now no need to split the twocairo::Status
error types) and generally simplify some code. It's possible to tell which one of the two it was by looking at thecairo::Status
anyway I think. - Refactored
SharedImageSurface
andsrgb::
methods to returnSharedImageSurface
. - Implemented the
alpha_only
flag forSharedImageSurface
-s. - Added some
alpha_only
optimizations. - Marked
PixelRectangle::next()
as#[inline(always)]
.
All of this reduced the mobile phone rendering time from 40 to 29 seconds on my PC and svg1.1/filters-*.svg
with -p 1 -r 100
by 1 second.
Here are some flamegraphs for the mobile phone (perf record --call-graph=dwarf ./rsvg-convert -o /dev/null mobile_phone_01.svg
):
- Before the main optimizations. The large part in the middle is two gaussian blurs, taking up 50.63% of the time:
- After, gaussian blurs take up 36.98% of the time:
Edited by Ivan Molodetskikh