Files
Tomaž Vajngerl a3253ebf8d basegfx: speed up B2DHomMatrix a bit
translate/scale/rotate/shearX/shearY each used to build a
temporary B2DHomMatrix in the obvious sparse form and run the
generic doMulMatrix to combine it with *this, which multiplies and
adds a lot of zeros for every call. Make it faster by applying each
transform directly to the six stored cells instead.

Also unroll doMulMatrix itself (caching the six old values in
locals since the result overwrites them) and unroll the isIdentity
/ identity loops.

Using the micro-bench the speedup can be 50% for translate and
shear operations. In practice this will not have much measurable
effect (it could accumulate as B2DHomMatrix is used a lot for
rendering) but as the code is also more straight forward it is
worth merging.

Signed-off-by: Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>
Change-Id: If13d91d4c7353be4e4433d8d8bb7f40866578a5b
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2755
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 3db39371454fa7de994dbc9b214668a4818ed357)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205801
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-16 22:27:31 +02:00
..