Kaydet (Commit) 7b0f064d authored tarafından Bartosz Kosiorek's avatar Bartosz Kosiorek Kaydeden (comit) Thorsten Behrens

tdf#109340 Improve performance by reducing matrix multiplication

Multiplication of two B2DHomMatrix with operator* is very CPU expensive,
because 24 of double-precision floating point multiplication
needs to be performed.

With this patch I have reduced Multiplication of matrix,
by creating combined Scale and Transform matrix at once.
It allows to reduce matrix multiplication by one,
and improve import time.

Change-Id: I85fde6354e458659a0214514c6e05b8e2ee04185
Reviewed-on: https://gerrit.libreoffice.org/45704Reviewed-by: 's avatarPatrick Jaap <patrick.jaap@tu-dresden.de>
Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst ae175665
......@@ -283,8 +283,8 @@ namespace emfplushelper
// To evtl. correct and see where this came from, please compare with the implementations
// of EmfPlusHelperData::MapToDevice and EmfPlusHelperData::Map* in prev versions
maMapTransform = maWorldTransform;
maMapTransform *= basegfx::utils::createScaleB2DHomMatrix(100.0 * mnMmX / mnPixX, 100.0 * mnMmY / mnPixY);
maMapTransform *= basegfx::utils::createTranslateB2DHomMatrix(double(-mnFrameLeft), double(-mnFrameTop));
maMapTransform *= basegfx::utils::createScaleTranslateB2DHomMatrix(100.0 * mnMmX / mnPixX, 100.0 * mnMmY / mnPixY,
double(-mnFrameLeft), double(-mnFrameTop));
maMapTransform *= maBaseTransform;
}
......@@ -812,7 +812,7 @@ namespace emfplushelper
{
sal_uInt32 header, version;
rMS.ReadUInt32(header).ReadUInt32(version).ReadInt32(mnHDPI).ReadInt32(mnVDPI);
rMS.ReadUInt32(header).ReadUInt32(version).ReadUInt32(mnHDPI).ReadUInt32(mnVDPI);
SAL_INFO("drawinglayer", "EMF+ Header");
SAL_INFO("drawinglayer", "EMF+\theader: 0x" << std::hex << header << " version: " << std::dec << version << " horizontal DPI: " << mnHDPI << " vertical DPI: " << mnVDPI << " dual: " << (flags & 1));
break;
......
......@@ -198,8 +198,8 @@ namespace emfplushelper
float mfPageScale;
sal_Int32 mnOriginX;
sal_Int32 mnOriginY;
sal_Int32 mnHDPI;
sal_Int32 mnVDPI;
sal_uInt32 mnHDPI;
sal_uInt32 mnVDPI;
/* EMF+ emf header info */
sal_Int32 mnFrameLeft;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment